Auto Tournament

Install

Run the Auto Tournament platform with Docker Compose and create the first admin.

This guide takes you from nothing to a first tournament in four parts: install the platform (this page), set up sign-in, add game servers with csm and run a tournament. It assumes you know your way around Docker and a Linux shell.

The platform is two containers: the app and a PostgreSQL database. Run it on any machine with Docker and Docker Compose: a VPS, a home server, or one PC at a LAN. The game servers run on other machines, with CS2 Server Manager.

Create a folder

mkdir -p auto-tournament && cd auto-tournament

Save docker-compose.yml

docker-compose.yml
services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
      POSTGRES_DB: auto_tournament
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U postgres']
      interval: 10s
      timeout: 5s
      retries: 5

  auto-tournament:
    image: sivertio/auto-tournament:latest
    container_name: auto-tournament
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
    env_file: .env
    ports:
      - '${HOST_PORT:-3069}:3069'
    environment:
      NODE_ENV: production
      PORT: 3000
      DB_HOST: postgres
      DATABASE_URL: postgresql://postgres:${DB_PASSWORD:-postgres}@postgres:5432/auto_tournament
    volumes:
      - app-data:/app/data
    healthcheck:
      test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3069/health']
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 20s

volumes:
  postgres-data:
  app-data:

The web app and the API share port 3069. PORT=3000 is the API's port inside the container; leave it. Set HOST_PORT in .env to publish another port on the host.

Create .env

cat > .env <<EOF
FRONTEND_BASE_URL=http://192.168.1.50:3069
SESSION_SECRET=$(openssl rand -base64 32)
SERVER_TOKEN=$(openssl rand -base64 24 | tr -d '=+/')
DB_PASSWORD=$(openssl rand -base64 18 | tr -d '=+/')
EOF

Set FRONTEND_BASE_URL to the address players and game servers use to reach the platform: the LAN IP of this machine, or https://cs.example.com behind a reverse proxy. Not localhost, because the game servers connect to it too.

SESSION_SECRET also encrypts the secrets you enter in the dashboard later (the Steam key, sign-in providers, the email password). Keep a copy: with a different value they can't be read, and you enter them again.

Everything else, the Steam Web API key and the sign-in providers included, is set in the dashboard. Configuration lists the other variables.

Start it

docker compose pull
docker compose up -d
docker compose logs auto-tournament

pull first: a machine that ran Auto Tournament before keeps an older image under the same tag, and up alone starts that one.

Create the first admin

On its first start the platform prints a setup code in the log:

========================================================================
  Auto Tournament: no admin account exists yet.
  Open http://192.168.1.50:3069/setup and enter this code:

      4F7K-...

Open that address, enter the code and create the admin account: a username and a password. Then turn on two-step verification with an authenticator app, or skip it for now, and pick the games this site runs (Counter-Strike 2, and any games whose results players report). The code works once and expires after 24 hours; restart the container for a new one.

Demo analysis (stats, the 2D replay, the moments for highlight clips) runs inside the platform container; there is nothing to set up for it.

If your domain does not point at this machine yet, open the setup page by the machine's IP instead (http://192.168.1.50:3069/setup). Signing in by IP keeps you signed in on that address only; use the domain once it works.

Next: Sign-in and accounts.

Where the data is

  • The database is in the postgres-data volume; demos, clips and uploads are in app-data. docker compose down keeps both, docker compose down -v deletes them.
  • To update: docker compose pull && docker compose up -d. Read Updating first.
  • Locked out: docker exec auto-tournament reset-admin prints a one-time code for /setup that sets a new admin password.

On this page