Skip to content

Environment Variables ​

Complete reference for all environment variables used by Trackarr.

Required Variables ​

These must be set for the application to run:

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
REDIS_URLRedis connection stringredis://:password@host:6379
NUXT_APP_SECRETSession encryption key (32+ chars)Random string
TRACKER_SECRETSecret for passkey generationRandom string
IP_HASH_SECRETSecret for IP hashingRandom string
TRACKER_INTERNAL_TOKENToken between the app and the tracker serviceopenssl rand -hex 32

Application Settings ​

VariableDescriptionDefault
NUXT_PUBLIC_SITE_NAMEDisplay name of your trackerTrackarr
NUXT_PUBLIC_SITE_URLPublic URL—
NUXT_PUBLIC_ANNOUNCE_URLAnnounce URL for torrents—
NODE_ENVEnvironment modedevelopment
PORTApplication port3000

Database ​

VariableDescriptionDefault
DB_USERRole the app, the tracker and PgBouncer connect with (no superuser)tracker
DB_PASSWORDIts password-
DB_NAMEDatabase nametrackarr
PG_SUPERUSERPostgreSQL administration role: backups and maintenance onlypostgres
PG_SUPERUSER_PASSWORDIts password, never given to the app, the tracker or PgBouncer-
DB_HOSTDatabase hostlocalhost
DB_PORTDatabase port5432

Without PG_SUPERUSER and PG_SUPERUSER_PASSWORD (installs from before the role split), DB_USER is the PostgreSQL superuser itself: run sudo ./scripts/db-split-role.sh once, see Configuration.

Redis ​

VariableDescriptionDefault
REDIS_HOSTRedis hostlocalhost
REDIS_PORTRedis port6379
REDIS_PASSWORDRedis password—

Security ​

VariableDescriptionDefault
POW_DIFFICULTYRegistration Proof of Work in bits (16-32), see configuration22
RATE_LIMIT_WINDOWRate limit window (seconds)60
RATE_LIMIT_MAXMax requests per window100
SESSION_MAX_AGESession lifetime (seconds)604800 (7 days)

Security alerts ​

Brute force (per account and from the tracker), honeypot hits, blocked IPs and impossible upload claims (possible ratio cheats) are listed in the admin dashboard. To be notified as well, set one or more webhooks (production only, unless ENABLE_DEV_ALERTS=true). The same alert is sent at most once every 5 minutes per IP, user or account.

VariableDescriptionDefault
DISCORD_WEBHOOK_URLDiscord webhook for security alerts—
SLACK_WEBHOOK_URLSlack webhook for security alerts—
SECURITY_WEBHOOK_URLAny endpoint: receives the alert as JSON (type, severity, title, ip, …)—
ENABLE_DEV_ALERTSSend webhooks outside production toofalse
HONEYPOT_BANfalse: honeypot paths (/wp-admin, /.env, *.php…) only alert, without blocking the IP (otherwise each probe blocks it for 5 min)true
UPDATE_CHECKfalse: never read the release list on GitHub. The admin panel then shows no update notice, security updates includedtrue

Tracker ​

The tracker is a separate service (tracker/, container trackarr-tracker). It also reads DATABASE_URL, DB_POOL_MAX (default 16), DB_CONNECT_TIMEOUT, DB_KEEP_ALIVE, REDIS_URL, REDIS_PASSWORD, the Sentinel variables, REDIS_COMMAND_TIMEOUT_MS (default 5000), REDIS_KEY_PREFIX (default ot:) and IP_HASH_SECRET (≥ 32 characters with NODE_ENV=production). DB_SSL=true and Redis TLS are not supported by the tracker yet. See tracker/README.md.

