Tag Archives: siad process

How to run Siad as a background service in Ubuntu server

Configure a service that allow siad to run on boot (and restart in case of crashed):

    • Assume that you already install Sia Core and ./siad is operational (i.e. you can run command ./siad to start Sia application)
    • Stop siad process.
    • Create a file named: siad.service at a folder you need. In the below example, you create file siad.service in folder /home/your-user-name/config/services
      • $ mkdir config && cd config && mkdir services && cd services
      • $ sudo nano siad.service
      • Add these lines to siad.service file:

        Description=Sia Daemon
         
        [Service]
        ExecStart=/home/your-user-name/path-to-sia-storing-folder/siad
        WorkingDirectory=/home/your-user-name/path-to-sia-storing-folder/
        Restart=always
         
        [Install]
        WantedBy=multi-user.target
        Alias=siad.service
    • Save file and exit to root user.
    • Configure firewall (if ufw is in use):
      • $ ufw allow 9982
    • Start siad as a service:
      • $ systemctl daemon-reload
      • $ systemctl enable ~/.config/systemd/siad.service
      • $ systemctl start siad.service
  • Sia should now be running as a service which can be confirmed/verifyed with:
Advertisements