git, ssh, python3, and curl — everything you need for coding workflows out of the box.
Common use cases
- Cloud VM or VPS hosting with a single command
- Shared team instances with persistent data volumes
- CI systems that need an isolated Codeg environment
Quick start with Docker Compose
Docker Compose is the recommended way to run Codeg. It handles the volume, port mapping, and restart policy for you.Get the compose file
Download the
docker-compose.yml from the repository, or create it with the following content:docker-compose.yml
Set your token
Export a fixed token before starting so it persists across container restarts:Or create a
.env file in the same directory:.env
Open in your browser
Navigate to http://localhost:3080 and enter your token.
Run with Docker directly
Usedocker run if you prefer not to use Compose or want to integrate Codeg into an existing setup.
Minimal — ephemeral data:
Get the auth token
If you did not setCODEG_TOKEN, Codeg generates a random token on startup and prints it to stderr. Retrieve it from the container logs:
<container-name> with the name shown in docker ps (e.g., codeg-codeg-1 for Compose deployments).
Volume mounts
| Mount path | Purpose |
|---|---|
/data | Codeg’s SQLite database and settings. Persist this volume to keep your data across container updates. |
/projects (or any path) | Mount local directories you want to access from within the workspace. The path inside the container can be anything. |
CODEG_DATA_DIR=/data by default, so the named volume codeg-data maps directly to the database location.
Configuration
All configuration is done through environment variables. Pass them with-e flags or in your docker-compose.yml environment block.
| Variable | Default | Description |
|---|---|---|
CODEG_PORT | 3080 | HTTP port the server listens on |
CODEG_HOST | 0.0.0.0 | Bind address |
CODEG_TOKEN | (random) | Auth token — printed to stderr on start if not set |
CODEG_DATA_DIR | /data | SQLite database directory (pre-set in the image) |
CODEG_STATIC_DIR | /app/web | Frontend assets directory (pre-set in the image) |
CODEG_DATA_DIR and CODEG_STATIC_DIR are pre-configured in the Docker image. You only need to override them if you mount assets or data to different paths.Update to the latest image
Image details
- Registry:
ghcr.io/xintaofei/codeg:latest - Base OS: Debian slim runtime — small footprint, production-ready
- Included tools:
git,ssh,python3,curl— everything needed for coding workflows - Exposed port:
3080 - Default data volume:
/data
/usr/local/bin/codeg-server) and the compiled frontend assets (/app/web), so no additional build steps are required.