Docker deployment
A multi-stage image bundles Cube with a JRE, so a container can launch Minecraft servers out of the box.
Docker Compose
The repository ships a docker-compose.yml. From the project root:
docker compose up -d --build
This builds the image, starts Cube, and persists everything to a named volume mounted at /data. Open http://localhost:8080 and check the container logs for the first-run admin link:
docker compose logs cube
Plain Docker
docker build -t cube .
docker run -d --name cube \
-p 8080:8080 -p 25565:25565 \
-v cube-data:/data \
cube
Container configuration
The image entrypoint maps environment variables to Cube's command-line flags. Container logs default to structured JSON so Docker or another collector can index fields such as request ID, server ID, status, and duration.
| Environment variable | Default | Purpose |
|---|---|---|
CUBE_ADDR | :8080 | Web UI listen address. |
CUBE_DATA | /data | Persistent database and server-data directory. |
CUBE_DOMAIN | empty | Base domain; enables the Minecraft TCP proxy when set. |
CUBE_PROXY_ADDR | :25565 | Minecraft TCP proxy listen address. |
CUBE_SECURE | false | Set to true behind HTTPS to enable secure cookies and HSTS. |
CUBE_TRUST_PROXY | false | Set to true only behind a trusted proxy that controls forwarded client IPs. |
CUBE_LOG_LEVEL | info | debug, info, warn, or error. |
CUBE_LOG_FORMAT | json | json for containers or text for human-readable output. |
For an HTTPS reverse-proxy deployment, for example:
CUBE_DOMAIN=mc.example.com CUBE_SECURE=true CUBE_TRUST_PROXY=true docker compose up -d --build
Ports
8080— the Cube web UI.25565— the default Minecraft port. Each server listens on the port in itsserver.properties; map an additional host port for every extra server you run.
Data & persistence
All state — the SQLite database and every server's working directory — lives under /data. Keep that on a volume (as the compose file does) so it survives container recreation.
Behind an HTTPS reverse proxy, run Cube with -secure (sets the Secure cookie flag and HSTS) and, if the proxy sets X-Forwarded-For, -trust-proxy. See Configuration.