Deploying to Rivet Compute
Run your backend on Rivet Compute.
Rivet Compute 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
- If you don’t have one, see the Quickstart page or our Examples
- A Rivet Cloud account and project
- Docker running locally
Create a Dockerfile
Add a Dockerfile to your project root that builds and runs your RivetKit server:
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
Deploy
Run the deploy command from your project root. The token is saved to ~/.rivet/credentials, so later deploys can omit it.
npx @rivetkit/cli deploy --token cloud_api_xxxxx
The CLI resolves your project from the token, builds and pushes your Docker image to Rivet’s built-in registry, upserts the managed pool, and prints the deployment URL on stdout when the pool is ready.
Optionally Add CI
After local deploys work, install the GitHub Actions workflow that deploys on every push and pull request:
npx @rivetkit/cli setup-ci
This writes .github/workflows/rivet-deploy.yml. Add your token as a repository secret to enable it:
gh secret set RIVET_CLOUD_TOKEN
The workflow creates production and pull-request namespaces, posts preview links, and cleans up PR namespaces when pull requests close. See the CLI reference for all commands.
Monitor Deployment
The dashboard shows live status as Rivet Compute provisions your backend:
| Status | Description |
|---|---|
| Initializing | Starting the runtime environment |
| 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.
Checking Logs
Use the CLI to read your deployment’s logs. By default rivet logs prints the last 100 lines from the production namespace, oldest to newest, then exits.
npx @rivetkit/cli logs
The CLI resolves your token the same way deploy does (the --token flag, then the RIVET_CLOUD_TOKEN environment variable, then ~/.rivet/credentials).
Follow logs live
Pass --follow (-f) to stream new logs as they arrive instead of fetching history:
npx @rivetkit/cli logs --follow
Each formatted line is printed as <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
A few examples:
# Last 200 lines from a specific namespace
npx @rivetkit/cli logs --namespace production -n 200
# Live tail, only lines containing "error"
npx @rivetkit/cli logs --follow --contains error
# JSON output piped to jq
npx @rivetkit/cli logs -n 50 --json | jq .
Troubleshooting
Pricing
You are billed for the compute resources your deployment uses while it is running.
| Dimension | Rate | Bills |
|---|---|---|
| Memory | $0.00000290 per GiB-second | Memory allocated to running instances. |
| vCPU | $0.0000330 per vCPU-second | Compute allocated to running instances. |
Usage is metered per minute and billed monthly. You are only charged while instances are running.