Git and CI, checked 2026-09-07
Forgejo: Docker configuration reference
Self-hosted, community-run Git service forked from Gitea, with issues, pull requests and Actions.
At a glance
Ports
Ports| Port | What listens | Source |
|---|
3000 | HTTP listener for the web UI, API and git-over-HTTP. Point the reverse proxy here. | source for port 3000 |
22 | Built-in OpenSSH daemon for git-over-SSH, typically published on host port 222 since a reverse proxy cannot forward raw SSH the way it forwards HTTP. | source for port 22 |
Environment variables
Environment variables| Variable | Required | What it does | Example | Source |
|---|
USER_UID | No | UID the container runs as; the /data volume must be owned by the matching UID/GID or the container will not start. | 1000 | source for USER_UID |
USER_GID | No | GID for the container user, alongside USER_UID. | 1000 | source for USER_GID |
FORGEJO__server__ROOT_URL | No | Any FORGEJO__[SECTION]__[KEY] variable is written into app.ini on start. ROOT_URL is the public URL used when the automatically detected one is wrong behind a proxy. | https://git.example.com/ | source for FORGEJO__server__ROOT_URL |
FORGEJO__database__DB_TYPE | No | Selects the database driver (sqlite3, mysql, postgres) for environment-variable based configuration instead of the setup wizard. | postgres | source for FORGEJO__database__DB_TYPE |
Volumes that must persist
Volumes| Path | What is in it | Source |
|---|
/data | Repositories, app.ini, SSH host keys and the SQLite database if used. Must be owned by USER_UID/USER_GID. | source for /data |
Behind a reverse proxy
- Route the domain to container port 3000 for HTTP/git-over-HTTP; SSH on container port 22 needs its own published port (commonly 222) since it cannot be reverse-proxied like HTTP. source for this reverse-proxy note
- Configuration keys can be set with FORGEJO__SECTION__KEY environment variables, the documented way to set ROOT_URL and database settings from a compose file. source for this reverse-proxy note
- If codeberg.org is unreachable when pulling the image, the docs note every codeberg.org reference in the pull command can be swapped for the mirror at data.forgejo.org. source for this reverse-proxy note
What it needs alongside it
Release timeline
If it is not coming up
Read from the upstream documentation, repository and container registry by Keita Emsden on 2026-09-07. Every row links the page it came from. Upstream changes without telling anyone, so check the source link before you rely on a value.
Other app references
All app references