Start the Torrust Tracker application services on a released environment.
Starts the Docker Compose services for the Torrust Tracker, bringing the application online. This command takes an environment from the "Released" state to the "Running" state with active tracker services.
The run command starts services using docker compose up -d and verifies they are running and accessible.
torrust-tracker-deployer run <ENVIRONMENT><ENVIRONMENT>(required) - Name of the environment to start
- Environment released - Must run
releasecommand first - Docker Compose files deployed - Application configuration must be on VM
- Firewall configured - Tracker ports must be open (done by
configure)
[Released] --run--> [Running]
When you run an environment:
- Starts Docker Compose services - Brings up tracker container (
docker compose up -d) - Validates services are running - Checks Docker Compose status
- Validates external accessibility - Verifies tracker services respond from outside VM
- Tracker API health check (port 1212) - required
- HTTP Tracker health checks (all configured HTTP tracker ports) - optional
Note: All tracker ports must be explicitly configured (port 0 for dynamic assignment is not supported). See ADR: Port Zero Not Supported for details.
The tracker container provides:
- UDP Tracker - BitTorrent announce endpoints (default ports: 6868, 6969)
- HTTP Tracker - HTTP-based announce endpoint (default port: 7070)
- HTTP API - RESTful API for tracker management (default port: 1212)
All services run inside a single torrust/tracker:develop Docker container.
# Start tracker services
torrust-tracker-deployer run my-environment# 1. Create environment
torrust-tracker-deployer create template --provider lxd > my-env.json
# Edit my-env.json with your settings
torrust-tracker-deployer create environment --env-file my-env.json
# 2. Provision infrastructure
torrust-tracker-deployer provision my-environment
# 3. Configure system
torrust-tracker-deployer configure my-environment
# 4. Release application
torrust-tracker-deployer release my-environment
# 5. Start services
torrust-tracker-deployer run my-environment
# Tracker is now running!After running, you can verify the tracker is working:
# Get VM IP address
VM_IP=$(torrust-tracker-deployer show my-environment | grep 'IP Address' | awk '{print $3}')
# Check tracker API health
curl http://$VM_IP:1212/api/health_check
# Expected: {"status":"ok"} or similar health response
# Check tracker stats
curl http://$VM_IP:1212/api/v1/stats
# Expected: JSON with tracker statistics (torrents, seeders, leechers, etc.)
# Check HTTP tracker health
curl http://$VM_IP:7070/api/health_check
# Expected: {"status":"ok"} or similar health response# SSH into VM
ssh -i ~/.ssh/your-key user@$VM_IP
# Check Docker Compose services
cd /opt/torrust
docker compose ps
# Expected output shows "tracker" service with status "Up"
# View tracker logs
docker compose logs tracker
# Follow tracker logs in real-time
docker compose logs -f trackerThe tracker exposes these ports (configurable in environment JSON):
| Port | Protocol | Service | Purpose |
|---|---|---|---|
| 6868 | UDP | UDP Tracker | BitTorrent announce (UDP) |
| 6969 | UDP | UDP Tracker | BitTorrent announce (UDP) |
| 7070 | TCP | HTTP Tracker | BitTorrent announce (HTTP) |
| 1212 | TCP | HTTP API | Tracker management API |
All ports are accessible externally if firewall is configured correctly.
Problem: Trying to run before releasing application files.
Solution:
# Run release first
torrust-tracker-deployer release my-environment
# Then try run again
torrust-tracker-deployer run my-environmentProblem: Docker shows services running but API not responding.
Solution:
# Get VM IP
VM_IP=$(torrust-tracker-deployer show my-environment | grep 'IP Address' | awk '{print $3}')
# Check if service is listening internally
ssh -i ~/.ssh/your-key user@$VM_IP "curl http://localhost:1212/api/health_check"
# If this works, it's a firewall issue - check UFW rules
ssh -i ~/.ssh/your-key user@$VM_IP "sudo ufw status numbered"
# Verify tracker ports are allowed (6868/udp, 6969/udp, 7070/tcp, 1212/tcp)Problem: Container starts but immediately exits.
Solution:
# SSH into VM and check logs
ssh -i ~/.ssh/your-key user@$VM_IP "cd /opt/torrust && docker compose logs tracker"
# Common issues:
# 1. Configuration error in tracker.toml
# 2. Database file permissions
# 3. Port already in use
# Check tracker configuration
ssh -i ~/.ssh/your-key user@$VM_IP "cat /opt/torrust/storage/tracker/etc/tracker.toml"
# Check database file exists and has correct permissions
ssh -i ~/.ssh/your-key user@$VM_IP "ls -la /opt/torrust/storage/tracker/lib/database/"Problem: Services running internally but not accessible from outside.
Solution:
# Verify firewall rules
ssh -i ~/.ssh/your-key user@$VM_IP "sudo ufw status numbered"
# Check if ports are listening
ssh -i ~/.ssh/your-key user@$VM_IP "sudo netstat -tulnp | grep -E '6868|6969|7070|1212'"
# Test connectivity from host
nc -zv $VM_IP 7070 # HTTP Tracker
nc -zv $VM_IP 1212 # HTTP API
# For UDP (may timeout but verifies firewall)
nc -zvu $VM_IP 6868 # UDP TrackerTo stop tracker services:
# SSH into VM
ssh -i ~/.ssh/your-key user@$VM_IP
# Stop services
cd /opt/torrust
docker compose down
# Or stop without removing containers
docker compose stopTo restart after stopping:
# Re-run the run command
torrust-tracker-deployer run my-environment
# Or SSH and start manually
ssh -i ~/.ssh/your-key user@$VM_IP "cd /opt/torrust && docker compose up -d"The run command performs external health checks to validate deployment:
-
Docker Compose Status Check (internal, via SSH)
- Verifies tracker container is in "running" state
- Checks via
docker compose ps
-
Tracker API Health Check (external, direct HTTP)
- Tests
http://<vm-ip>:1212/api/health_check - Required check - deployment fails if not accessible
- Validates both service functionality AND firewall rules
- Tests
-
HTTP Tracker Health Checks (external, direct HTTP)
- Tests
http://<vm-ip>:<port>/health_checkfor all configured HTTP trackers - Required checks - deployment fails if not accessible
- If you configure multiple HTTP trackers (e.g., ports 7070, 7071, 7072), all will be validated
- Tests
If external checks fail but Docker shows services running, it indicates a firewall or network configuration issue.
Once running, the tracker can be used by BitTorrent clients:
udp://<vm-ip>:6868/announce
udp://<vm-ip>:6969/announce
http://<vm-ip>:7070/announce
# Get tracker statistics
curl http://$VM_IP:1212/api/v1/stats
# Authenticate with admin token (from environment config)
curl -H "Authorization: Bearer MyAccessToken" \
http://$VM_IP:1212/api/v1/statsAfter starting services:
- Test announce - Configure a BitTorrent client to use your tracker
- Monitor logs - Watch tracker activity via Docker logs
- Test API - Explore tracker management API endpoints
When finished:
- Stop services - Use
docker compose downon VM - Destroy environment - Use
destroycommand to clean up infrastructure
release- Deploy application configuration (required before run)configure- Configure system infrastructuretest- Verify infrastructure readinessdestroy- Clean up deployment
The run command executes these steps in order:
- Start services (
StartServicesStep) - Runsdocker compose up -dvia Ansible - Validate running services (
RunningServicesValidator)- Checks Docker Compose status (via SSH)
- Checks external tracker API accessibility (direct HTTP - required)
- Checks external HTTP tracker accessibility for all configured HTTP trackers (direct HTTP - optional)
The validation ensures:
- Services are actually running inside the VM
- Firewall rules allow external access
- Tracker API responds to health checks
- All HTTP tracker instances (if configured) are accessible externally
Port Configuration Note: Dynamic port assignment (port 0) is not supported. All tracker ports must be explicitly specified in the environment configuration. This ensures deterministic deployment and reliable firewall configuration.