Cube docs Sign in

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 variableDefaultPurpose
CUBE_ADDR:8080Web UI listen address.
CUBE_DATA/dataPersistent database and server-data directory.
CUBE_DOMAINemptyBase domain; enables the Minecraft TCP proxy when set.
CUBE_PROXY_ADDR:25565Minecraft TCP proxy listen address.
CUBE_SECUREfalseSet to true behind HTTPS to enable secure cookies and HSTS.
CUBE_TRUST_PROXYfalseSet to true only behind a trusted proxy that controls forwarded client IPs.
CUBE_LOG_LEVELinfodebug, info, warn, or error.
CUBE_LOG_FORMATjsonjson 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

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.