Sia Docs
GithubDiscordYouTubeBlogsRedditForum
Legacy
Legacy
  • Welcome to Sia!
  • Get Started with Sia
    • Introduction to these docs
    • Sia 101
    • What are Siacoins?
    • How to buy Siacoins
    • What is the Siacoin total supply?
  • Your Sia Wallet
    • Wallet overview
    • The importance of your seed
    • How to make a Sia address
    • How to send Siacoins
    • How do I change my Sia wallet password?
    • Back up your Sia wallet
    • Wallet troubleshooting
      • Delete your seed and make a new one
      • Find or fix your seed
      • I lost my seed. What do I do?
      • My deposit or withdrawal didn't go through
      • Why does Sia take so long to sync?
      • What are these deductions in my wallet?
      • Why does Sia-UI give me a new address each time I click Receive Siacoin?
    • Sia-UI FAQs
      • How to download and install Sia-UI
      • How to make a new wallet in Sia-UI
      • How to restore a wallet from a seed in Sia-UI
      • How to perform a clean install in Sia-UI
      • How do I uninstall Sia-UI?
    • For Advanced Users
      • Verify the Sia release signature
      • Using Sia on a remote node
      • Using Sia on multiple computers
      • How to bootstrap the Sia blockchain
      • How to automatically restart and unlock Sia
      • How to set an environment variable
    • 🚧walletd
      • Wallet overview
  • Renting
    • About renting on Sia
    • Managing your files
    • How to rent storage on Sia
    • How to back up and restore your files
    • Renter troubleshooting
    • Is my data secure?
    • 🚧renterd
      • About renting on Sia
      • renterd Workshop
  • Hosting
    • About hosting on Sia
    • Hosting with the Sia-UI GUI
    • Hosting with the siad CLI on Linux
    • Hosting FAQ
    • 🚧hostd
      • About hosting on Sia
      • Setup Guides
        • Linux
        • macOS
        • Windows
      • Dynamic DNS
        • DuckDNS
        • Cloudflare (Advanced)
  • Mining
    • About mining on Sia
    • Sia mining pools
  • Contributing
    • How can I contribute to Sia?
    • Where can I learn more about Sia?
  • Siafunds
    • What are Siafunds?
    • How do I buy Siafunds?
    • How to cash out Siafunds
    • SEC Settlement FAQ
  • Sia Integrations
    • Listing Siacoin on your exchange
    • Using the Sia Ledger app with Sia Central
    • Using the Sia Ledger Nano app with CLI
    • Brand guidelines for Sia in your project or site
  • Testnet
    • What is Zen?
  • Forks
    • Using the wrong chain after a fork
    • Navigating the 2021 Sia hardfork
    • So, you didn't update in time for the fork
Powered by GitBook
On this page
  • Getting Sia
  • Creating a system service
  • Creating a Wallet
  • Wait for Sync
  • Add Storage Folders
  • Set Pricing
  • Setup Host Registry (Optional)
  • Forward ports
  • Announcing
  • Using siac
  • Updating Your Host

Was this helpful?

Edit on GitHub
  1. Hosting

Hosting with the siad CLI on Linux

PreviousHosting with the Sia-UI GUINextHosting FAQ

Last updated 1 year ago

Was this helpful?

This is a technical guide to setting up a new host from scratch on Ubuntu server using only the terminal. To learn more about the basics of Sia hosting read our . This guide should be similar for any other Linux distributions.

Getting Sia

Install the latest version of siad by going to the and downloading the latest binary for your operating system. This guide has been written for v1.5.9.

You can download the files and extract them using wget and unzip

$ wget -q https://sia.tech/releases/siad/Sia-v1.5.9-linux-amd64.zip
$ unzip Sia-v1.5.9-linux-amd64.zip
$ sudo mv -t /usr/local/bin Sia-v1.5.9-linux-amd64/siad Sia-v1.5.9-linux-amd64/siac
$ rm -rf Sia-v1.5.9-linux-amd64.zip Sia-v1.5.9-linux-amd64

Creating a system service

By creating a systemd file we can start Sia whenever the server is booted instead of starting it manually. Run the following command to create a new systemd unit file:

$ sudo nano /etc/systemd/system/siad.service

Then, modify the following snippet to fit your host and then paste it into the file. You will want to change asecurewalletpassword to a more secure wallet password.

[Unit]
Description=siad
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/siad -M gctwh -d /home/ubuntu/siad
ExecStop=/usr/local/bin/siac stop
Restart=always
RestartSec=15
User=ubuntu 
Environment="SIA_WALLET_PASSWORD=asecurewalletpassword"
LimitNOFILE=900000

