Minimal CTF web challenge template (Flask) ready to build locally and deploy.
Dockerfile— builds a small production image with Gunicorn.app.py— minimal Flask app and the starting point to the backend.requirements.txt— dependencies..dockerignore— keep images small.
# build (tag the image)
docker build -t ctf-template:latest .
# run (map host 8000 -> container 8000)
docker run --rm -p 8000:8000 ctf-template:latestOpen: http://localhost:8000 — you should see the flag.
# local steps (run inside repo folder)
git init
git add .
git commit -m "Initial CTF template"
# create a GitHub repo on github.com (name: cyberus-ctf-xx) then:
git remote add origin https://github.com/<username>/<repo>.git
git branch -M main
git push -u origin main- Sign up / sign in to Railway: https://railway.app
- Create a new project → choose Deploy from GitHub and select your repo.
- Railway will detect the
Dockerfileand build the image. - After build, In settings go to networking section, choose a domain and the gunicorn port. Railway will then give you a public domain you can use.
Note: For private repos, make sure to authorize Railway to access them otherwise they won't appear in the search:
- Go to Railway Account Integrations → GitHub → Install & configure repository access.
- This ensures Railway can see your private repo during deployment.
- On CTFd, create a new challenge that links to the Railway URL.
Happy (and hopefully error-free) CTF setting! 🙂