Skip to main content
Deploying

Rivet Compute

Deploy your backend as a container and let Rivet run it.

Rivet Compute runs your backend for you. You supply a container image; Rivet builds it, pushes it to its own registry, provisions a managed pool, and gives you a URL.

Using an AI coding agent? Open Connect on the Rivet dashboard, select Rivet Cloud, and paste the one-shot prompt into your agent to have it connect for you.

Requirements

  • A Rivet Cloud account and project
  • Docker running locally
  • Your app. If you do not have one yet, start from the Quickstart.

Steps

Add a Dockerfile

At your project root:

FROM node:24-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "src/server.js"]

Your server must listen on the port in RIVET_PORT, which defaults to 3000.

Get your cloud token

  1. Open the dashboard and go to your project.
  2. Click Connect, then Rivet Cloud.
  3. Copy RIVET_CLOUD_TOKEN.

This is a cloud_api_* management token, not a pk_* publishable key. See Tokens.

Deploy

npx @rivetkit/cli deploy --token cloud_api_xxxxx

The token is written to ~/.rivet/credentials, so later deploys can omit the flag. The CLI resolves your project from the token, builds and pushes the image, upserts the managed pool, and prints the deployment URL once the pool is ready.

Watch the rollout

The dashboard shows live status:

StatusMeaning
InitializingStarting the runtime environment
DeployingPulling and launching your container
BindingConnecting the runner to the network
ReadyLive, and accepting actor connections

Add CI

Once local deploys work, install the GitHub Actions workflow:

npx @rivetkit/cli setup-ci

This writes .github/workflows/rivet-deploy.yml. Add the token as a repository secret:

gh secret set RIVET_CLOUD_TOKEN

The workflow deploys production on push to your default branch and creates an isolated namespace per pull request. See Preview Deployments.

Logs

rivet logs prints the last 100 lines from the default pool in the production namespace, oldest first, then exits.

npx @rivetkit/cli logs

Token resolution matches deploy: the --token flag, then RIVET_CLOUD_TOKEN, then ~/.rivet/credentials.

Add --follow (-f) to stream instead of fetching history:

npx @rivetkit/cli logs --follow

Each line is <timestamp> [<SEVERITY>] <region> <message>:

2026-06-16T18:26:51.160Z [INFO] eu-central-1 server listening on port 3000
2026-06-17T11:24:20.425Z [ERROR] us-east-1 failed to connect to upstream

More examples:

# Last 200 lines from a specific namespace
npx @rivetkit/cli logs --namespace production -n 200

# A specific compute pool
npx @rivetkit/cli logs --pool my-pool

# Live tail, filtered
npx @rivetkit/cli logs --follow --contains error

# JSON, piped to jq
npx @rivetkit/cli logs -n 50 --json | jq .

Troubleshooting

Pricing

You are billed for the compute your deployment uses while it is running.

DimensionRateBills
Memory$0.00000290 per GiB-secondMemory allocated to running instances.
vCPU$0.0000330 per vCPU-secondCompute allocated to running instances.

Usage is metered per minute and billed monthly. You are only charged while instances are running.