Skip to main content

Deployment Guide

This guide covers the complete process of setting up TriviaFlow on a Linux server.

1. Prerequisites

  • A server running Linux (Debian 12/13, Ubuntu 22.04+, etc.).
  • Root access or sudo privileges.
  • A public domain name (e.g., quiz.your-domain.com).

Install Docker

TriviaFlow runs entirely in containers. If you haven't installed Docker yet, use the official convenience script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Manual Installation (Advanced)

If you prefer to install via apt repository:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release; echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

2. Clone Repository

Download the source code to your opt or home directory:

git clone https://github.com/your-username/triviaflow.git
cd triviaflow

3. Configuration

Technical Config (.env)

Copy the example configuration file:

cp .env.example .env
nano .env

Required Changes:

  1. Set DEBUG=False.
  2. Generate a SECRET_KEY.
  3. Set ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS to your domain.
  4. Change DB_PASSWORD and DB_ROOT_PASSWORD.
Detailed Reference

See the Configuration Reference for a full explanation of every variable.

Game Config (game_config.ini)

Copy the game configuration example:

cp game_config.ini.example game_config.ini

This file controls gameplay mechanics like questions timers and scoring. You can leave the defaults for now.

Game Logic

See Game Configuration to customize rules later.

4. Start the Application

We use Docker Compose to start the Database, Redis, Caddy (Webserver/Proxy), and the Django App.

Standard Start:

docker compose up -d --build

Start with phpMyAdmin: (Only if you configured a DB domain in Caddyfile)

docker compose --profile admin up -d --build

5. Create Admin User

To access the Game Master dashboard, you must create a Superuser account.

  1. Execute the command inside the running container:
    docker compose exec web python manage.py createsuperuser
  2. Follow the interactive prompts:
    • Username: e.g., admin
    • Email: (Optional) e.g., admin@example.com
    • Password: Choose a secure password.

6. Verification

Open your browser and navigate to:

  • https://quiz.your-domain.com/admin - Log in with your new Superuser account.

Congratulations! Your TriviaFlow server is fully operational.