VM & Bare Metal
Run Rivet workers on a Linux VM or bare metal host.
Workers run in runner mode here: the process opens a connection out to the control plane on startup. The host needs no public URL, only outbound network access.
Requirements
- A Linux host with SSH access and Node.js installed. Hetzner, DigitalOcean, Linode, EC2, and bare metal all work the same way.
- A control plane, either Rivet Cloud or your own
Steps
Upload your build
Build locally, then copy the output somewhere readable by the service user:
scp -r ./dist user@server:/opt/rivet-worker
Create the systemd unit
TimeoutStopSec is the important line. Actors drain for up to 30 minutes, and systemd’s default of 90 seconds cuts them off.
[Unit]
Description=Rivet Worker
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/rivet-worker
ExecStart=/usr/bin/node server.js
Restart=on-failure
TimeoutStopSec=2100
Environment=RIVET_ENDPOINT=<your-rivet-endpoint>
Environment=RIVET_PUBLIC_ENDPOINT=<your-rivet-public-endpoint>
[Install]
WantedBy=multi-user.target
Both endpoint values are described in Workers. For secrets, prefer EnvironmentFile= pointing at a root-owned file over inline Environment= lines.
Start the service
sudo systemctl daemon-reload
sudo systemctl enable --now rivet-worker.service
Verify
systemctl is-active rivet-worker.service
Expect active. The worker then appears under Runners in the dashboard.
Scaling
There is no autoscaler on a bare host. Runner-mode workers are interchangeable, so capacity is added by running the same unit on more hosts, each with its own RIVET_ENDPOINT. They all join the same pool and appear under Runners. To autoscale instead, move the worker to a platform that has one, such as Kubernetes or ECS.
Running two units on one host works but shares the host’s CPU and memory, so it adds concurrency rather than capacity.
Operating
Restart after deploying a new build or changing environment variables:
sudo systemctl restart rivet-worker.service
Follow logs while debugging:
sudo journalctl -u rivet-worker.service -f