Skip to content

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.

  • Node.js 24.11.1+ or Bun
  • Docker, which runs Rivet on your machine and builds node images for the clouds
Terminal window
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 effect

Then add Rivet.providers() next to your cloud’s providers:

alchemy.run.ts
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 };
}),
);

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.

The Docker control plane runs on a Docker swarm. Turn swarm mode on once:

Terminal window
docker swarm init

docker info --format '{{.Swarm.LocalNodeState}}' prints active when it’s on.

To let Rivet run the control plane, create a cluster in the Rivet dashboard and sign in to it:

Terminal window
alchemy profile edit --add RivetCloud

See Rivet Cloud.

Next, build chat rooms in the tutorial.