Git and CI, checked 2026-10-17
Forgejo: Docker configuration reference
Self-hosted, community-run Git service forked from Gitea, with issues, pull requests and Actions.
At a glance
- Image:
codeberg.org/forgejo/forgejo - Tags:
16,16.0.6,16.0,15.0.10,15 - Licence: GPL-3.0-or-later
- Source: https://codeberg.org/forgejo/forgejo
- Docs: https://forgejo.org/docs/latest/
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
| Variable | Required | What it does | Example | Source |
|---|---|---|---|---|
USER_UID | No | UID the container runs as; the /data volume should be owned by the matching UID/GID or the container may 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 | Overwrites the automatically generated public URL, useful when internal and external URLs differ (for example in Docker). Any FORGEJO__[SECTION]__[KEY] variable is written to app.ini. | 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
| 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
| Dependency | Why | Source |
|---|---|---|
| SQLite (default), MySQL or PostgreSQL | SQLite needs no extra container; MySQL/PostgreSQL are configured via FORGEJO__database__* variables. | source for SQLite (default), MySQL or PostgreSQL |
Release timeline
| Version | Date | Breaking | What changed | Source |
|---|---|---|---|---|
v17.0.0 | 2026-10-15 | Yes | New major line. Upstream advises against upgrading for now: an issue can block pushes and merges in some cases. Sets duration parsing to strict and renames the default logfile to forgejo.log. | source for release v17.0.0 |
v16.0.6 | 2026-10-12 | No | Security fix: dispatches pull_request_review events from the pull request base, so forked pull requests get Actions protections. | source for release v16.0.6 |
v15.0.10 | 2026-10-12 | No | Point release on the 15.0 line, the current LTS. | source for release v15.0.10 |
v16.0.5 | 2026-09-17 | No | Security fix: stops ApplyDiffPatch from mutating bare repository config. | source for release v16.0.5 |
v16.0.4 | 2026-09-10 | No | Security fix: prevents template expansion from interfering with git repository initialisation. | source for release v16.0.4 |
v16.0.3 | 2026-08-20 | No | Point release on the 16.0 line; see the linked release notes file for the specific fixes. | source for release v16.0.3 |
v16.0.2 | 2026-07-30 | No | Point release on the 16.0 line. | source for release v16.0.2 |
v16.0.1 | 2026-07-21 | No | Point release on the 16.0 line. | source for release v16.0.1 |
v16.0.0 | 2026-07-16 | Yes | New major line. Upgrading across a major version requires reading the release notes for required manual steps before restarting. | source for release v16.0.0 |
If it is not coming up
- git@github.com: Permission denied (publickey) / Failed to read Git source
- ECONNREFUSED / ENOTFOUND / connection to server at "postgres" port 5432 failed
- Coolify volume data lost after redeploy / a new empty volume is created every deploy
Read from the upstream documentation, repository and container registry by Keita Emsden on 2026-10-17. Every row links the page it came from. Upstream changes without telling anyone, so check the source link before you rely on a value.