GuidesGetting started

Installation

Install Rustrak with Docker or Docker Compose: one container on port 8080 with the API, ingestion and dashboard, on SQLite or PostgreSQL.

Rustrak is one container. It takes events, answers the API and serves the dashboard, all on port 8080.

Docker

The default image keeps everything in SQLite, so no database runs next to it:

docker run -d \
  --name rustrak \
  -p 8080:8080 \
  -v rustrak_data:/data \
  -e SESSION_SECRET_KEY=$(openssl rand -hex 32) \
  -e CREATE_SUPERUSER=admin@example.com:changeme123 \
  -e PUBLIC_URL=http://localhost:8080 \
  rustrak/rustrak-server:latest
Shell

Open http://localhost:8080 and sign in with the email and password from CREATE_SUPERUSER.

  • rustrak_data holds the database and uploaded source maps. Keep the volume and the data survives restarts and upgrades.
  • SESSION_SECRET_KEY signs the session cookie. Keep the same value across restarts, or everyone is signed out.
  • CREATE_SUPERUSER is email:password. It creates the first account only while the database has no users; after that it is ignored, so changing it does not change a password.
  • PUBLIC_URL is the address your SDKs and your browser reach. It becomes the host in every DSN. Without it, DSNs carry the bind address (0.0.0.0:8080), which nothing can reach.

SQLite suits personal projects, small teams and up to about 1,000 events an hour. For more, use PostgreSQL.

Docker Compose

The repository’s docker-compose.yml runs the same setup. Download it and put a .env next to it:

curl -O https://raw.githubusercontent.com/rustrak/rustrak/main/docker-compose.yml
cat > .env <<EOF
SESSION_SECRET_KEY=$(openssl rand -hex 32)
CREATE_SUPERUSER=admin@example.com:changeme123
PUBLIC_URL=http://localhost:8080
EOF
docker compose up -d
Shell

Compose refuses to start without SESSION_SECRET_KEY. The file also reads these, all optional:

VariableDefaultWhat it does
SERVER_PORT8080Host port mapped to the container’s 8080
RUSTRAK_METRICSoffServes Prometheus metrics on /metrics, without authentication
OIDC_*emptySingle sign-on

Behind Traefik, nginx or Caddy on the same Docker network, delete the ports block and let the proxy reach the container on 8080. See Reverse proxy.

PostgreSQL

For higher volume or concurrent writes, use the postgres image with a PostgreSQL database. docker-compose.postgres.yml runs both. Add a database password to the .env above and start it:

curl -O https://raw.githubusercontent.com/rustrak/rustrak/main/docker-compose.postgres.yml
echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" >> .env
docker compose -f docker-compose.postgres.yml up -d
Shell

POSTGRES_USER and POSTGRES_DB default to rustrak. The rustrak_data volume still holds uploaded source maps; the events live in PostgreSQL.

To use a database you already run, take the rustrak/rustrak-server:postgres image on its own and set DATABASE_URL:

-e DATABASE_URL=postgres://user:password@db.example.com:5432/rustrak
Shell

See Database backends.

The dashboard

The dashboard is compiled into the image and served from /, on the same origin as the API. There is nothing to configure for it. Two cases need something extra:

  • No dashboard. Set RUSTRAK_DASHBOARD=off and the server answers the API only.
  • The dashboard on another host. Run the server with RUSTRAK_DASHBOARD=off and put rustrak/rustrak-ui (about 30 MB) on the other host. See Dashboard on its own host.

Telemetry

The server sends one anonymous report every six hours: version, platform and health counters, never your data. Set RUSTRAK_TELEMETRY=off to turn it off. Telemetry lists every field.

Next

Sign in. An empty project list means the server is up. Create your first project and send it an event.

Esc

Type to search guides, configuration and the API.