Skip to main content
Sign In
Platforms

Deploying to Rivet Compute

Run your backend on Rivet Compute.

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

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

  1. Open the Rivet dashboard and navigate to your project
  2. Click Connect and select Rivet Cloud
  3. Copy the RIVET_CLOUD_TOKEN value 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 production namespace on pushes to main
  • 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:

StatusDescription
ProvisioningAllocating compute resources
InitializingStarting the runtime environment
AllocatingAssigning the runner to your pool
DeployingPulling and launching your container
BindingConnecting the runner to the network
ReadyDeployment complete

Once the status reaches Ready, your backend is live and actors are available for connections.

Troubleshooting