How to Publish a Website on Swarm Using the Swarm Desktop App: A Step-by-Step Guide
TL;DR: This guide will walk you through the process of publishing a website on Swarm using the Swarm Desktop App. You’ll learn how to install the app, fund your account, upload your website, and connect an ENS domain for a user-friendly experience. By following these steps, you’ll be able to host a censorship-resistant website on decentralised storage and make it easily accessible for users.
Introduction to the Swarm Desktop App
Swarm Desktop App serves as a personal access point to the Swarm network, enabling interaction with content hosted on Swarm. The app allows you to:
- Store (upload and download) files to decentralised storage (Swarm)
- Securely and privately send files to others
- Easily host and manage HTML websites.
Install Swarm Desktop App and Fund Your Account
First, download and install the Swarm Desktop App. Next, add xDAI (transaction fees) to your Node Wallet address. If you possess xBZZ (storage fees), you can deposit it alongside the xDAI. Otherwise, you can exchange your xDAI for xBZZ using the Swarm Desktop app.
Follow these steps to deposit funds:
- Launch the Swarm Desktop App and go to the Account section in the left menu.
- Transfer xDAI to your node wallet address. For safety, we suggest sending no more than 5 to 10 xDAI.
- After funding your wallet, click the Top Up Wallet button on the right side of the screen.
- Select the Use xDAI option.
- Verify your xDAI balance and click Proceed.
- Specify the amount of xDAI to convert to xBZZ and click Swap Now.
- Your Node Wallet address will be credited with xBZZ.
Your node address is now funded with xDAI and xBZZ. However, to upload data on Swarm, you will need to transfer your funds to the Chequebook contract address.
Follow these steps:
- Go to the Account section in the left menu.
- Select the Chequebook tab in the top menu.
- Click the Deposit button.
- Specify the amount of xBZZ to deposit into your Chequebook, which will be used for storage costs.
Publishing Your Website on Swarm
To publish your website on Swarm, follow these steps:
- Navigate to the Files tab.
- Click the Add Website button.
- Select your website folder. NOTE: The index.html file should be in the root folder.
- Purchase a Postage Stamp to publish your page. NOTE: Postage stamps cover storage costs for a specified duration.
- Upload the website to your Node.
NOTE: If you plan to update your website in the future please check the last section in the blogpost
Please note that if you’re planning to update your website in the future, be sure to check out the last section of the blog post.
Connecting an ENS Domain to Your Website
Associating your ENS domain with a Swarm hash generates a memorable, user-friendly identifier for your website, allowing users to easily locate and access your website without having to recall a lengthy, complex Swarm hash.
Initially, you’ll need to register your domain name. To register and manage your ENS domain, you can use the ENS Domains Dapp along with the MetaMask browser extension.
After registering your name and connecting MetaMask to the relevant Ethereum account, set the resolver to use the public ENS if you haven’t already.
- Navigate to My Names and select the name you want to link to your Swarm content.
- Click on ADD/EDIT RECORD.
- From the “add record” dropdown menu, select Content.
- Enter your Swarm Hash, beginning with “bzz://” and click “Save.”
Your website is now available on:
https://api.gateway.ethswarm.org/bzz/swarm-devrel.eth/
Update the Website: Set up and update a feed
Swarm feeds allow you to easily create a permanent address for your content stored on Swarm that you can update at any time.
If you plan to update your website in the future, it’s recommended that you set up a “Feed” before uploading your website to Swarm. This way, the Swarm Hash connected to your ENS domain will stay the same, even as you change the content behind that hash. This will enable you to update your website’s content without changing the Swarm Hash and incurring Ethereum transaction costs each time you do so.
Set up a Feed:
- Navigate to to Account
- Click on Feeds in the top menu
- Clik on Create New Feed
- Define Identity name
- And click Create Feed.
Upload Website on Swarm and connect it to the Feed:
- Navigate to to Account
- Click on Feeds in the top menu
- Choose the Feed you want to update
- Click View Feed Page
- Click the Add Website button.
- Select your website folder. NOTE: The index.html file should be in the root folder.
- Add Postage Stamp to publish your page. NOTE: Postage stamps cover storage costs for a specified duration.
- Upload the website to your Node.
- Connect Feed hash to ENS domain as described above.
In conclusion, this step-by-step guide has provided you with a comprehensive understanding of how to publish and update a website on the Swarm network using the Swarm Desktop App. By following these instructions, you can now leverage the benefits of decentralised storage, maintain a censorship-resistant website, and create a user-friendly experience by connecting your site to an ENS domain.
Join Swarm’s community
- Follow community news on Twitter, and development news here.
- Discussions about Swarm can be found on Reddit.
- All tech support and other channels have moved to Discord.
- Please feel free to reach out via info@ethswarm.org.
- Join the newsletter! Subscribe here.
- Subscribe to the Swarm Foundation YouTube channel.