VariableDescriptionDefault
TRACKER_HTTP_PORTAnnounce/scrape port (HTTP)8080
TRACKER_INTERNAL_PORTPrivate API port (/health, /metrics, /internal/*)8090
TRACKER_INTERNAL_TOKENBearer token for /internal/*, same value on the app (_FILE supported)—
TRACKER_TRUST_PROXYProxies setting X-Forwarded-For: false, true (one, e.g. Caddy) or a count. Never on a directly exposed portfalse
TRACKER_INTERVALAnnounce interval (seconds)600
TRACKER_MAX_RATE_MIBPSCredit ceiling per peer (MiB/s)100
TRACKER_FLUSH_INTERVALSeconds between credit writes to PostgreSQL5
TRACKER_STATS_INTERVALSeconds between counter publications to Redis60
TRACKER_WARMUPSeconds after start before publishing countersinterval + 60
TRACKER_CACHE_CAPACITYEntries per lookup cache (users, torrents)500000
TRACKER_SNAPSHOT_PATHSwarm snapshot written on graceful stop, loaded on start (unset: disabled)/data/swarms.bin in the image
TRACKER_MAX_PEERS_PER_USERPeers one user may have in one swarm3
TRACKER_MAX_FAILURES_PER_MINUTEFailed lookups per client (IPv6 /64) before it is refused for the minute120
TRACKER_HEADER_TIMEOUT_SECSTime a client gets to send request headers10
TRACKER_MAX_CONNECTIONSSimultaneous connections per listener10000
DB_POOL_WAIT_MSLongest wait for a database connection (tracker)2000
TRACKER_DEBUGEnable the tracker's debug logsfalse
RUST_LOGLog filter, overrides TRACKER_DEBUG (driver debug logs print passkeys)—

The web app reaches the tracker's private API with:

VariableDescriptionDefault
TRACKER_INTERNAL_URLTracker private API URLhttp://localhost:8090 (http://tracker:8090 in Docker Compose)
TRACKER_INTERNAL_TOKENSame value as the tracker—

See Paid Registration.

VariableDescriptionDefault
MONERO_WALLET_RPC_URLWallet RPC the app uses (empty: Monero is not offered)-
MONERO_WALLET_PASSWORDPassword of the view-only wallet file-
MONERO_DAEMON_ADDRESSMonero node of the bundled wallet service (host:port)-
PAYMENT_CHECK_INTERVALPayment watcher interval in ms (minimum 5000)60000

The installer sets the Monero variables and adds monero to COMPOSE_PROFILES when you accept Monero.

Upload Assistant ​

See Upload Assistant.

VariableDescriptionDefault
PIXHOST_API_URLImage upload endpoint, for a proxy or testshttps://api.pixhost.to/images

Monitoring ​

Production only. See Monitoring.

VariableDescriptionDefault
MONITORING_DOMAINDomain serving Beszel through Caddymonitoring.localhost
BESZEL_ADMIN_EMAILBeszel login email, account created on Beszel's first start only—
BESZEL_ADMIN_PASSWORDBeszel login password (8+ characters), first start only: change it in Beszel afterwards—
BESZEL_AGENT_KEYPublic key shown by Beszel when adding the system (host /beszel_socket/beszel.sock)—
BESZEL_AGENT_TOKENToken shown by Beszel with the key—
COMPOSE_PROFILESSet to monitoring once paired, so the Beszel agent starts—

Example .env File ​

bash
# Application
NUXT_PUBLIC_SITE_NAME="My Private Tracker"
NUXT_PUBLIC_SITE_URL="https://tracker.example.com"
NUXT_PUBLIC_ANNOUNCE_URL="https://announce.example.com/announce"
NODE_ENV=production

# Database
DB_USER=tracker
DB_PASSWORD=secretpassword
DB_NAME=trackarr
PG_SUPERUSER=postgres
PG_SUPERUSER_PASSWORD=anothersecretpassword

# Redis
REDIS_URL="redis://:redispassword@redis:6379"
REDIS_PASSWORD=redispassword

# Security
NUXT_APP_SECRET="your-32-character-app-secret-here"
TRACKER_SECRET="your-tracker-secret-for-passkeys"
IP_HASH_SECRET="your-ip-hashing-secret"
POW_DIFFICULTY=22

# Tracker
TRACKER_INTERNAL_TOKEN="output-of-openssl-rand-hex-32"

WARNING

Never commit .env files to version control. Use .env.example as a template.

High Availability ​

Only needed for a replicated deployment; every default keeps the single-server behaviour.

VariableDescriptionDefault
TRACKER_BACKUP_HTTP_URLSOther sites' announce URLs (comma separated), fallback tiers in .torrent—
REDIS_SENTINELSSentinels as host:port,host:port; enables Sentinel mode—
REDIS_SENTINEL_NAMESentinel master group namemymaster
REDIS_SENTINEL_PASSWORDSentinel password, if they require one—
REDIS_SENTINEL_TLStrue when Sentinels use TLS (the Redis nodes follow REDIS_TLS)false
REDIS_COMMAND_TIMEOUT_MSFail Redis commands that get no reply after this delay— (no limit)
DB_CONNECT_TIMEOUTPostgreSQL connect timeout (seconds)10
DB_IDLE_TIMEOUTClose idle connections after (seconds), 0 = never30
DB_QUEUE_TIMEOUTRefuse a query that waited this long for a free connection (seconds)15
DB_KEEP_ALIVESeconds before TCP keepalive probes on database connections60

For several PostgreSQL nodes, list them in DATABASE_URL and keep only the primary: postgres://user:pass@db1:5432,db2:5432/trackarr?target_session_attrs=primary

Released under the MIT License.