Setup
Running Rivet yourself needs no Rivet account. You run the control plane and its nodes on a cloud you already use, so setting up means installing the provider and getting that cloud ready.
Prerequisites
Section titled “Prerequisites”- Node.js 24.11.1+ or Bun
- Docker, which runs Rivet on your machine and builds node images for the clouds
Install
Section titled “Install”pnpm add https://pkg.alchemy.run/alchemy/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/rivet/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/docker/pr:2930:51c662a effectbun add https://pkg.alchemy.run/alchemy/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/rivet/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/docker/pr:2930:51c662a effectnpm install https://pkg.alchemy.run/alchemy/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/rivet/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/docker/pr:2930:51c662a effectyarn add https://pkg.alchemy.run/alchemy/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/rivet/pr:2930:51c662a https://pkg.alchemy.run/@alchemy.run/docker/pr:2930:51c662a effectThen add Rivet.providers() next to your cloud’s providers:
import * as Alchemy from "alchemy";import * as Docker from "@alchemy.run/docker";import * as Rivet from "@alchemy.run/rivet";import * as Effect from "effect/Effect";import * as Layer from "effect/Layer";import Api from "./src/api.ts";
export default Alchemy.Stack( "RivetRooms", { providers: Layer.mergeAll(Docker.providers(), Rivet.providers()), state: Alchemy.localState(), }, Effect.gen(function* () { const api = yield* Api; return { service: api.name }; }),);Add the package for your cloud
Section titled “Add the package for your cloud”Each cloud has its own entry point, and needs that cloud’s provider package:
| Import | Install |
|---|---|
@alchemy.run/rivet/Docker |
@alchemy.run/docker |
@alchemy.run/rivet/AWS |
@alchemy.run/aws |
@alchemy.run/rivet/GCP |
@alchemy.run/gcp |
@alchemy.run/rivet/Kubernetes |
@alchemy.run/kubernetes |
@alchemy.run/rivet/Fly |
@alchemy.run/fly |
@alchemy.run/rivet/Hetzner |
@alchemy.run/hetzner |
@alchemy.run/rivet/Railway |
@alchemy.run/railway |
Then follow that cloud’s setup to sign in, for example AWS setup or Hetzner setup. The control plane and its nodes deploy to the account that profile signs in to.
Run Rivet on your machine
Section titled “Run Rivet on your machine”The Docker control plane runs on a Docker swarm. Turn swarm mode on once:
docker swarm initdocker info --format '{{.Swarm.LocalNodeState}}' prints active when it’s on.
Use Rivet Cloud
Section titled “Use Rivet Cloud”To let Rivet run the control plane, create a cluster in the Rivet dashboard and sign in to it:
alchemy profile edit --add RivetCloudSee Rivet Cloud.
Next, build chat rooms in the tutorial.