[Install]
WantedBy=multi-user.target
Alias=siad.service
$ sudo systemctl start siad
$ sudo systemctl enable siad

Your Sia node should now be running and accessible. You can try out a few commands to test it:

$ siac consensus
Synced: No
Height: 0
Progress (estimated): 0.0%
$ siac gateway
Address: localhost:9981
Active peers: 0
Max download speed: 0
Max upload speed: 0

Creating a Wallet

You should now create a wallet. You will need the password you set in your systemd unit earlier. I will be using asecurewalletpassword. Wallet seeds should not be shared between hosts, so we will be generating a new recovery seed. When prompted type in the wallet password you chose.

$ siac wallet init -p 
Wallet password: 
Confirm: 
Recovery seed:
sneeze toyed nerves soothe imbalance bite maps inquest obnoxious sovereign hydrogen pact quick sipped scoop language gossip acquire western dwelt hairy fossil goodbye hills dyslexic sword tossed psychic

Wallet encrypted with given password

You should now unlock your wallet with. In the future, when starting Sia your wallet will automatically unlock.

$ siac wallet unlock

The last step is to generate an address to send Siacoin to:

$ siac wallet address
Created new address: b96540b9eb96424827fe4d65bb618201c90eb2096908442746e6f29553159b4bf70a030f8cf9

You can now send Siacoin to this address to fund your host, however the funds will not show up until you are fully synced.

Hosts need Siacoin to form contracts, post collateral, and provide storage proofs. It is important to keep at least a little balance in your wallet at all times. Around $10 USD in Siacoin is enough to get started, but you may need to add more as it gets locked into storage collateral.

Wait for Sync

Now we need to wait for our host to fully synchronize we can check progress with the following command:

$ siac consensus
Synced: No
Height: 34030
Progress (estimated): 10.8%

Add Storage Folders

Now you can add storage folders. I am going to assume that any external drives are already mounted and formatted. I am going to be adding a 1TB folder mounted at /mnt/data

$ mkdir -p /mnt/data/sia/storage01
$ siac host folder add /mnt/data/sia/storage01 1TB

Set Pricing

I am going to be setting my host's storage price to 85 SC/Tb/mo (around $1.50 USD), download price to 170 SC/Tb (around $3.00 USD), and collateral to 170 SC/Tb/mo (2x storage price). Due to a bug, I will also be setting my collateral budget to 100KS. You can see all of the configuration options by typing siac host config --help

$ siac host config minstorageprice 85SC
$ siac host config mindownloadbandwidthprice 170SC
$ siac host config minuploadbandwidthprice 0H
$ siac host config collateral 170SC
$ siac host config collateralbudget 100KS

Setup Host Registry (Optional)

The Skynet registry is a key value store for storing really small data. The host does not have to post collateral for data stored in the registry, so there's no risk of losing money if you lose the stored data. It is completely optional to enable.

Pricing is based on your storage and bandwidth prices. Updating a registry key costs the renter 5 years of storage + bandwidth. Reading a registry entry costs the renter the equivalent of 10 years of storage + bandwidth.

The recommended registry size is 4GB, it is stored with your consensus data.

$ siac host config registrysize 4GB

Forward ports

If you have a firewall or router you will need to forward/open TCP ports 9981-9983. How to do so is outside of the scope of this guide, there are tutorials available for most routers/firewalls available on Google.

Announcing

Now that you have setup your host, all that is left is to announce. Most hosts like to setup a custom DNS for their hosts such as host.siacentral.host:9982. If you have a dynamic IP, it is recommended to use a dynamic DNS service to update your IP automatically when it changes. Substitute your domain or IP in the following command:

$ siac host announce your.ip.or.netaddress:9982

Using siac

siac is the utility used to interact with a running Sia node you can list commands available or get usage information by adding --help to the end of any command:

$ siac wallet --help
$ siac host --help
$ siac host folder --help

Updating Your Host

It is important to keep your host up to date. To update:

  1. Download and unzip the latest release from https://sia.tech/get-started

  2. Stop the siad service with sudo systemctl stop siad

  3. Replace the siad and siac binaries at /usr/local/bin

  4. Start the siad service sudo systemctl start siad

A new 29 word wallet seed will be generated. Save this seed somewhere secure, if something happens to your server you will need it to recover your Siacoin.

Announcements can take between 20 minutes to an hour to be confirmed. Once your announcement is confirmed you can check your host using or .

Secure Seed Management
Sia Central's Host Troubleshooter
SiaStat's Host Monitor
hosting article
official website