zero2ctf.com

Install Docker on Windows 11 and Run CTFd

Before You Begin

Recommended PC:

Windows 11, administrator access, internet access, and 4 GB or more of RAM preferred.


Part 1. Install WSL 2
  1. Right-click the Start button.
  2. Open Terminal Admin or PowerShell Admin.
  3. Run the command below:
wsl --install

Restart the computer if Windows asks you to.

Verify WSL:

wsl --list --verbose
Checkpoint:

You should see Ubuntu listed with version 2.


Part 2. Install Docker Desktop
  1. Download Docker Desktop for Windows from Docker.
  2. Run the installer.
  3. Keep the WSL 2 backend option enabled.
  4. Open Docker Desktop from the Start Menu.
  5. Wait until Docker says it is running.

In Docker Desktop, WSL 2 may already be enabled by default on supported systems.

Checkpoint:

Docker Desktop should show “Docker is running.”


Part 3. Verify Docker

Open PowerShell and run:

docker --version
docker compose version

Run the test container:

docker run hello-world
Checkpoint:

The hello-world container should print a success message.


Part 4. Download CTFd

Create a folder for the workshop files:

mkdir CTFd
cd CTFd

Download the CTFd files:

curl -L https://github.com/CTFd/CTFd/archive/refs/heads/master.zip -o ctfd.zip
tar -xf ctfd.zip
cd CTFd-master

Part 5. Set a CTFd Secret Key

Open the docker-compose.yml file in Notepad or VS Code.

Find the environment section under the CTFd service and add or confirm a SECRET_KEY value:

environment:
  - SECRET_KEY=change-this-to-a-long-random-value
  - UPLOAD_FOLDER=/var/uploads
  - LOG_FOLDER=/var/log/CTFd
  - DATABASE_URL=mysql+pymysql://root:ctfd@db/ctfd
  - REDIS_URL=redis://cache:6379
  - WORKERS=4
Important:

Do not use the example secret key for a real event. Make it long and random.


Part 6. Start CTFd

From inside the CTFd-master folder, run:

docker compose up -d

Check the containers:

docker compose ps
Checkpoint:

You should see services such as CTFd, db, and cache running.


Part 7. Open CTFd

Open a browser and go to:

http://localhost:8000
  1. Create the admin account.
  2. Name the CTF event.
  3. Finish the first-time setup wizard.
Checkpoint:

You should reach the CTFd dashboard.


Part 8. Basic Admin Test
  1. Log in as the administrator.
  2. Go to Admin Panel.
  3. Create a simple challenge.
  4. Add a flag, such as flag{test}.
  5. Open the public challenge page and submit the flag.

Useful Docker Commands

Task Command
Start CTFd docker compose up -d
Stop CTFd docker compose down
View running containers docker compose ps
View logs docker compose logs -f
Restart services docker compose restart
Pull newer images docker compose pull

Troubleshooting

Docker command not found

Make sure Docker Desktop is installed and running. Close and reopen PowerShell.

Docker is not running

Open Docker Desktop from the Start Menu and wait for it to fully start.

Port 8000 is already in use

Check what is using the port:

netstat -ano | findstr :8000

Containers keep restarting

View logs:

docker compose logs -f

Need to reset and start over

This removes the containers. Depending on the Compose file, named volumes may still preserve data.

docker compose down

Sources checked: Docker Desktop for Windows documentation, Docker WSL 2 backend documentation, and CTFd installation documentation. Last updated: June 20, 2026.