This section provides instructions for setting up the project locally.
To use this plugin, you should have:
- Experience hosting CTFd with Docker
- Basic knowledge of Docker
- SSH access to remote servers (if using remote Docker)
- Clone this repository:
git clone https://github.com/phannhat17/CTFd-Docker-Plugin.git
- Rename the folder:
mv CTFd-Docker-Plugin containers
- Move the folder to the CTFd plugins directory:
mv containers /path/to/CTFd/plugins/
- Go to the plugin settings page:
/containers/settings
- Fill in all fields except the
Base URL
.
- Map the Docker socket into the CTFd container by modify the
docker-compose.yml
file:
services:
ctfd:
...
volumes:
- /var/run/docker.sock:/var/run/docker.sock
...
- Restart CTFd
- Go to the plugin settings page:
/containers/settings
- Fill in all fields except the
Base URL
.
For remote Docker, the CTFd host must have SSH access to the remote server.
- SSH access from the CTFd host to the Docker server
- The remote server's fingerprint should be in the
known_hosts
file - SSH key files (
id_rsa
) and an SSH config file should be available
-
Prepare SSH Config:
mkdir ssh_config cp ~/.ssh/id_rsa ~/.ssh/known_hosts ~/.ssh/config ssh_config/
-
Mount SSH Config into the CTFd container:
services: ctfd: ... volumes: - ./ssh_config:/root/.ssh:ro ...
-
Restart CTFd:
docker-compose down docker-compose up -d
-
Ensure SSH Access:
- Test the connection:
ssh user@remote-server
- Test the connection:
-
Configure Docker Base URL:
- In the CTFd plugin settings page (
/containers/settings
), set:Base URL: ssh://user@remote-server
- In the CTFd plugin settings page (
-
Restart CTFd:
sudo systemctl restart ctfd
- Manage running containers
- Filter by challenge or player
Web Access | TCP Access |
---|---|
![]() |
![]() |
- Support for user mode
- Admin dashboard with team/user filtering
- Compatibility with the core-beta theme
- Monitor share flag
- Monitor detail on share flag
- Prevent container creation on solved challenge
For more features and known issues, check the open issues.
Distributed under the MIT License. See LICENSE.txt
for details.
This plugin is an upgrade of andyjsmith's plugin with additional features.
If there are licensing concerns, please reach out via email (contact below).
Phan Nhat
- Discord: ftpotato
- Email: [email protected]
- Project Link: CTFd Docker Plugin