Virola self-hosted server running as a daemon on Arch Linux
This instruction is valid for other Arch-based Linux distributions (Manjaro, Parabola, ArcoLinux, etc.)
During the installation of the self-hosted Virola server on Linux, you'll have the option to register the server as a systemd service (daemon). If configured, this allows systemd to automatically start the server at boot and restart it gracefully in case of failures.
Below are the instructions you'll need to manage the registered systemd service. Even if you chose not to enable it during installation, you can still create the systemd service configuration manually at any time.
Managing the Virola systemd Service
Start, Stop, and Restart the Virola Server
Use the following systemctl commands to control the Virola server:
sudo systemctl start virola-server- Starts the Virola serversudo systemctl stop virola-server- Stops the Virola serversudo systemctl restart virola-server- Restarts the Virola server
Changing the Host or Port
To update the host or port the Virola server listens on:
-
Open
/home/virola/start-virola-server.shin a text editor - Locate the
--listenparameter - Modify the value using the syntax:
--listen HOST:PORT - Save the file
- Run
sudo systemctl restart virola-serverto apply the changes
Important: After updating, make sure to also change the Server Host and Server Port settings in your Virola client.
Moving the Database to a New Location
To relocate the Virola server database:
-
Find the current database (default:
/home/virola/storage/virola_server_database_v9.db) -
Stop the server:
sudo systemctl stop virola-server - Move the database file to the new location
- Open
/home/virola/start-virola-server.shin a text editor - Locate the
--storage-dirparameter - Update the path using the syntax:
--storage-dir STORAGE-DIRECTORY-PATH - Save the file
-
Start the server:
sudo systemctl start virola-server
You may not have access to the /home/virola directory, but you can still view its
contents using the command sudo ls /home/virola, and access
files inside the directory. For example, the command
sudo nano /home/virola/start-virola-server.sh
opens the file start-virola-server.sh in nano text editor.
Note! If the
/home/virola/start-virola-server.sh file is missing, the Virola server
was likely registered as a systemd service manually. In that case, host, port and
storage directory settings are defined directly in the virola-server.service file,
typically located at /etc/systemd/system/virola-server.service.
Manual systemd Registration for Virola Server
-
Create user
virolawith the following command:sudo useradd -m virola
Make sure to keep-mparameter to create the user's home directory at/home/virola -
Navigate to
/etc/systemd/systemdirectory and create the filevirola-server.servicethere. You may usenanoeditor for this:sudo nano virola-server.service
-
Add the following to the file:
[Unit] Description=Virola Server Wants=network.target After=network.target [Service] WorkingDirectory=/home/virola User=virola ExecStart=/usr/bin/virola-server --listen HOST:PORT --storage-dir ./storage Restart=on-failure [Install] WantedBy=multi-user.target
whereHOSTis the IP you've chosen for the Virola serverPORTis the port you've chosen for the Virola server
- Save the file
-
Execute the following commands one by one
sudo systemctl daemon-reload sudo systemctl start virola-server sudo systemctl enable virola-server
After this, your Virola Server should be up and running, and you can try to connect to it with Virola Client app.
To check the status of virola-server systemd service, use the following command:
sudo systemctl status virola-server