Installation Guide
This guide will walk you through deploying your own GZCTF instance. GZCTF is designed to be deployed using containers for optimal portability and scalability.System Requirements
Minimum Requirements
CPU
2 cores (x64 or ARM64 architecture)
Memory
4 GB RAM minimum8 GB+ recommended for production
Storage
20 GB minimumScales with challenges and logs
Network
Stable internet connectionPublic IP for external access
Production Requirements
For production deployments with significant load:- CPU: 8+ cores for handling concurrent container operations
- Memory: 16GB+ RAM (GZCTF tested with 16c90g handling 1.34M requests in 3 minutes)
- Storage: SSD recommended for database performance
- Network: Low latency, high bandwidth for container traffic
Software Prerequisites
- Docker Deployment
- Kubernetes Deployment
- Docker Engine 20.10+
- Docker Compose V2 (recommended)
- PostgreSQL 12+ (can be containerized)
- Redis 6+ (can be containerized)
Architecture Overview
A typical GZCTF deployment consists of:Docker Deployment
The recommended deployment method uses Docker containers for all services.Create Project Directory
Create a directory structure for your GZCTF deployment:Directory purposes:
data/: PostgreSQL database fileslogs/: Application logsfiles/: Challenge files and uploads (if not using object storage)
Create Docker Compose File
Create a
docker-compose.yml file with the following configuration:docker-compose.yml
Configure Environment Variables
For better security, create a Then reference in docker-compose.yml using
.env file instead of hardcoding passwords:.env
${VARIABLE_NAME} syntax.Start Services
Launch all services:
First startup may take 1-2 minutes as the database is initialized and migrations are applied.
Understanding the Dockerfile
GZCTF uses a multi-stage build optimized for Alpine Linux:Dockerfile
- Based on .NET 10.0 Alpine for minimal size
- Multi-platform support (x64, ARM64)
- Includes ICU for internationalization
- Health check endpoint at
/healthz - Runs on port 8080 internally
First-Time Configuration
After installation, configure your GZCTF instance:Access Admin Panel
- Navigate to your GZCTF URL
- Click “Register” and create the first user account
- The first registered user is automatically granted admin privileges
Configure Global Settings
Navigate to Admin Panel → Settings and configure:
Basic Information
Basic Information
- Platform Title: Your CTF platform name
- Platform Description: Brief description for SEO
- Platform Logo/Favicon: Upload custom branding
- Footer Content: Custom footer HTML
Account Policies
Account Policies
- Allow Registration: Enable/disable public registration
- Email Confirmation: Require email verification
- Active on Register: Auto-activate accounts
- Email Domain List: Restrict to specific domains
- Use Captcha: Enable Cloudflare Turnstile
Container Configuration
Container Configuration
- Provider Type: Docker or Kubernetes
- Public Entry: Your public IP or domain
- Port Range: Range for dynamic container ports
- Registry: Container image registry URL
- Auto Destroy: Container lifetime settings
Storage Configuration
Storage Configuration
- Storage Type: Local, MinIO, or S3
- Bucket Name: For object storage
- Access Key/Secret: Object storage credentials
- Region: For AWS S3
Advanced Configuration
Using Object Storage (MinIO/S3)
For scalable deployments, use object storage instead of local files:Kubernetes Deployment
For Kubernetes deployments:- Configure container provider:
CONTAINERPROVIDER__TYPE=kubernetes - Create appropriate RBAC roles for pod management
- Use Kubernetes secrets for sensitive configuration
- Configure persistent volumes for database
- Set up ingress for external access
Detailed Kubernetes manifests and Helm charts are available in the official documentation.
Reverse Proxy Setup
For production, use a reverse proxy (nginx, Caddy, Traefik):Monitoring & Maintenance
Health Checks
GZCTF exposes health endpoints:Viewing Logs
Backup Strategy
Upgrading GZCTF
Troubleshooting
Cannot Connect to Database
Cannot Connect to Database
Symptoms: Application fails to start, connection refused errorsSolutions:
- Verify PostgreSQL container is running:
docker compose ps - Check database password matches in both services
- Ensure network connectivity:
docker compose exec gzctf ping db - Review PostgreSQL logs:
docker compose logs db
Container Challenges Won't Start
Container Challenges Won't Start
Symptoms: “Failed to create container” errorsSolutions:
- Verify Docker socket is mounted:
-v /var/run/docker.sock:/var/run/docker.sock - Check Docker permissions: GZCTF needs access to Docker API
- Verify network configuration and port ranges
- Check available system resources (CPU, memory, disk)
- Review container provider settings in admin panel
Email Verification Not Working
Email Verification Not Working
Symptoms: Users don’t receive verification emailsSolutions:
- Test SMTP settings from admin panel
- Check SMTP credentials are correct
- Verify firewall allows outbound SMTP traffic
- Check spam folders
- Review email logs:
docker compose logs gzctf | grep -i email
High Memory Usage
High Memory Usage
Symptoms: System slowness, OOM errorsSolutions:
- Limit Redis memory: add
maxmemory 2gbto Redis config - Configure container auto-destroy to clean up unused instances
- Increase system resources
- Monitor with
docker stats - Check for memory leaks in logs
Slow Database Queries
Slow Database Queries
Symptoms: Slow page loads, timeoutsSolutions:
- Ensure PostgreSQL has adequate resources
- Check database indexes are created (automatic)
- Monitor query performance:
docker exec gzctf-db psql -U postgres -d gzctf -c "SELECT * FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 10;" - Consider increasing PostgreSQL shared_buffers
- Use SSD storage for database
Performance Tuning
For high-load scenarios:- Database Optimization
- Redis Optimization
- Application Tuning
Add to PostgreSQL configuration:
Security Best Practices
Network Security
- Use HTTPS with valid certificates
- Configure firewall rules
- Limit database access to localhost
- Use VPN for admin access
Access Control
- Strong passwords for all services
- Regular password rotation
- Enable 2FA for admin accounts (if available)
- Audit user permissions regularly
Data Protection
- Encrypt database backups
- Secure backup storage
- Regular backup testing
- GDPR compliance for user data
Container Security
- Keep images updated
- Scan for vulnerabilities
- Limit container resources
- Use security profiles
Next Steps
Admin Guide
Learn how to configure and manage your GZCTF platform.
Create Your First Game
Set up your first CTF competition.
Challenge Configuration
Create and configure challenges for your competitions.
Monitoring & Metrics
Set up monitoring and observability for your instance.