Deploy CTFd
An open-source platform to run capture-the-flag events.
ctfd
Just deployed
Deploy and Host CTFd on Railway
CTFd is an open-source platform for running Capture The Flag (CTF) events. It provides a user-friendly web interface for administrators to create challenges and manage participants, and for players to submit flags and track their standings on a live scoreboard. It has been used to host some of the largest CTF events in the world.
About Hosting CTFd
This Railway template deploys the official CTFd Docker image as a single service, using SQLite for storage — no external database or cache required. CTFd is configured behind Railway's proxy and is reachable on a Railway-provided HTTPS domain immediately after deployment. The initial setup wizard runs on first launch to configure the event name, mode, and admin credentials. For larger or longer-running events, upgrading to an external MySQL and Redis backend is recommended.
Common Use Cases
- CTF event hosting — run team or individual CTF competitions with challenges spanning web security, cryptography, reverse engineering, forensics, and more
- Security training — use CTFd in User Mode for internal security training and assessments, tracking individual progress across a custom challenge set
- Community events — host public or private CTF events with built-in registration, scoreboards, and optional MajorLeagueCyber SSO integration
Dependencies for CTFd Hosting
- CTFd Docker image (
ctfd/ctfd) - SQLite — bundled, no external database required for this template
Deployment Dependencies
Implementation Details
Optional: email notifications — configure SMTP to enable password resets and registration emails:
MAIL_SERVER=smtp.example.com
MAIL_PORT=587
MAIL_USEAUTH=true
MAIL_USERNAME=your-smtp-username
MAIL_PASSWORD=your-smtp-password
MAIL_FROM=ctf@example.com
Optional: scale up to MySQL + Redis — for larger events, add Railway's MySQL and Redis services and set:
DATABASE_URL=mysql+pymysql://user:password@host:3306/ctfd
REDIS_URL=redis://host:6379
Why Deploy CTFd on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying CTFd on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
ctfd
ctfd/ctfd