Skip to main content
Version: 21.5 - latest

Install with Docker

Deploy Gitea Enterprise with Docker while reusing the official container tooling.

Prerequisites

  • Docker Engine 20.10+ or a Kubernetes distribution.
  • Optional: Docker Compose v2 for declarative configuration.
  • A persistent volume for /data plus any external database you require.
  • Git is bundled inside the Enterprise image so repositories can be served immediately.
  • (Optional) An Enterprise license to enable premium features. Use License Activation to request a trial and upload the license after deployment.

1. Pick the image version

Enterprise images are published as commitgo/gitea-ee. Select the tag you plan to deploy (for example 24.6.0).

IMAGE=commitgo/gitea-ee:24.6.0

2. Single-host container

docker run -d \
--name gitea \
--restart always \
-p 3000:3000 \
-p 222:22 \
-v gitea-data:/data \
-e GITEA__server__DOMAIN=gitea.example.com \
-e GITEA__server__SSH_DOMAIN=gitea.example.com \
${IMAGE}

Pass additional configuration via environment variables (GITEA__section__key=value) or mount /data/gitea/conf/app.ini.

3. Docker Compose example

services:
db:
image: mariadb:11
restart: always
environment:
- MARIADB_ROOT_PASSWORD=change-me-now
- MARIADB_DATABASE=gitea
- MARIADB_USER=gitea
- MARIADB_PASSWORD=gitea-secret
volumes:
- gitea-mysql:/var/lib/mysql

gitea:
image: commitgo/gitea-ee:24.6.0
depends_on:
- db
restart: always
environment:
- GITEA__server__DOMAIN=gitea.example.com
- GITEA__server__SSH_PORT=222
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=db:3306
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea-secret
volumes:
- gitea-data:/data
ports:
- "3000:3000"
- "222:22"

volumes:
gitea-data:
gitea-mysql:

Save as docker-compose.yml, then run docker compose up -d. Replace passwords with secrets from your vault and pin the MariaDB image tag for production.

PostgreSQL Compose variant

Swap the database service for PostgreSQL if you prefer it:

services:
postgres:
image: postgres:16
restart: always
environment:
- POSTGRES_DB=gitea
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea-secret
volumes:
- gitea-postgres:/var/lib/postgresql/data

gitea:
image: commitgo/gitea-ee:24.6.0
depends_on:
- postgres
environment:
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgres:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea-secret
# ...other variables from the previous example

volumes:
gitea-data:
gitea-postgres:

Persist environment-specific configuration in Compose overrides or secrets files so credentials stay out of source control.

4. Upgrade existing containers

  1. Stop the running container and back up the data volume.
  2. Update image references to the desired Enterprise tag.
  3. Start the container again. The Enterprise binary reuses the same entrypoint and /data layout.
 services:
gitea:
- image: commitgo/gitea-ee:24.5.0
+ image: commitgo/gitea-ee:24.6.0

After the container restarts, follow License Activation to enable Enterprise features.

5. Post-install configuration

  • Apply advanced settings (authentication providers, emails, repository storage) using environment variables or by editing /data/gitea/conf/app.ini inside the container.
  • Consult the upstream Configuration Cheat Sheet for a complete list of options, then restart the container so changes take effect.

6. Maintenance tips

  • Follow the upstream backup and update recommendations.
  • Test new tags in staging before rolling out to production.
  • After upgrade, revisit License Activation to confirm the Enterprise license status.
  • When you need to scale beyond a single container, plan additional nodes for the database, object storage, and load balancers based on your availability requirements.

Gitea Enterprise ships the same entrypoint across releases, so ecosystem tooling continues to work without changes. For Kubernetes-specific instructions, see Install on Kubernetes.