Installation
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 [email protected]:changeme123 \
-e PUBLIC_URL=http://localhost:8080 \
rustrak/rustrak-server:latestOpen http://localhost:8080 and sign in with the email and password from CREATE_SUPERUSER.
rustrak_dataholds the database and uploaded source maps. Keep the volume and the data survives restarts and upgrades.SESSION_SECRET_KEYsigns the session cookie. Keep the same value across restarts, or everyone is signed out.CREATE_SUPERUSERisemail: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_URLis 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)
[email protected]:changeme123
PUBLIC_URL=http://localhost:8080
EOF
docker compose up -dCompose refuses to start without SESSION_SECRET_KEY. The file also reads these, all optional:
| Variable | Default | What it does |
|---|---|---|
SERVER_PORT | 8080 | Host port mapped to the container’s 8080 |
RUSTRAK_METRICS | off | Serves Prometheus metrics on /metrics, without authentication |
OIDC_* | empty | Single 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 -dPOSTGRES_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:[email protected]:5432/rustrakSee 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=offand the server answers the API only. - The dashboard on another host. Run the server with
RUSTRAK_DASHBOARD=offand putrustrak/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.