Skip to main content
Platforms

Deploying to VMs & Bare Metal

Deploy your RivetKit app to any Linux VM or bare metal host.

Steps

Prerequisites

Upload Your App

  • Build your RivetKit app locally
  • Copy the build output to your server (example):
scp -r ./dist user@server:/opt/rivetkit-app

Place the files somewhere readable by the service user, such as /opt/rivetkit-app.

Set Environment Variables

After creating your project on the Rivet dashboard, select VM & Bare Metal as your provider. You’ll be provided RIVET_ENDPOINT and RIVET_PUBLIC_ENDPOINT environment variables to use in the next step.

Create the systemd Service

Create /etc/systemd/system/rivetkit-app.service:

[Unit]
Description=RivetKit App
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/rivetkit-app
ExecStart=/usr/bin/node server.js
Restart=on-failure
Environment=RIVET_ENDPOINT=<your-rivet-endpoint>
Environment=RIVET_PUBLIC_ENDPOINT=<your-rivet-public-endpoint>

[Install]
WantedBy=multi-user.target

Replace the environment values with those from the Rivet dashboard and adjust paths to match your deployment.

Start the Service

Reload systemd units and start the service:

sudo systemctl daemon-reload
sudo systemctl enable --now rivetkit-app.service

Connect to Rivet

There is nothing to register in the dashboard. As a Runner, your app opens a connection out to Rivet on startup, so the host does not need a public URL or a URL pasted into a connect form. It only needs outbound network access to your Rivet endpoint.

Once the service is running, open the Rivet dashboard and confirm your app appears under Runners. It reconnects automatically if the connection drops.

Operating

Restart

Restart the service after deploying new builds or environment changes:

sudo systemctl restart rivetkit-app.service

Logs

Follow realtime logs when debugging:

sudo journalctl -u rivetkit-app.service -f