Self-hosted Git Server: Deploy Forgejo/Gitea with CI/CD and LDAP

GitLab CE consumes server resources even for a small team, and its setup and maintenance take time. We deploy a lightweight self-hosted Git server on Forgejo or Gitea with CI/CD and LDAP. Our team delivers the project turnkey—from repository migration to pipeline configuration and ongoing support, ensuring stable operation without missed deadlines.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Self-hosted Git Server: Forgejo/Gitea, CI/CD, LDAP, and Migration

If you use GitLab CE for a team of 10–15 developers, you know how resource-hungry it is: at least 4 GB RAM to start, and in production 8–16 GB plus separate Postgres, Redis, and Sidekiq. For small projects this is overkill and expensive. We offer a lightweight alternative — Forgejo or Gitea. One binary, 1 GB RAM, 50 MB disk — and you get a full git server with web interface, issue tracker, and now built-in CI via Forgejo Actions. Our team has deployed over 50 such installations for fintech, e-commerce, and SaaS over the years. Not a single outage caused by the platform. Unlike GitLab, Forgejo does not require a dedicated server — a VPS with 1 GB RAM is enough. Savings on cloud servers are 3–5 times, reducing monthly costs from $500 to $150.

What Problems Does Forgejo Solve?

Forgejo solves three main issues: resources, complexity, and CI/CD. Let's look at each:

  • Resources: GitLab CE consumes up to 8 GB RAM even with 10 users. Forgejo runs on 1 GB without degradation, reducing cloud server costs by 3–5 times.
  • Complexity: GitLab requires separate Postgres, Redis, Sidekiq. Forgejo is one binary or a Docker Compose with two containers (app + db).
  • CI/CD: GitLab CI needs GitLab Runner. Forgejo Actions uses GitHub Actions syntax and requires no external services.

Why Is Forgejo More Cost-Effective Than GitLab?

Resource comparison:

Parameter Forgejo GitLab CE
Minimum RAM 1 GB 4 GB
Recommended RAM (50 users) 2 GB 8 GB
Disk 50 MB 1 GB+
Dependencies Postgres Postgres, Redis, Sidekiq
Deployment time 30 min 2–4 hours

Forgejo is a fork of Gitea that emerged after a community conflict. Technically they are compatible: configs and APIs transfer unchanged. Forgejo receives patches 30% faster (according to OpenHUB data). For new projects we recommend Forgejo.

Deployment Options

Method Complexity Time Flexibility
Docker Compose Low 30 min Medium
Binary Medium 1 hour High
Helm chart (Kubernetes) High 2 hours Maximum

How to Set Up Forgejo with CI/CD in One Hour?

  1. Deploy via Docker Compose – create docker-compose.yml:

    ---
    version: "3"
    services:
      forgejo:
        image: codeberg.org/forgejo/forgejo:8
        container_name: forgejo
        environment:
          - USER_UID=1000
          - USER_GID=1000
          - FORGEJO__database__DB_TYPE=postgres
          - FORGEJO__database__HOST=db:5432
          - FORGEJO__database__NAME=forgejo
          - FORGEJO__database__USER=forgejo
          - FORGEJO__database__PASSWD=secret
        volumes:
          - ./data:/data
        ports:
          - "3000:3000"
          - "222:22"
        restart: unless-stopped
      db:
        image: postgres:16
        environment:
          - POSTGRES_USER=forgejo
          - POSTGRES_PASSWORD=secret
          - POSTGRES_DB=forgejo
        volumes:
          - ./postgres:/var/lib/postgresql/data
    ---
    

    Run: docker-compose up -d.

    Configure via web interface – set domain, email, disable registration. Key parameters in /data/gitea/conf/app.ini:

    [server]
    DOMAIN = git.company.com
    ROOT_URL = https://git.company.com/
    SSH_DOMAIN = git.company.com
    SSH_PORT = 22
    DISABLE_SSH = false
    
    [service]
    DISABLE_REGISTRATION = true
    REQUIRE_SIGNIN_VIEW = true
    REGISTER_EMAIL_CONFIRM = true

    DISABLE_REGISTRATION = true is mandatory for a closed team. Set up Forgejo Actions – add workflow file .forgejo/workflows/ci.yaml:

    on: [push] jobs: test: runs-on: docker steps: - uses: actions/checkout@v4 - name: Run tests run: go test ./... 

    Register an act runner:

    act_runner register \
      --instance https://git.company.com \
      --token <runner_token> \
      --name my-runner \
      --labels docker:docker://node:20-bookworm

    Runner executes jobs in isolated Docker containers. The whole process takes 30–60 minutes.

    Example production configuration

    For a production environment, we recommend adding database replication and automatic SSL certificate renewal via Let's Encrypt. Use an external Postgres with replication and regular repository backups. Also set up monitoring with Prometheus and alerts in Slack.

    How to Migrate Repositories from GitHub or GitLab?

    Forgejo supports importing with issues, pull requests, milestones, and wiki intact. For bulk migration use the API:

    for repo in $(gh repo list myorg --json name -q '.[].name'); do
      curl -X POST https://git.company.com/api/v1/repos/migrate \
        -H "Authorization: token $FORGEJO_TOKEN" \
        -H "Content-Type: application/json" \
        -d "{\"clone_addr\":\"https://github.com/myorg/$repo\",\"repo_name\":\"$repo\",\"mirror\":false,\"private\":true}"
    done

    Automating migration of 50 repositories takes no more than 2–3 days.

    What Is Included

    • Installation and configuration of Forgejo (or Gitea) with HTTPS and LDAP.
    • Integration with LDAP/SSO (Active Directory, OpenLDAP, Keycloak).
    • Setup of Forgejo Actions and registration of act runner.
    • Migration of repositories from GitHub, GitLab, Bitbucket with history preserved.
    • Documentation and team training.
    • One month of warranty support.

    Our DevOps engineers hold CKA certifications and have 5+ years of experience in Kubernetes and GitOps. We have completed over 50 projects migrating and configuring Git servers for fintech and e-commerce.

    Estimated Timelines

    • Basic Forgejo/Gitea installation with HTTPS and LDAP – from 4 to 8 hours.
    • Adding Forgejo Actions and migration – from 1 to 3 days.
    • Full turnkey project – from 3 to 5 days.

    Cost is calculated individually after an audit of your infrastructure. Order a turnkey Forgejo deployment with CI/CD and LDAP — get a ready git server in 4 hours. Contact us for an audit of your infrastructure. Get a DevOps engineer consultation on Forgejo setup.

    Forgejo is an open-source git repository management platform.