Skip to Content
Getting StartedInstallation

Installation

There are several ways to run Rustrak depending on your needs. Pick the one that fits your setup.

Quick install (Docker Compose)

The fastest way to get everything running locally.

1. Create the docker-compose.yml

Create a docker-compose.yml file with the following content:

services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped server: image: abians7/rustrak-server:latest ports: - "${SERVER_PORT}:8080" environment: - HOST=0.0.0.0 - PORT=8080 - RUST_LOG=${RUST_LOG} - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} - SESSION_SECRET_KEY=${SESSION_SECRET_KEY} - CREATE_SUPERUSER=${CREATE_SUPERUSER} depends_on: postgres: condition: service_healthy restart: unless-stopped ui: image: abians7/rustrak-ui:latest ports: - "${UI_PORT}:3000" environment: - RUSTRAK_API_URL=${RUSTRAK_API_URL} depends_on: - server restart: unless-stopped volumes: postgres_data:

What each service does:

ServiceDescription
postgresPostgreSQL 16 database with persistent storage. Includes a healthcheck to ensure it’s ready before the server starts.
serverThe Rustrak API server (Rust/Actix-web). Handles event ingestion and API requests. Uses ~50MB RAM.
uiThe Rustrak dashboard (Next.js).

2. Configure environment variables

Create a .env file with all required configuration:

# =================== # Database (PostgreSQL) # =================== POSTGRES_USER=rustrak POSTGRES_PASSWORD=rustrak POSTGRES_DB=rustrak # =================== # Server # =================== SERVER_PORT=8080 RUST_LOG=info # Session secret (required) - generate with: openssl rand -hex 32 SESSION_SECRET_KEY=your-64-char-hex-secret-here # Admin user (required) - format: email:password CREATE_SUPERUSER=admin@example.com:changeme123 # =================== # Dashboard # =================== UI_PORT=3000 RUSTRAK_API_URL=http://server:8080

To generate a secure session secret:

openssl rand -hex 32

3. Start Rustrak

docker compose up -d

This starts:

  • PostgreSQL on port 5432
  • Rustrak Server on port 8080
  • Rustrak Dashboard on port 3000

Open http://localhost:3000  and log in with the credentials you set in CREATE_SUPERUSER.

For production, you often want minimal resource usage on your server. Run only the Rustrak server and access the dashboard from your laptop or deploy it separately on Vercel.

On your server

# Pull and run just the server docker run -d \ --name rustrak \ -p 8080:8080 \ -e DATABASE_URL="postgres://user:pass@db-host:5432/rustrak" \ -e SESSION_SECRET_KEY="$(openssl rand -hex 32)" \ -e CREATE_SUPERUSER="admin@example.com:changeme123" \ abians7/rustrak-server:latest

The server uses ~50MB RAM and handles all error ingestion and API requests.

Access the dashboard

Option A: Self-host the dashboard

docker run -d \ --name rustrak-ui \ -p 3000:3000 \ -e RUSTRAK_API_URL="https://your-server.com" \ abians7/rustrak-ui:latest

Option B: Deploy to Vercel (free)

Deploy with Vercel

Set RUSTRAK_API_URL to your server URL in Vercel’s environment variables.

User management

First admin user

The admin user is created automatically on first startup using the CREATE_SUPERUSER environment variable:

# In your .env file CREATE_SUPERUSER=admin@example.com:yourpassword

The format is email:password. This only creates the user if no users exist in the database yet.

Verify the installation

  1. Open the dashboard (localhost:3000 or your Vercel URL)
  2. Log in with your admin credentials
  3. You should see an empty project list

You’re ready to capture your first error.

Resource comparison

SetupServer RAMServer CPUNotes
Full stack~200MBLowEasiest setup
Server only~50MBMinimalDashboard runs elsewhere
Server only + Vercel~50MBMinimalZero dashboard overhead

For a 512MB VPS, the server-only option leaves plenty of room for your application and database.

Last updated on