Deploying to Rivet Compute
Run your backend on Rivet Compute.
Rivet Cloud is currently in beta.
Using an AI coding agent? Open Connect on the Rivet dashboard, select Rivet Cloud, and paste the one-shot prompt into your agent and have it connect with Rivet Compute for you.
Steps
Prerequisites
- Your RivetKit app in a GitHub repository
- If you don’t have one, see the Quickstart page or our Examples
- A Rivet Cloud account and project
Configure Runner Mode
Rivet Compute runs your app as a long-lived container. Make sure your server calls startRunner() instead of serve():
import { registry } from "./actors.js";
registry.startRunner();
See Runtime Modes for details on when to use each mode.
Containerize Your App
Create a Dockerfile in your project root:
FROM node:24-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "src/server.js"]
Get Your Cloud Token
- Open the Rivet dashboard and navigate to your project
- Click Connect and select Rivet Cloud
- Copy the
RIVET_CLOUD_TOKENvalue shown — this is all you need for deployment
Set Up GitHub Actions
Add RIVET_CLOUD_TOKEN as a secret in your GitHub repository (Settings → Secrets and variables → Actions), then create .github/workflows/deploy.yml:
name: Rivet Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: rivet-deploy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rivet-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: rivet-dev/deploy-action@v1
with:
rivet-token: ${{ secrets.RIVET_CLOUD_TOKEN }}
The deploy-action handles everything automatically:
- Builds your Docker image and pushes it to Rivet’s built-in container registry
- Creates a
productionnamespace on pushes tomain - Creates an isolated
pr-{number}namespace for each pull request - Posts a comment on the PR with a link to the Rivet dashboard
- Cleans up the PR namespace when the pull request is closed
Monitor Deployment
The dashboard shows live status as Rivet Compute provisions your backend:
| Status | Description |
|---|---|
| Provisioning | Allocating compute resources |
| Initializing | Starting the runtime environment |
| Allocating | Assigning the runner to your pool |
| Deploying | Pulling and launching your container |
| Binding | Connecting the runner to the network |
| Ready | Deployment complete |
Once the status reaches Ready, your backend is live and actors are available for connections.