Deploy TriviaFlow
This is the basic deployment guide for getting TriviaFlow up and running on your server. This guide will walk you through all essential steps to deploy a functional TriviaFlow instance.
Before starting, make sure you have completed all steps in the Prerequisites guide, including:
- A VPS with a supported Linux distribution
- A domain name pointing to your server
- Git and Docker installed
1. Clone Repository
Download the source code to your server:
git clone https://github.com/your-username/triviaflow.git
cd triviaflow
2. Configuration
Technical Config (.env)
Copy the example configuration file:
cp .env.example .env
nano .env
Required Changes:
- Set
DEBUG=False. - Generate a
SECRET_KEY. - Set
ALLOWED_HOSTSandCSRF_TRUSTED_ORIGINSto your domain. - Change
DB_PASSWORDandDB_ROOT_PASSWORD.
Caddyfile (Reverse Proxy)
The Caddyfile at the root of your project controls the web server and automatic HTTPS. You must edit this file and replace the placeholder domain with your actual domain.
Open the file:
nano Caddyfile
Replace the domain:
Find the line with quiz.your-domain.com and replace it with your actual domain (e.g., play.super-quiz.com).
quiz.your-domain.com {
# Static files and reverse proxy configuration
...
}
Optional - Database Admin (phpMyAdmin):
If you want a web interface to manage your database, uncomment the database block:
# db.your-domain.com {
# reverse_proxy phpmyadmin:80
# }
Remove the # symbols and replace db.your-domain.com with your database subdomain.
For more information about how Caddy works, automatic HTTPS, and troubleshooting, see Caddy Reverse Proxy in the Technical Reference.
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.
See Game Configuration to customize rules later.
3. 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
4. Initialize Game Configuration
After starting the application, you need to initialize the game configuration and presets in the database.
Initialize Game Config
docker compose exec web python manage.py init_game_config
This command sets up the core game mechanics configuration (scoring, timers, lobby settings, etc.) in the database.
Initialize Presets
docker compose exec web python manage.py init_presets
This command creates the built-in game mode presets (Competitive, Casual, Educational) that will be available when creating new games.
For detailed information about these commands and their options, see Custom Commands.
5. Create Admin User
To access the Game Master dashboard, you must create a Superuser account.
- Execute the command inside the running container:
docker compose exec web python manage.py createsuperuser - Follow the interactive prompts:
- Username: e.g.,
admin - Email: (Optional) e.g.,
admin@example.com - Password: Choose a secure password.
- Username: e.g.,
6. Verification
Verify that all containers are running correctly:
docker compose ps
All services should show status "Up". If any container has exited or shows errors, check the logs:
# Check application logs
docker compose logs web
# Check web server logs
docker compose logs caddy
# Check database logs
docker compose logs db
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.
Need Help?
If you encounter any issues:
- Check the Troubleshooting Guide for common problems and solutions
- Email us at support@triviaflow.de
- Join our Discord community
What's Next?
Now that your TriviaFlow instance is up and running, here are some recommended next steps:
Further Configuration
- Backup & Restore - Set up regular backups to protect your data
Create Your First Quiz
- Creating Quizzes - Build your first quiz in the admin panel
- Media Library - Add images to make your quizzes more engaging
- Import & Export - Import existing quiz content or export for sharing
Run Your First Game
- Game Setup & Running the Game - Learn how to create a game session and host your first live quiz event
- Gamemaster Dashboard - Master the control panel for running games