Self-host Rasputin
Learn how to configure and deploy Rasputin with Docker.
Before you start
- A Linux x86-64 server with Docker Compose v2, Git, curl, and OpenSSL.
- Three DNS names pointing to your server for the dashboard, API, and uploaded assets.
- A GitHub account or organization where you can register a GitHub App, plus API keys for Vercel AI Gateway and TypeSafe AI. Vercel AI Gateway keys · TypeSafe AI quickstart
Your responsibilities when self-hosting
Rasputin provides the Docker Compose configuration and database migrations. When you self-host, you are responsible for:
- Server provisioning and maintenance
- DNS, HTTPS, and reverse-proxy configuration
- Secrets, GitHub App credentials, and AI provider keys
- Keeping the OS, Docker, and Rasputin up to date
- PostgreSQL, Redis, and object storage
- Backups and disaster recovery
- Monitoring and uptime
1. Download and configure Rasputin
# Get the code
git clone --branch self-hosted/v0.1.1 https://github.com/Rasputin-AI/rasputin rasputin
cd rasputin
# Create a private configuration file
cp .env.self-hosted.example .env.self-hosted
chmod 600 .env.self-hostedIn .env.self-hosted, replace each value starting with replace-with-.
Use openssl rand -hex 32 to generate a different secret for each.
Set AI_GATEWAY_API_KEY and TYPESAFE_AI_API_KEY for error grouping and
triage. Both are required at startup.
Replace the example hostnames throughout the guide with your own. Use a subdomain of the
dashboard hostname for the API, such as api.app.example.com under app.example.com, so sign-in cookies work across both.
WEB_ORIGIN=https://app.example.com
API_ORIGIN=https://api.app.example.com
AWS_PUBLIC_ENDPOINT_URL_S3=https://assets.app.example.comKeep .env.self-hosted private. For team invitations and verification emails, you can
also set RESEND_API_KEY and RESEND_FROM.
2. Set up HTTPS
Serve all three hostnames over HTTPS with a reverse proxy such as Caddy or Nginx on the server. Forward each hostname to its local Compose port.
- Dashboard
app.example.com→127.0.0.1:5173 - API
api.app.example.com→127.0.0.1:3000 - Assets
assets.app.example.com→127.0.0.1:9000
Keep the Compose ports on loopback and let the proxy handle public traffic.
With DNS configured and ports 80 and 443 open, Caddy can obtain and renew certificates for these hostnames. Caddy HTTPS setup
app.example.com {
reverse_proxy 127.0.0.1:5173
}
api.app.example.com {
reverse_proxy 127.0.0.1:3000
}
assets.app.example.com {
reverse_proxy 127.0.0.1:9000
}Use a TLS certificate that covers all three hostnames and set the certificate and key paths.
Run nginx -t before reloading. Nginx reverse proxy reference
# Add this file to the http context.
map $host $rasputin_port {
default 5173;
api.app.example.com 3000;
assets.app.example.com 9000;
}
server {
listen 80;
server_name app.example.com api.app.example.com assets.app.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name app.example.com api.app.example.com assets.app.example.com;
# Use a certificate that covers all three names.
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
client_max_body_size 128m;
location / {
proxy_pass http://127.0.0.1:$rasputin_port;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}
}3. Create your GitHub App
Register a GitHub App under the account or organization that owns your repositories. Register a GitHub App
| GitHub setting | Value |
|---|---|
| Homepage URL | https://app.example.com |
| Setup URL | https://api.app.example.com/github/callback |
| Request user authorization during installation | Off. Leave the Callback URL blank. |
| Webhook URL | Enable webhooks and use https://api.app.example.com/github/webhook. |
| Webhook secret | The same value as GITHUB_WEBHOOK_SECRET |
| Repository permissions | Contents → Read-only for source access |
Generate a private key in GitHub and fill in the GITHUB_* credentials in .env.self-hosted. Use the quoted \n format shown in the example file
for the private key.
4. Start Rasputin and create your account
Run these commands in Bash from the Rasputin checkout. Define compose again
in any new shell.
# Use the self-hosted Compose file and its settings
compose() {
docker compose --env-file .env.self-hosted -f docker-compose.self-hosted.yml "$@"
}
# Build Rasputin, run migrations, and start the services
compose up -d --build --waitcompose ps -a shows which containers are running and which setup jobs have
finished. Look for migrate to show Exited (0) and web, api, and worker to be running.
The two curl commands check that the dashboard and API respond through
your HTTPS proxy. Both should print HTTP 200 before you create your account.
# List running containers and completed setup jobs
compose ps -a
# Check that both hosts respond through your HTTPS proxy
curl -fsS -o /dev/null -w 'Dashboard HTTP %{http_code}\n' https://app.example.com/status
curl -fsS -o /dev/null -w 'API HTTP %{http_code}\n' https://api.app.example.com/statusReplace you@example.com with your email. Enter your password at the hidden Owner password prompt and save it in your password manager. The command
creates the first account only.
# Replace the email address with yours
export RASPUTIN_OWNER_EMAIL=you@example.com
# Enter a password at the prompt. Your typing is hidden.
(
read -rsp "Owner password: " RASPUTIN_OWNER_PASSWORD || exit 1
printf '\n'
export RASPUTIN_OWNER_PASSWORD
compose run --rm -e RASPUTIN_OWNER_EMAIL -e RASPUTIN_OWNER_PASSWORD owner
)Open your dashboard at https://app.example.com, sign in, and use Connect GitHub to install your App on
the repositories you want to use.
5. Send your first telemetry
Create a Rasputin project and install the SDK for your framework. SDK setup
The recommended SDK version for this self-hosted release is 1.0.2.
The DSN points the SDK at your server. Use apiUrl for an explicit override.
For build-time manifest uploads, set RASPUTIN_API_URL=https://api.app.example.com.
Copy RASPUTIN_DSN and RASPUTIN_PROJECT_API_KEY from the project
settings. Use the deployed app's commit SHA for RASPUTIN_RELEASE.
import { RasputinInit } from '@rasputin-ai/node';
const rasputin = RasputinInit({
dsn: process.env.RASPUTIN_DSN!,
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
release: process.env.RASPUTIN_RELEASE!,
environment: 'production',
});Deploy your app, call an instrumented route, and check Executions and Functions in the matching project and environment.
To connect an MCP client, use https://api.app.example.com/mcp. Connect an MCP client
Upgrade
Before upgrading, back up PostgreSQL, object storage, and .env.self-hosted.
Read the target release notes, then run the upgrade with the same Compose project, volumes, and public URLs.
# Replace this with the self-hosted release tag you want to install
target_tag=self-hosted/vX.Y.Z
(
set -e
git fetch --tags origin
git switch --detach "$target_tag"
# Run the new migration service before restarting the app
compose stop web api worker
compose up -d --build --force-recreate migrate
compose wait migrate
compose up -d --build --wait
)After the migration succeeds, check that existing data loads and new telemetry arrives.
Contact
If you have questions, email support@rasputinai.dev.
