Linux packages
Install Stater as a hardened systemd service from signed .deb and .rpm packages on Debian, Ubuntu, RHEL, Rocky Linux or AlmaLinux.
See it in the tour: Install on your own server
On this page
The packages install Stater as a hardened systemd service. They work on Debian 12 or later, Ubuntu 22.04 or later, and RHEL, Rocky Linux or AlmaLinux 9 or later, on amd64 (x86_64) and arm64 (aarch64). The server is one static binary with the web app built in, so the packages need nothing else; backups need the PostgreSQL 17 client tools.
1. Check the release files#
Note. Stater is in early access. The release files and images are not public; request early access to get them.
You need the package for your machine, SHA256SUMS and SHA256SUMS.sigstore.json. Check that the release really came from the Stater release workflow, then that your file matches:
cosign verify-blob SHA256SUMS --bundle SHA256SUMS.sigstore.json \
--certificate-identity-regexp '^https://github.com/Kazarrackt/retail-ops-platform/.github/workflows/release.yml@refs/tags/v' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
sha256sum --ignore-missing -c SHA256SUMS
2. Install#
sudo apt install ./stater_0.1.0-1_amd64.deb # Debian, Ubuntu
sudo dnf install ./stater-0.1.0-1.x86_64.rpm # RHEL, Rocky, Alma
The package makes a stater system user, the folders below and the stater service. It does not start the service: there is nothing to start until it is configured.
3. PostgreSQL 17#
Stater needs PostgreSQL 16 or later; 17 recommended, and 17 is what it is tested with. Use a managed database, a server of your own, or PostgreSQL on this machine from the PostgreSQL project's own packages (PGDG), because Debian 12 and Ubuntu 22.04 ship older versions:
- Debian and Ubuntu: follow https://www.postgresql.org/download/linux/debian/ or
/ubuntu/, thensudo apt install postgresql-17 postgresql-client-17. - RHEL family: follow https://www.postgresql.org/download/linux/redhat/, then
sudo dnf install postgresql17-server postgresql17andsudo postgresql-17-setup initdb && sudo systemctl enable --now postgresql-17.
Backups need pg_dump and pg_restore at least as new as the database server. A PostgreSQL 17 database needs the version 17 client tools on this machine even when the database is elsewhere (postgresql-client-17 on Debian and Ubuntu, postgresql17 on the RHEL family). Where they are not first on the PATH, set STATER_PG_DUMP and STATER_PG_RESTORE, for example /usr/pgsql-17/bin/pg_dump. stater db doctor (Database and backups) says when they are missing or too old.
4. Configure#
sudo stater configure
It asks, in order:
- Database: an existing PostgreSQL URL, or a new database on this machine's PostgreSQL. A new one is made through the local
postgresaccount (stater db init), with astaterdatabase user that signs in through the local socket without a password, so there is no database password to look after. - Public address: what people will type, such as
https://shop.example.com. - Listen address:
127.0.0.1:8080by default, behind a reverse proxy (below). - Licence file: leave it empty to run as Starter (Plans and licences).
- Email: enter the SMTP server now, let an owner set it up in Admin › Email, or later (Email).
- Nightly backups to
/var/lib/stater/backups. - Start Stater now?
It also makes the secret key that encrypts saved integration passwords, in /etc/stater/secrets/secret_key. Keep a copy of that file somewhere safe and apart from your backups (Secrets). Without it, a restored database cannot read its saved email, directory and S3 passwords, and they must be entered again.
Running it again is safe: what is already set becomes the default, an unchanged file is not rewritten, and the secret key is never replaced. It prints which settings changed, never their values. After a change, restart: sudo systemctl restart stater.
For automation every answer has a flag. No flag takes a password: passwords and URLs that hold one come from files (or - for standard input), so they never show in the process list or the shell history.
sudo stater configure -non-interactive -create-database -public-url https://pos.example.com -email admin -backups daily -start
sudo stater configure -non-interactive -database-url-file /root/db-url -public-url https://pos.example.com \
-email now -smtp-host smtp.example.com -smtp-username [email protected] -smtp-password-file /root/smtp-pw \
-smtp-from [email protected] -licence /root/shop.lic -start
| Flags | What they set |
|---|---|
-database-url-file F, -database-url URL |
STATER_DATABASE_URL |
-create-database [-db-name stater] [-db-role stater] [-db-admin-url-file F] |
Makes the database and its user. Without -db-admin-url-file, through this machine's postgres account (needs sudo); the user must then be stater, the user the service runs as, since it signs in by peer authentication. With it, through that admin connection, with a generated password; running it again keeps the saved password. |
-public-url, -listen, -trusted-proxies |
STATER_PUBLIC_URL, STATER_LISTEN, STATER_TRUSTED_PROXIES |
-licence FILE |
Checks the licence, copies it to /etc/stater/licence.lic and sets STATER_LICENCE_FILE. |
-email now|admin|later with -smtp-host, -smtp-port (587), -smtp-username, -smtp-password-file F|-, -smtp-from, -smtp-from-name, -smtp-security starttls|tls|none |
The STATER_SMTP_* settings, or STATER_SMTP_SETUP=admin or later. |
-backups daily|off, -backup-dir, -backup-time HH:MM |
STATER_BACKUP_DIR and STATER_BACKUP_SCHEDULE. -backup-dir alone turns backups on. A folder outside /var/lib/stater is made for the stater user, and needs the ReadWritePaths drop-in below. |
-owner-username U -owner-password-file F|- |
Creates the first owner on start instead of the setup wizard. |
-start |
systemctl enable --now stater. |
-dry-run, -skip-db-check, -env-file, -secrets-dir |
Say what would change; skip the check that the database answers; write elsewhere. |
Only one of the -…-file flags can be - (standard input) at a time. In the interactive questions, the database URL is not shown as you type, since it may hold a password.
Finish setup before anyone else can reach Stater. Until an owner exists, whoever opens it first creates one. Open the public address yourself straight away, or use -owner-username and -owner-password-file.
5. A reverse proxy with TLS#
Stater listens on 127.0.0.1:8080 and has no TLS of its own. Put Caddy or nginx in front. The live stream (/api/v1/stream) is a long-lived server-sent events connection, so the proxy must not buffer it and must allow at least five minutes between reads.
Caddy (/etc/caddy/Caddyfile), which also gets the certificate:
pos.example.com {
reverse_proxy 127.0.0.1:8080 {
flush_interval -1
}
}
nginx:
server {
listen 443 ssl;
server_name pos.example.com;
# ssl_certificate and ssl_certificate_key as usual
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_buffering off;
proxy_read_timeout 300s;
}
}
STATER_TRUSTED_PROXIES trusts a proxy on this machine by default, so sign-in limits count each real client. A proxy on another machine must be named there, and nothing else: a till or phone on the shop network could otherwise pick the address its sign-in attempts are counted against.
/metrics answers only callers on this machine unless STATER_METRICS_TOKEN_FILE is set; do not route it through the proxy.
Files#
| Path | Owner and mode | What it is |
|---|---|---|
/usr/bin/stater |
root, 0755 | The server and its commands. |
/usr/lib/systemd/system/stater.service |
root, 0644 | The service. Change it with sudo systemctl edit stater, never by editing it. |
/etc/stater/stater.env |
root:stater, 0640 | Settings, written by stater configure. Your own lines and comments are kept. Passwords are in /etc/stater/secrets, except the database URL, which may hold its password: this file is readable only by root and the stater group. |
/etc/stater/secrets/ |
root:stater, 0750 | secret_key, smtp_password, owner_password, each 0640. The service can read them but not change them. |
/etc/stater/licence.lic |
root:stater, 0640 | The licence, when one was given. |
/var/lib/stater/ |
stater, 0750 | The service's own folder. |
/var/lib/stater/backups/ |
stater, 0750 | Backups. They hold customer data. |
/usr/share/stater/stater.env.example |
Every setting, explained. |
The service#
sudo systemctl status stater
sudo journalctl -u stater -f
sudo systemctl restart stater
It runs as the stater user with a read-only view of the system (ProtectSystem=strict), no access to home folders, a private /tmp, no capabilities, and only the system calls an ordinary service needs. systemd-analyze security stater shows the details. It writes only to /var/lib/stater.
To listen on a port below 1024, or back up to a folder elsewhere, add a drop-in with sudo systemctl edit stater:
[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
ReadWritePaths=/srv/stater-backups
Backups and restoring#
Backups run inside Stater, at 02:30 each night by default, into /var/lib/stater/backups; change the time and add off-site S3 storage in Admin › Backups. Copy them off this machine too, and keep the secret key apart from them: it is not in the backup. Database and backups explains it all.
The commands need the service's settings, so run them as the stater user with the settings file loaded:
sudo -u stater sh -c 'set -a; . /etc/stater/stater.env; exec stater backup run'
sudo -u stater sh -c 'set -a; . /etc/stater/stater.env; exec stater backup list'
To restore, stop the service first:
sudo systemctl stop stater
sudo -u stater sh -c 'set -a; . /etc/stater/stater.env; exec stater backup restore -force latest'
sudo systemctl start stater
Troubleshooting#
sudo systemctl status statersays condition failed:/etc/stater/stater.envis missing. Runsudo stater configure.- It stops at start with a sentence naming a setting: fix that line in
/etc/stater/stater.env(or runsudo stater configureagain) and restart. - Health of the database, the connection budget and backups:
sudo -u stater sh -c 'set -a; . /etc/stater/stater.env; exec stater db doctor'. stater configure -dry-runshows what it would change without writing anything.
Upgrading, going back and removing are in Upgrading.