Skip to content

Configuration ​

Trackarr is configured primarily through environment variables. This page covers all available options.

Environment Variables ​

Core Settings ​

VariableDescriptionDefault
NUXT_PUBLIC_SITE_NAMEYour tracker's display nameTrackarr
NUXT_PUBLIC_SITE_URLPublic URL of your tracker—
NUXT_APP_SECRETSession encryption key (32+ chars)—

Database ​

VariableDescriptionDefault
DB_USERRole the app, the tracker and PgBouncer connect withtracker
DB_PASSWORDIts password (letters and digits: it goes into connection URLs)-
DB_NAMEDatabase nametrackarr
PG_SUPERUSERPostgreSQL administration role, for backups and maintenance onlypostgres
PG_SUPERUSER_PASSWORDIts password. Never given to the app, the tracker or PgBouncer-
DATABASE_URLConnection 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:

bash
cd /opt/trackarr
sudo ./scripts/db-split-role.sh

It 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 ​

VariableDescriptionDefault
REDIS_URLRedis connection stringredis://localhost:6379
REDIS_PASSWORDRedis password—

Tracker ​

VariableDescriptionDefault
TRACKER_SECRETSecret for generating passkeys—
IP_HASH_SECRETSecret for hashing peer IPs—
TRACKER_HTTP_URLHTTP announce URL (shown in .torrent files)http://localhost:8080/announce
TRACKER_DEBUGEnable verbose tracker loggingfalse
TRACKER_INTERNAL_URLTracker service private API (app side)http://localhost:8090
TRACKER_INTERNAL_TOKENShared 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:

bash
# In your .env file
TRACKER_HTTP_URL=https://tracker.your-domain.com/announce

Replace your-domain.com with your actual tracker domain.

Security ​

VariableDescriptionDefault
POW_DIFFICULTYRegistration Proof of Work, in leading zero bits (16-32)22
RATE_LIMIT_WINDOWRate limit window in seconds60
RATE_LIMIT_MAXMax requests per window100

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).

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:

yaml
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:/data

Caddy 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:

  1. All secrets are at least 32 characters
  2. Database ports are not exposed publicly
  3. Redis is password-protected
  4. HTTPS is enforced on all endpoints

Released under the MIT License.