Linux binary and systemd
Install and manage the Supermetry binary as a Linux systemd service.
Run a Supermetry release as a dedicated Linux system service.
What the installer creates
Section titled “What the installer creates”The installer creates the supermetry system user, installs the binary at /usr/local/bin/supermetry, writes /etc/supermetry/supermetry.env, and creates /etc/systemd/system/supermetry.service. It then reloads systemd, enables and starts the service, and checks /readyz.
Install manually
Section titled “Install manually”-
Extract a Linux release archive, then install the user, directories, binary and bundled unit:
Terminal window getent group supermetry >/dev/null || sudo groupadd --system supermetrygetent passwd supermetry >/dev/null || sudo useradd --system --gid supermetry --home-dir /var/lib/supermetry --shell /usr/sbin/nologin supermetrysudo install -d -m 0750 -o root -g supermetry /etc/supermetrysudo install -d -m 0700 -o supermetry -g supermetry /var/lib/supermetrysudo install -m 0755 supermetry /usr/local/bin/supermetrysudo install -m 0644 supermetry.service /etc/systemd/system/supermetry.service -
Enter the PostgreSQL URL and public URL, then create the service environment:
Terminal window printf 'PostgreSQL URL: 'IFS= read -r database_urlprintf 'Public URL: 'IFS= read -r base_urlsecret_key="$(openssl rand -base64 32)"env_file="$(mktemp)"printf '%s\n' \"SUPERMETRY_DATABASE_URL=${database_url}" \"SUPERMETRY_BASE_URL=${base_url}" \'SUPERMETRY_LISTEN=127.0.0.1:8787' \"SUPERMETRY_SECRET_KEY=${secret_key}" > "$env_file"sudo install -m 0640 -o root -g supermetry "$env_file" /etc/supermetry/supermetry.envrm "$env_file" -
Start the service now and on boot:
Terminal window sudo systemctl daemon-reloadsudo systemctl enable --now supermetry
Manage the service
Section titled “Manage the service”sudo systemctl start supermetrysudo systemctl stop supermetrysudo systemctl restart supermetrysudo systemctl enable supermetrysudo systemctl disable supermetrysudo systemctl status supermetrysudo journalctl -u supermetry -fThe unit starts the server with /usr/local/bin/supermetry and no subcommand.
What you should see: sudo systemctl status supermetry reports an active service.