website/src/content/docs/connect/_rivet-compute.mdx
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.
</Step> <Step title="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"]
RIVET_CLOUD_TOKEN value shown — this is all you need for deploymentAdd 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:
production namespace on pushes to mainpr-{number} namespace for each pull requestThe 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.
</Step> </Steps>If the status stays in Provisioning for more than a few minutes, verify that:
RIVET_CLOUD_TOKEN secret is correctly set in your GitHub repositoryIf the status shows Error, check that your container starts successfully and does not exit immediately. Common causes:
registry.startRunner()docker run