How to deploy a website on Walrus Sites
Introduction to Walrus Sites: The Future of Decentralized Web Hosting
Walrus Sites are a new breed of decentralized websites, powered by Sui and Walrus. They showcase how Walrus technology can revolutionize the way we build and interact with web applications — without the need for traditional hosting services or centralized control. With Walrus Sites, anyone can create, deploy, and share their own decentralized web experiences seamlessly.
Interestingly, this very documentation is itself a Walrus Site! You can access it at docs.walrus.site (unless you’re already here).
Key Features of Walrus Sites
• Effortless Deployment 🚀
No need for server management or complex configurations — simply provide your web app’s source files, publish them using the site-builder tool, and your site is live!
• Sui-Integrated Linking 🔗
Walrus Sites can be linked to Sui objects, enabling unique use cases like NFT collections where each NFT has its own personalized website.
• True Ownership & Flexibility 🔐
Unlike traditional domains, Walrus Sites are owned by Sui addresses, making them transferable, shareable, and updatable. They can also leverage SuiNS for human-readable names, eliminating the hassle of managing DNS records.
• Immutable & Always Available 🌍
Thanks to Walrus’s decentralization and high data availability, your site cannot be taken down arbitrarily — ensuring censorship resistance and reliability.
• Programmability Without Centralized Backends 🏗️
While Walrus Sites are static by design, they can integrate with Sui-compatible wallets and leverage Sui smart contracts to introduce dynamic functionality — bringing web3-native interactivity to decentralized websites.
Walrus Sites redefines web hosting by providing a trustless, decentralized, and user-owned alternative to traditional platforms. Ready to build the next-generation web? Let’s dive in! 🚀
In our lab we are using Ubuntu 22.04 as an operating system, all commands below are valid only for Ubuntu and may be different for your system.
Installation
To move forward we will need several components to be installed — walrus and site-builder.
Walrus currently provides the walrus client binary for macOS (Intel and Apple CPUs), Ubuntu, and Windows. We are using compiled binary for Ubuntu:
SYSTEM=ubuntu-x86_64
curl https://storage.googleapis.com/mysten-walrus-binaries/walrus-testnet-latest-$SYSTEM -o walrus
sudo chmod +x walrus
sudo mv walrus /usr/local/bin/walrus
walrus --help
Walrus client
Usage: walrus [OPTIONS] <COMMAND>
Similar to the walrus client CLI tool, Walrus currently provides the site-builder client binary for macOS (Intel and Apple CPUs), Ubuntu, and Windows. We are using compiled binary for Ubuntu:
SYSTEM=ubuntu-x86_64
curl https://storage.googleapis.com/mysten-walrus-binaries/site-builder-testnet-latest-$SYSTEM -o site-builder
chmod +x site-builder
sudo mv site-builder /usr/local/bin/site-builder
site-builder --help
INFO site_builder: initializing site builder
Usage: site-builder [OPTIONS] <COMMAND>
To be able to run it simply as site-builder, move the binary to any directory included in your $PATH environment variable. The standard location is /usr/local/bin.
Configuration
- Okay, now that we have both apps in place we need to generate a sui wallet and get some testnet sui tokens to cover transaction and hosting costs.
# module: site
walrus generate-sui-wallet --path sui-wallet-for-stakecraft-demo/client_config.yaml
INFO walrus: client version: 1.13.2-ece83152c8e9
INFO walrus_service::common::utils: generating Sui wallet for testnet at 'sui-wallet-for-stakecraft-demo/client_config.yaml'
INFO walrus_service::common::utils: generated a new Sui wallet; address: 0x1e37e7ad8d01cb15312ea96724bac0222858d10ba2d1c0ba7df9ffbbec564cff
Success: Generated a new Sui wallet with address 0x1e37e7ad8d01cb15312ea96724bac0222858d10ba2d1c0ba7df9ffbbec564cff
2. Now we are requesting some sui tokens at https://faucet.sui.io/?network=testnet. After the wallet got funded you can verify the balance using Explorer: https://suiscan.xyz/testnet/home
3. The site-builder app needs a config file — sites-config.yaml. It looks like this:
# module: site
# portal: walrus.site
package: 0xdf9033cac39b7a9b9f76fb6896c9fc5283ba730d6976a2b1d85ad1e6036c3272
# general:
# rpc_url: https://fullnode.testnet.sui.io:443
# wallet: /path/to/.sui/sui_config/client.yaml
# walrus_binary: /path/to/walrus
# walrus_config: /path/to/devnet_deployment/client_config.yaml
# gas_budget: 500000000
You can download it directly from Walrus GitHub:
curl https://raw.githubusercontent.com/MystenLabs/walrus-sites/refs/heads/testnet/sites-config.yaml -o ~/.config/walrus/sites-config.yaml
The configuration file is simple. The only mandatory field is the package field, which represents the Sui object ID of the Walrus Sites smart contract. You can find the latest version of the package in the Walrus Sites repository on the testnet branch, because the Walrus project is still in the testnet phase.
You can define the location of the sites-config.yaml file using the — config flag when running the site-builder commands or you can store it in a default location which is $HOME/walrus/sites-config.yaml
Publishing Stakecraft’s landing page
Now that everything is installed and configured, let’s start publishing our demo site!
site-builder --walrus-binary walrus --walrus-config ~/walrus/client_config.yaml --wallet ~/walrus/sui_client.yaml --config ~/walrus/sites-config.yaml publish --epochs 1 stakecraft/
INFO site_builder: initializing site builder
INFO site_builder: loading sites configuration config_path="/home/walrus/sites-config.yaml"
INFO site_builder: configuration loaded config=Config { portal: "walrus.site", package: 0xdf9033cac39b7a9b9f76fb6896c9fc5283ba730d6976a2b1d85ad1e6036c3272, general: GeneralArgs { rpc_url: None, wallet: Some("~/walrus/sui_client.yaml"), walrus_binary: Some("walrus"), walrus_config: Some("~/walrus/client_config.yaml"), gas_budget: Some(500000000) } }
Parsing the directory stakecraft/ and locally computing blob IDs ... [Ok]
INFO site_builder::util: Using wallet configuration from ~/walrus/sui_client.yaml
Storing resource on Walrus: /assets/Admin-CbWCdWgS.css ... [Ok]
Storing resource on Walrus: /assets/Admin-Cs9qmmok.js ... [Ok]
Storing resource on Walrus: /assets/GeneralSans-D4t1btYN.ttf ... [Ok]
Storing resource on Walrus: /assets/Poppins-Regular-JiV4gZDp.ttf ... [Ok]
Storing resource on Walrus: /assets/PrivacyPolicy-CwKpnogm.css ... [Ok]
Storing resource on Walrus: /assets/PrivacyPolicy-DfeiCBGL.js ... [Ok]
Storing resource on Walrus: /assets/Swap-1qwgvQ5z.css ... [Ok]
Storing resource on Walrus: /assets/Swap-Cuyr1N4q.js ... [Ok]
Execution completed
Resource operations performed:
- created resource /assets/Admin-CbWCdWgS.css with blob ID 6nAJpeHMBf3g-JQOg1mZ9t_0-27eINQy-aNfJcpeN3s
- created resource /assets/Admin-Cs9qmmok.js with blob ID 5wKM0Pi7j-z7EA1j0uegh_W6IuInrBf4NLncxvnwzN0
- created resource /assets/GeneralSans-D4t1btYN.ttf with blob ID UYYDQwoI0CHedqGIKsLJbZYaWrUGG5ckZWOyBLZ9jL8
- created resource /assets/Poppins-Regular-JiV4gZDp.ttf with blob ID KkSyLTmJ4XkKZdNUN4nUrHzMlqX669vSntRngqEYIQM
- created resource /assets/PrivacyPolicy-CwKpnogm.css with blob ID EOI4ZFmVIbBrCynoy_RaOdvo9jQ2K6Ki-BARJ71kq9o
- created resource /assets/PrivacyPolicy-DfeiCBGL.js with blob ID aCH4zZbuqepmAXr2nWyju1ST3fbWDkheHB1wLmuj0BE
- created resource /assets/Swap-1qwgvQ5z.css with blob ID fu_idFpl5GtjRYSaMh7KR_J1Z2Pqc17GPTmZzLOO5ac
The site routes were left unchanged
Created new site: test site
New site object ID: 0x50fea07cf98e33aa6a73c1cefdd7c26aba430aa04ee3176ec015d7723204f762
Browse the resulting site at: https://20o8nkb4r6icu3nznobifr57f9jedf6ii83omqsx57fsoujzaa.walrus.site
Walrus client_config.yaml can be found here.
On the Walrus Testnet, an epoch lasts two days. To keep your site live for a longer period, you can specify the desired number of epochs using the — epochs flag, with a maximum limit of 183 epochs.
A few words about Stakecraft’s demo website. It’s a set of static HTML, PNG, CSS, and JS files.
This output indicates that a new Walrus blob has been created for each file in the folder, along with its corresponding blob ID. Additionally, it provides the object ID of the Walrus Site on Sui, allowing you to check it in the explorer or use it to set the SuiNS name. Finally, it displays the URL where you can access the published site.
It’s important to note that the default sites-config.yaml file is being used as the configuration for the site builder, which we previously set up during installation. This configuration file is essential to ensure that the site builder correctly references the Sui package responsible for Walrus Sites functionality.
Let’s navigate to https://20o8nkb4r6icu3nznobifr57f9jedf6ii83omqsx57fsoujzaa.walrus.site and see what’s there. Wow, it looks the same as https://dev.stakecraft.com
Update the site
Now, let’s say we want to update the content of our site — for instance, changing the title from “StakeCraft” to “StakeCraft on Walrus”.
Steps to Update the Site:
- First, make this change in the ./stakecraft/index.html file.
- Then, update the existing site by running the update command, specifying:
• The directory containing the updated files (./stakecraft).
• The object ID of the existing site (0x50fe…).
This process ensures your changes are reflected seamlessly. 🚀
INFO site_builder: initializing site builder
INFO site_builder: loading sites configuration config_path="/home/walrus/sites-config.yaml"
INFO site_builder: configuration loaded config=Config { portal: "walrus.site", package: 0xdf9033cac39b7a9b9f76fb6896c9fc5283ba730d6976a2b1d85ad1e6036c3272, general: GeneralArgs { rpc_url: None, wallet: Some("/opt/walrus/config/publisher/sui_client.yaml"), walrus_binary: Some("/opt/walrus/bin/walrus"), walrus_config: Some("/opt/walrus/config/client_config.yaml"), gas_budget: Some(500000000) } }
Parsing the directory stakecraft/ and locally computing blob IDs ... [Ok]
INFO site_builder::util: Using wallet configuration from /opt/walrus/config/publisher/sui_client.yaml
INFO site_builder::site: fetching the resources from the dynamic fields batch_size=10 delay=100ms req_s=100.0
Storing resource on Walrus: /index.html ... [Ok]
Updating the Walrus Site object on Sui ... [Ok]
Execution completed
Resource operations performed:
- deleted resource /index.html with blob ID A-ukYHCKsxINH-7w3h2p-dYMqx7TO_LOOtXrgGnPTMU
- created resource /index.html with blob ID rQiCDcZs6pL_6q2xRASUhcehRZjYALhwEmRULcRtseY
The site routes were left unchanged
Site object ID: 0x50fea07cf98e33aa6a73c1cefdd7c26aba430aa04ee3176ec015d7723204f762
Browse the resulting site at: https://20o8nkb4r6icu3nznobifr57f9jedf6ii83omqsx57fsoujzaa.walrus.site
Compared to the publish action, this time the only operations performed were deleting the old index.html file and replacing it with the updated version.
Now, simply navigate to the provided URL, and we should see the changes reflected — our site is successfully updated! 🚀
Readable website name
Walrus Sites allows to use SuiNS service (this is like DNS for Sui) to assign a human-readable name to a site. To do so, you simply have to get a SuiNS name you like, and point it to the object ID of the Walrus Site (as provided by the publish or update commands).
- Navigate to https://testnet.suins.io and buy a domain name with your Testnet wallet. In my case I had to pay 10 USD for the domain stakecraft.walrus.site
- Now, you can set the SuiNS name to point to the address of your Walrus Site. To do so, go to the “names you own” section of the SuiNS website, click on the “three dots” menu icon above the name you want to map, and click “Link To Walrus Site”. Paste in the bar the object ID of the Walrus Site, check that it is correct, and click “Apply”.
After approving the transaction, we can now browse https://stakecraft.walrus.site
That’s it! 🎉 You’ve successfully deployed a site on Walrus Sites. Now, explore its features, experiment with SuiNS, and take your decentralized web hosting to the next level! 🚀
Sources:
https://docs.walrus.site/walrus-sites/intro.html
https://suiscan.xyz/testnet/home