Docs / Self-Hosted Applications / How to Self-Host Gitea Git Service

How to Self-Host Gitea Git Service

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 28 views · 2 min read

What Is Gitea?

Gitea is a lightweight, self-hosted Git service. It provides a GitHub-like experience with repositories, issues, pull requests, and CI/CD — all running on minimal resources.

Requirements

  • A Breeze with at least 1 GB RAM
  • Docker and Docker Compose

Docker Compose Setup

mkdir -p /opt/gitea && cd /opt/gitea
cat > docker-compose.yml <<'EOF'
services:
  gitea:
    image: gitea/gitea:latest
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=db:3306
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea_password
    restart: unless-stopped
    volumes:
      - gitea-data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "2222:22"
    depends_on:
      - db

  db:
    image: mariadb:11
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=gitea_password
    volumes:
      - gitea-db:/var/lib/mysql

volumes:
  gitea-data:
  gitea-db:
EOF

docker compose up -d

Initial Setup

Visit http://your-server:3000 and complete the installation wizard. Set the site title, admin account, and SSH port (2222).

SSH Access

Users can clone repos over SSH using port 2222:

git clone ssh://git@your-server:2222/username/repo.git

Features

  • Repository management with web editor
  • Issue tracking and project boards
  • Pull requests with code review
  • Built-in CI/CD (Gitea Actions)
  • Package registry
  • Wiki per repository
  • OAuth2 and LDAP authentication

Was this article helpful?