Configuration
Trackarr is configured primarily through environment variables. This page covers all available options.
Environment Variables
Core Settings
| Variable | Description | Default |
|---|---|---|
NUXT_PUBLIC_SITE_NAME | Your tracker's display name | Trackarr |
NUXT_PUBLIC_SITE_URL | Public URL of your tracker | — |
NUXT_APP_SECRET | Session encryption key (32+ chars) | — |
Database
| Variable | Description | Default |
|---|---|---|
DB_USER | Role the app, the tracker and PgBouncer connect with | tracker |
DB_PASSWORD | Its password (letters and digits: it goes into connection URLs) | - |
DB_NAME | Database name | trackarr |
PG_SUPERUSER | PostgreSQL administration role, for backups and maintenance only | postgres |
PG_SUPERUSER_PASSWORD | Its password. Never given to the app, the tracker or PgBouncer | - |
DATABASE_URL | Connection string, outside Docker only (compose builds it from the above) | - |
In production the app does not connect as the PostgreSQL superuser. DB_USER owns the application database, creates and alters its own tables (migrations run at every start), and can do nothing outside it: no COPY ... FROM PROGRAM, no server files, no other database, no new roles. A SQL injection in the app stops at the application data.
scripts/install.sh sets both roles up on a new install. An install made before this split has no PG_SUPERUSER in its .env and keeps working as it is, with DB_USER still the superuser; move it over once with:
cd /opt/trackarr
sudo ./scripts/db-split-role.shIt creates the application role with a generated password, gives it the database and everything in it, rewrites .env (a copy of the previous one is kept next to it) and restarts the database, PgBouncer, the app and the tracker: about a minute offline. It can be run again at any time: it then only checks, and gives back to the application role whatever a superuser created since.
Redis
| Variable | Description | Default |
|---|---|---|
REDIS_URL | Redis connection string | redis://localhost:6379 |
REDIS_PASSWORD | Redis password | — |
Tracker
| Variable | Description | Default |
|---|---|---|
TRACKER_SECRET | Secret for generating passkeys | — |
IP_HASH_SECRET | Secret for hashing peer IPs | — |
TRACKER_HTTP_URL | HTTP announce URL (shown in .torrent files) | http://localhost:8080/announce |
TRACKER_DEBUG | Enable verbose tracker logging | false |
TRACKER_INTERNAL_URL | Tracker service private API (app side) | http://localhost:8090 |
TRACKER_INTERNAL_TOKEN | Shared token between the app and the tracker service | — |
The tracker runs as a separate service (trackarr-tracker, HTTP only). UDP and WebSocket announces are not served. Tracker service settings are listed in the environment reference.
Configuring the Tracker URL
This URL is embedded in .torrent files and displayed in the admin dashboard. Configure it with your actual domain:
# In your .env file
TRACKER_HTTP_URL=https://tracker.your-domain.com/announceReplace your-domain.com with your actual tracker domain.
Security
| Variable | Description | Default |
|---|---|---|
POW_DIFFICULTY | Registration Proof of Work, in leading zero bits (16-32) | 22 |
RATE_LIMIT_WINDOW | Rate limit window in seconds | 60 |
RATE_LIMIT_MAX | Max requests per window | 100 |
Registering requires finding a nonce such that SHA256(challenge:nonce) starts with POW_DIFFICULTY zero bits: 2^POW_DIFFICULTY hashes on average, each extra bit doubling the work, while the server checks it with a single hash. The browser solver does about 2 million hashes per second on a recent laptop, so the default 22 (~4 million hashes) takes 1-2 s there, longer on phones. A value outside 16-32 is ignored with a warning and the default is used (older docs described a 1-10 scale, which the server never applied).
Paid Registration
Optional sign-up fee in Bitcoin, Monero or Solana, set in Admin → Payments. Only Monero needs environment variables (set by the installer): see Paid Registration.
Docker Compose Configuration
Production (docker-compose.prod.yml)
The production compose file includes:
- app — Main Trackarr application (website and API)
- tracker — BitTorrent tracker service in Rust (announces, scrapes)
- postgres — PostgreSQL 16 database
- pgbouncer — Connection pooling in front of PostgreSQL
- redis — Redis 7 cache
- caddy — Reverse proxy with automatic HTTPS
- beszel — Monitoring hub and UI (Monitoring)
- beszel-agent — Host and container stats (Compose profile
monitoring, starts once paired) - docker-proxy — Read-only Docker API filter for the agent (Compose profile
monitoring)
Development (docker-compose.yml)
A simplified setup for local development:
services:
app:
build: .
ports:
- '3000:3000'
environment:
- DATABASE_URL=postgresql://tracker:tracker@db:5432/trackarr
- REDIS_URL=redis://redis:6379
depends_on:
- db
- redis
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=tracker
- POSTGRES_PASSWORD=tracker
- POSTGRES_DB=trackarr
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
- redis_data:/dataCaddy Configuration
The production setup uses Caddy for automatic HTTPS. Configuration is in docker/caddy/Caddyfile:
{$DOMAIN} {
reverse_proxy app:3000
}
announce.{$DOMAIN} {
reverse_proxy app:3000
}
{$MONITORING_DOMAIN} {
respond /api/beszel/create-user 403
reverse_proxy trackarr-beszel:8090
}Security Recommendations
Production Checklist
Always use the install.sh script for production deployments. It handles:
- Generating cryptographically secure secrets
- Configuring TLS for all connections
- Setting up firewall rules
- Network isolation for databases
For manual deployments, ensure:
- All secrets are at least 32 characters
- Database ports are not exposed publicly
- Redis is password-protected
- HTTPS is enforced on all endpoints