How to Upload your Website to Arweave
Learn how to defy censorship using the Linux command line, to get your website on Arweave.
Warning: This Guide requires Linux knowledge at an intermediate level
These are the steps to get your website on Arweave. Once you complete them, it’s easy to update.
Why CLI?
You want to avoid the ArDrive web app because it’s not only on Google Cloud, but they do not have the functionality to UPDATE your website with new content. You need the CLI (command line interface) for that.
Step 1) Getting a Static Website
Hugo
Hugo is the best here. See our earlier articles on why Hugo is superior to WordPress for static websites due to it’s speed and decreased dependence on Big Tech.
WordPress
If you really want to use WordPress for static sites you can, with the SimplyStatic plugin. However, this is better for a website you’re NOT going to change. Because the free version of the SimplyStatic plugin will give you problems with updating new articles, since it only allows for the whole site at once. You’d have to pay $200 or something for a yearly plan to do a changing site.
WordPress Plugins
There are other WordPress plugins, but some of the other ones I sampled change the links to the .com and you need relative links.
Step 2) Relative links
Hugo has to be modified to work for Arweave using “relative links”.
Serverless
Arweave does NOT use “web server” software, the servers are just displaying your static html files. That means if you open it on your local home computer, it’s exactly the same as it’s being served from Arweave’s Gateways.
No Nginx
While on the regular internet, people often use web server software such as Nginx or Apache. These help balance the load of traffic and smooth out the experience. But Nginx also changes the links for Hugo even if the links aren’t exact. For example on Nginx it works if you go to “folder” instead of “folder/index.html” This is because Nginx is smoothing it out so you don’t have to literally go to “index.html”
Nginx smoothing out links is a huge problem for Arweave, which requires links to be exact. Well how do you get exact links for Hugo?
Config File
First add these 3 things to your hugo.toml config file:
baseURL = ""
uglyURLs = true
relativeURLs = true
Then you need to specify the links in the Hugo post headers:
url = "/folder/title.html"
Serverless Themes
JMooring comments on templates that work in “serverless” mode on the Hugo forums,
https://discourse.gohugo.io/t/crafting-and-configuring-a-serverless-site/48029
Step 3) Initial Upload.
Local vs VPS?
You could do the upload on your local PC or on the same VPS you use for regular websites. If you do it from your VPS, it will be faster. You can keep two seperate wallets, with one having your domain on your local PC, and another having a tiny bit (under $20) of AR for just uploads.
Regardless of if you do it on your home PC or the VPS, it’s the same commands.
ArDrive CLI
First you need to get the ArDrive CLI wallet,
https://github.com/ardriveapp/ardrive-cli
To get this, first install npm
sudo apt install npm
Then install ArDrive CLI,
npm install -g ardrive-cli
Create a Drive
Then create a drive. Make sure to put “your-wallet.json” as your actual wallet file, and “name” as what you’re naming the drive:
ardrive create-drive --wallet-file your-wallet.json --drive-name "name"
It will spit out a JSON, which is a little database. We want to copy the folder “entityId” entry for our uploads.
"entityId": "596fbe97-c1b5-41b7-b8f6-fb7f5b936dcb",
Test Upload
Now let’s upload a single static file as a TEST into that file.
So first make your test file:
touch test.txt
nano test.txt
Write something in the file. Then with Nano: Control + X and Save it.
Upload
Let’s upload test.txt. The format is:
ardrive upload-file --local-path {file} --parent-folder-id {the entityId} -w {your-wallet}.json
So in this case:
ardrive upload-file --local-path test.txt --parent-folder-id "596fbe97-c1b5-41b7-b8f6-fb7f5b936dcb" -w my-wallet.json
DataTxId
It will spit out a JSON of your file uploaded. So then the dataTxId is used to actually view or use your file. So go to the gateway you uploaded to (because it will have the file sooner than the others). If you did not specify which gateway you’re using, then it’s arweave.net by default on ArDrive wallet. This is on AWS, but YOU CAN CHANGE IT. This is just an example.
arweave.net/dataTxId
Assuming you see your test, now it’s time to upload all your stuff.
Bulk Upload Real Thing
New Folder
Make a new folder that does NOT have your wallet in it, and put all your files in that folder.
You’re going to run this Linux script to loop through and upload them all, but you want to MAKE SURE your WALLET ISN’T GETTING UPLOADED. Keep that wallet in a different folder.
for i in *; do ardrive upload-file --local-path "$i" --parent-folder-id "{INSERT YOUR FOLDER HERE}" -w /folder-to/wallet.json; done > rawupload.txt
This will spit out the data to rawupload.txt.
for i in *; do ardrive upload-file --local-path "$i" --parent-folder-id "94bcd424-d072-414b-ae1b-6ea6c3903353" -w /user/arweave/dont-touch.json; done > rawupload.txt
View it
Using either “nano” or “cat” one can view this rawupload.txt.
Step 4) Creating a Manifest
If a German wishes to speak to a Japanese girl, he needs a translator.
If HTML links to other content on Arweave, it needs a translator.
Manifest
Arweave’s Manifest is this translator. It’s a JSON file (or database) that maps regular HTML or images to their respective Arweave dataTxIds. So when you link one webpage to another, the Arweave gateways can FIND IT.
DataTxId
When we first upload content to Arweave, the ArDrive CLI wallet will spit out a single dataTxId for the entire website. This is what is used to update the domain name.
Updates
However, when we later update that with new content, this is incredibly tediuous to manually get the dataTxIds and add them. This is where Simplified Privacy’s new Python code comes in.
Initial Website
Let’s first add it for the initial website. We’re going to create a Manifest for the same folder we just used. This is the command:
ardrive create-manifest -f "{FOLDER ID}" -w "/path/to/wallet"
And funnel it into a log text file so you can read it:
ardrive create-manifest -f "{FOLDER ID}" -w "/path/to/wallet" > log.txt
So in our case,
ardrive create-manifest -f "94bcd424-d072-414b-ae1b-6ea6c3903353" -w ~/arweave/wallet.json > log.txt
Then the hash that is on all the files, is what we’re adding to our domain…
Step 4) Getting the ArNS domain
Testnet
Important note: ArNS is currently under testnet, this means it’s controlled by the devs in which you can be censored. ArNS is scheduled to exit testnet shortly, but we do not know when. When they exit testnet, whoever currently has a testnet name, will be allowed to continue using that same name in the real network.
Spyware Discord
Please note, the official ArNS team does not share Simplified Privacy’s values, and their use corrupt surveillance Discord. This is a censorship risk, since privacy is related to privacy, as if the government doesn’t like what you have to say, then they can use violence. So keeping your anonymity with Discord is tough but using SMS crypto burners or with buying a Discord account on BitcoinTalk, it can be done.
Temporary
During testnet, you have to beg and grovel in their Discord room to get a name. In the future, when they exit testnet, it will be open to anyone to buy a name permissionless with IO tokens.
Step 5) Pointing the ArNS domain
(to the Upload dataTxId)
Arns.app
The web app arns.app currently is the easiest way to interact with the smart contracts. So you’d need test tokens first, then using the ArConnect web wallet connect to arns.app and change what TargetID it points to.
Step 6) Updates
We have an entire article and setup just for your updates found here: Link
SP Scripts
Now it’s on the updates that we are adding unique value here. Without our system, one would have to manually go through the outputs from the ArDrive CLI and copy paste them into the JSON manifest.
Our original code:
https://git.simplifiedprivacy.is/SimplifiedPrivacy/Arweave-Auto-Manifest-Update
Workflow:
But with our automation script, it works like this:
First it takes the output from ArDrive and gets all the dataTxIds and file names from the output.
Then it adds these to the end of the output.json
If there are index.html or index.xml (the homepage or RSS feed) then it updates those at the TOP of JSON, INSTEAD of adding new ones at the bottom.
Finally the Linux script updates the manifests by uploading the new JSON manifests to arweave. It does one for html and one for the RSS feed.
If you really want to learn and take your privacy to the next level, subscribe to our new content via: Nostr, Bastyon, Session, RSS, Ethereum Push
Related Posts
Arweave Gateway list
Get a full list of gateways
[SP]
Oct 2, 2024
How we're making it easier to upload to Arweave
We've automated updating the Manifest. This is the most painful part.
[SP]
Sep 19, 2024
How to Automate Updating Arweave Manifests (Websites)
Our open source code will make updating your Arweave RSS feed and website easier.
[SP]
Sep 19, 2024
HOT NEW Arweave RSS Feed!
Learn how our new RSS feed works on Arweave
[SP]
Aug 30, 2024