CTFd is a Capture The Flag framework which comes with everything you need to run a CTF.
373
mynkpdr/ctfdA production-ready Docker image of CTFd 3.8.0 with enhanced plugins, themes, and production optimizations. This image provides a complete Capture The Flag platform solution with advanced features for educational institutions, corporations, and security conferences.
# Pull and run the image
docker pull mynkpdr/ctfd:latest
docker run -d -p 8000:8000 --name ctfd mynkpdr/ctfd:latest
version: '3.8'
services:
ctfd:
image: mynkpdr/ctfd:latest
ports:
- "8000:8000"
environment:
- DATABASE_URL=mysql://ctfd:password@db/ctfd
- SECRET_KEY=your-secret-key-here
- MAIL_SERVER=smtp.example.com
depends_on:
- db
restart: unless-stopped
db:
image: mariadb:10.6
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_DATABASE=ctfd
- MYSQL_USER=ctfd
- MYSQL_PASSWORD=password
volumes:
- db_data:/var/lib/mysql
restart: unless-stopped
volumes:
db_data:
| Tag | Description | Use Case |
|---|---|---|
latest | Latest stable release | Production deployment |
SECRET_KEY=your-super-secret-key-here # Flask secret key
DATABASE_URL=mysql://user:pass@host/db # Database connection string
# OR use individual components:
DB_TYPE=mysql # mysql, postgresql, sqlite
DB_HOST=localhost
DB_PORT=3306
DB_USER=ctfd
DB_PASSWORD=password
DB_NAME=ctfd
MAIL_SERVER=smtp.example.com # SMTP server
MAIL_PORT=587 # SMTP port
MAIL_USE_TLS=true # Enable TLS
[email protected] # Email username
MAIL_PASSWORD=your-email-password # Email password
WORKERS=4 # Number of worker processes
REVERSE_PROXY=true # Behind reverse proxy
UPLOAD_FOLDER=/opt/CTFd/uploads # File upload directory
LOG_FOLDER=/opt/CTFd/logs # Log directory
THEME_NAME=pixo # Default theme
Mount these directories for data persistence:
# Database (if using SQLite)
/opt/CTFd/CTFd/ctfd.db
# Uploaded files
/opt/CTFd/uploads
# Logs
/opt/CTFd/logs
# Custom plugins (optional)
/opt/CTFd/CTFd/plugins
# Custom themes (optional)
/opt/CTFd/CTFd/themes
docker run -d \
--name ctfd-dev \
-p 8000:8000 \
-e SECRET_KEY=dev-secret-key \
mynkpdr/ctfd:latest
docker run -d \
--name ctfd-prod \
-p 8000:8000 \
-e SECRET_KEY=prod-secret-key \
-e DATABASE_URL=mysql://ctfd:[email protected]/ctfd \
-e MAIL_SERVER=smtp.example.com \
-e [email protected] \
-e MAIL_PASSWORD=email-password \
-e REVERSE_PROXY=true \
-v ctfd_uploads:/opt/CTFd/uploads \
-v ctfd_logs:/opt/CTFd/logs \
--restart unless-stopped \
mynkpdr/ctfd:latest
# Nginx configuration
server {
listen 80;
server_name ctf.example.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Access via Admin Panel → Plugins → Attempts-Viewer
Access via Admin Panel → Plugins → Containers
FROM mynkpdr/ctfd:latest
# Add custom plugins
COPY custom-plugins/ /opt/CTFd/CTFd/plugins/
# Add custom themes
COPY custom-themes/ /opt/CTFd/CTFd/themes/
# Custom configuration
COPY custom-config.py /opt/CTFd/CTFd/config.py
# Set custom defaults
ENV THEME_NAME=custom-theme
# Built-in health check endpoint
curl http://localhost:8000/healthcheck
# View container logs
docker logs ctfd
# Access application logs
docker exec ctfd tail -f /opt/CTFd/logs/ctfd.log
Container won't start
# Check logs for errors
docker logs ctfd
# Verify environment variables
docker exec ctfd env | grep -E "(SECRET_KEY|DATABASE)"
Database connection issues
# Test database connectivity
docker exec ctfd python -c "from CTFd import create_app; create_app().app_context()"
Plugin not loading
# Verify plugin directory
docker exec ctfd ls -la /opt/CTFd/CTFd/plugins/
# Check plugin logs
docker exec ctfd grep -i plugin /opt/CTFd/logs/ctfd.log
Maintained by: mynkpdr
Based on: CTFd 3.8.0
License: Apache 2.0
Ready to deploy, built for scale 🏴☠️
Content type
Image
Digest
sha256:29442d441…
Size
189.1 MB
Last updated
about 1 year ago
docker pull mynkpdr/ctfd