How to install and run a node on Linux
A linux node can be installed and setup on a personal linux machine, in home server, or in a datacenter.
Here is the list of system requirements that should be fulfilled to be able to install Mysterium Node.
- CPU: 1 core
- RAM: 1GB
- DISK: 500MB free disk space
As an example, a raspberry PI 3 or a VPS with 1core CPU and 1GB RAM is enough to run a node.
- Raspbian 9/10
- Debian 9/10
- Ubuntu 18.04/20.04
Other debian based linux distributions should also be able to run node without any issues.
In order to complete this setup, you should have a non-root user with sudo privileges.
There are 2 ways to install a stable release of Mysterium node:
1. Native install
On Debian/Ubuntu systems you can use Aptitude and execute:
2. Script install
We also provide an installation script written in bash which can be downloaded and executed using this command:
In addition to downloading and installing our Node, this command will also install additional required dependencies like WireGuard if you don't have it already.
Once the installation is complete, check your service status.
Latest non stable release
Latest non stable releases include bug fixes and improvements that have not yet been pushed for the whole user base and are not guaranteed to work. You should run these releases at your own risk and should also consider backing up your .mysterium folder beforehand just in case.
To get them checkout our launchpad or github releases.
Once the service is installed and running to finish the node installation continue to the NodeUI, where you'll be able to set payout address, manage service settings and check node stats and connections. Instructions on how to find and use it can be found: here.
Also make sure to claim your node into Mystnodes.com using an API key displayed here. To receive your key, you'll have to create an account when following the NodeUI onboarding process or add it later in the node settings.
If you can't access NodeUI or service is not working as expected, follow the below instructions on how to check service health, diagnose issues or add extra configuration.
Check service health
Post installation service check:
If everything is working you should see similar output to this:
View Node logs
Run the following command to diagnose issues:
To view the real-time daemon logs:
Save logs to a file
If your node is unable to report an issue through the built-in Node UI or TequilAPI, you may need to save the logs to a file and send them to us via firstname.lastname@example.org.
Advanced configuration (optional)
Get current config
When your node is running you can print the config that it has currently loaded by executing:
This config can be altered in several ways, which we'll cover below.
Editing the config file
On initial start up node will create a config file which can be editted. The config is located in: /etc/mysterium-node/config-mainnet.toml
Any text editor can be used to edit this file. As it's a .toml file formatting and indentation is very important. For further reading follow the official toml guide.
Altering start up options
Editing start up options instead of the config.toml file has one crutial benefit: start up service options overwrite any default or config.toml edited config values and become a single source of truth which cannot be changed at runtime.
Node typically runs as a systemd service, you can find the .service file by inspecting the service, which you can do by running:
The output of this command will be something similar to:
The file location we can see in parentheses is our .service file location. If you now inspect that file using cat /lib/systemd/system/mysterium-node.service you will find a line similar to this:
This is the line that gets executed when we start up the Node service. Here we're mainly interested in variables that are passed to this command (variables are the strings which start with $ sign for example $CONF_DIR). These variables are defined in a file which is located at: /etc/default/mysterium-node
To edit the node configuration and launch options we want to edit the variable $SERVICE_OPTS adding additional flags to it, which will get passed to our node once it's started. For example if we wanted to change the wireguard default ports we would replace it with this:
Note that $SERVICE_OPTS variable should always finish with wireguard so any configuration you want to add, must go before that.
To get the full list of configuration options execute: myst --help
Loading the new config
In most cases a simple service reload should be enough. You can do that by running:
After running the restart command make sure to check the service health and currently running config using previously mentioned commands.
If node is refusing to restart and load the changes you've made, you can try to restart systemd daemon itself by running systemctl daemon-reexec
Install development (snapshot) version of the node
Add node-dev repository:
You'll see similar output to the following:
Look for the version that has snapshot in its name such as: 0.42.1+1snapshot+20210209T0736+c7e732d6+build253474985+focal
Copy that name and run:
Your node should be running the snapshot version.
To return to a stable version, run: