docs.sivert.io

Quick Start

Copy/paste installation and first run.

Install and run MAT with Docker in a few minutes.

Requirements

  • Docker + Docker Compose

Install

Create an empty folder on your server, for example:

mkdir -p mat && cd mat

1) Save as docker-compose.yml

services:
  postgres:
    image: postgres:16-alpine
    container_name: matchzy-postgres
    restart: unless-stopped
    environment:
      - POSTGRES_USER=${DB_USER:-postgres}
      - POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
      - POSTGRES_DB=${DB_NAME:-matchzy_tournament}
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U ${DB_USER:-postgres}']
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - matchzy-network

  matchzy-tournament:
    image: sivertio/matchzy-auto-tournament:latest
    container_name: matchzy-tournament-api
    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://${DB_USER:-postgres}:${DB_PASSWORD:-postgres}@postgres:5432/${DB_NAME:-matchzy_tournament}
      - SESSION_SECRET=${SESSION_SECRET:-}
    volumes:
      - ./data:/app/data
    healthcheck:
      test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:3069/health']
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 10s
    networks:
      - matchzy-network

networks:
  matchzy-network:
    driver: bridge

volumes:
  postgres-data:
    driver: local

2) Create .env

Start by creating .env with the required values:

# required
SESSION_SECRET=
SERVER_TOKEN=
FRONTEND_BASE_URL=http://localhost:3069
STEAM_API_KEY=

# recommended defaults
AUTH_STEAM_ENABLED=true
LOG_LEVEL=info

# database (defaults are fine for most installs)
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=matchzy_tournament

Generate secrets (copy/paste the output into .env):

openssl rand -base64 32
openssl rand -base64 24 | tr -d '=+/'

Get your Steam API key from the Steam Web API key page and paste it into STEAM_API_KEY.

If you’re running behind a domain/reverse proxy, set FRONTEND_BASE_URL to your public HTTPS URL (for example https://your-domain.com).

3) Start

docker compose up -d

4) First admin login

  • Click Sign in with Steam.
  • If there are no admins yet, the first Steam user to sign in is automatically promoted to admin.

Option B: clone the repo (dev / contributing)

git clone https://github.com/sivert-io/matchzy-auto-tournament.git
cd matchzy-auto-tournament
cp example.env .env
docker compose -f docker/docker-compose.yml up -d

Next steps

How is this guide?

Last updated on

On this page