This repository contains a Dockerfile to create a CnCNet tunnel server in Docker, using the prebuilt cncnet-server binary.
A tunnel server relays game traffic to help players connect to each other for online multiplayer in classic Command & Conquer titles (and other CnCNet-supported games).
Important
This image is based on the older cncnet-server binary and now-deprecated runtimes — it pulls a build that depends on .NET 6 (end-of-life) and is pinned to Ubuntu 22.04.
For new deployments, use the actively maintained .NET Core tunnel instead: CnCNet/cncnet-docker-dotnetcore-tunnel (.NET 8/9/10, configurable via environment variables, prebuilt images).
This repo is kept for reference and existing setups.
The image is automatically built and published to the GitHub Container Registry, so you can pull and run it directly — no need to clone this repo or build anything:
| Image |
|---|
ghcr.io/cncnet/cncnet-docker-tunnel:latest |
docker run -d --name my-tunnel-server \
-p 50000:50000/tcp \
-p 50000:50000/udp \
-p 50001:50001/tcp \
-p 50001:50001/udp \
-p 8054:8054/udp \
-p 3478:3478/udp \
--cap-add=NET_RAW --cap-add=NET_ADMIN \
--restart unless-stopped \
ghcr.io/cncnet/cncnet-docker-tunnel:latestYour server will appear in the CnCNet tunnel list under the default name "My CnCNet tunnel". To use your own name (or other options) without rebuilding, override the start command at run time — append it after the image name:
docker run -d --name my-tunnel-server \
-p 50000:50000/tcp -p 50000:50000/udp \
-p 50001:50001/tcp -p 50001:50001/udp \
-p 8054:8054/udp -p 3478:3478/udp \
--cap-add=NET_RAW --cap-add=NET_ADMIN \
--restart unless-stopped \
ghcr.io/cncnet/cncnet-docker-tunnel:latest \
./cncnet-server --name "My Custom Tunnel Name" --maxclients 200 --port 50001 --portv2 50000Prefer to build the image yourself (e.g. to bake in your own tunnel options)? Follow the steps below instead.
git clone https://github.com/CnCNet/cncnet-docker-tunnel.git
cd cncnet-docker-tunnelThe server is launched by the final CMD line in the dockerfile. Edit it to set your server name and any other options:
CMD ./cncnet-server --name "My CnCNet tunnel" --maxclients 200 --port 50001 --portv2 50000 > cncnet-server.log 2>&1 && tail -f cncnet-server.logReplace my-tunnel-server with a name that helps you identify your container:
docker build -t my-tunnel-server .docker run -d --name my-tunnel-server \
-p 50000:50000/tcp \
-p 50000:50000/udp \
-p 50001:50001/tcp \
-p 50001:50001/udp \
-p 8054:8054/udp \
-p 3478:3478/udp \
--cap-add=NET_RAW --cap-add=NET_ADMIN \
--restart unless-stopped \
my-tunnel-serverYou can edit your dockerfile (or the run-time command) to pass extra options to cncnet-server. Common options:
| Option | Description | Default |
|---|---|---|
--name |
Name shown in the CnCNet tunnel list | My CnCNet tunnel |
--maxclients |
Maximum number of concurrent clients | 200 |
--port |
V2 tunnel port | 50001 |
--portv2 |
V3 tunnel port | 50000 |
So your dockerfile run command may end up looking like:
CMD ./cncnet-server --name "CnCNet UK | cncnet.org" --maxclients 200 --port 50001 --portv2 50000 > cncnet-server.log 2>&1 && tail -f cncnet-server.logFor example, to change the server name shown in the tunnel list.
| Port | Protocol | Purpose |
|---|---|---|
| 50000 | TCP/UDP | Tunnel V3 |
| 50001 | TCP/UDP | Tunnel V2 |
| 8054 | UDP | P2P / STUN |
| 3478 | UDP | P2P / STUN |
Make sure these ports are open in any firewall or cloud security group in front of your server.
For easier management, you can run the prebuilt image with a docker-compose.yml:
services:
cncnet:
image: ghcr.io/cncnet/cncnet-docker-tunnel:latest
container_name: cncnet-server
restart: unless-stopped
command: ./cncnet-server --name "MyTunnel" --maxclients 200 --port 50001 --portv2 50000
ports:
- "50000:50000/tcp"
- "50000:50000/udp"
- "50001:50001/tcp"
- "50001:50001/udp"
- "8054:8054/udp"
- "3478:3478/udp"
cap_add:
- NET_RAW
- NET_ADMINThen bring it up with:
docker compose up -dThe server writes its output to /app/cncnet-server.log inside the container (not to the container's stdout, so docker logs will be empty). To view or follow it:
docker exec my-tunnel-server tail -f /app/cncnet-server.logThe CnCNet tunnel server software is a CnCNet project. CnCNet is sponsored by DigitalOcean.