Virola self-hosted server running as a daemon on Linux

  1. Create user virola
  2. Create file virola-server.service in /etc/systemd/system directory
  3. Add the following to the file:

    [Unit]
    Description=Virola chat server

    [Service]
    WorkingDirectory=/home/virola
    User=virola
    ExecStart=/usr/bin/virola-server --listen HOST:PORT --storage-dir ./
    StandardOutput=append:/home/virola/virola-server.log
    StandardError=append:/home/virola/virola-server.log
    Restart=on-failure
    ExecStartPost=/bin/sh -c 'umask 022; pgrep -f virola-server > /home/virola/virola-server.pid'

    [Install]
    WantedBy=multi-user.target

    where
    • HOST is the IP you've chosen for the Virola server
    • PORT is the port you've chosen for the Virola server
  4. Execute the following commands
    sudo systemctl daemon-reload
    sudo systemctl start virola-server
    sudo systemctl enable virola-server