Deployment guide

Gitea vs GitLab: Which Self-Hosted Git Forge on a VPS?

Deploy on a VPS Cloud →

Comparison8 min read

Gitea vs GitLab: Which Self-Hosted Git Forge on a VPS?

Hosting your own Git forge means taking back control of your code, your CI, and your secrets. Gitea plays the lightweight card, GitLab the all-in-one platform. Here's how to decide and deploy yours on a VPS.

Why Self-Host Your Git Forge on a VPS

A self-hosted Git forge keeps your intellectual property off public platforms and removes any arbitrary limit on the number of private repositories, collaborators, or CI minutes. On a VPS, you control data location, backups, and integration with your internal pipeline. Gitea (and its fork Forgejo) is written in Go: a single binary, instant startup, minimal memory footprint, ideal for a modest VPS. GitLab CE is an integrated suite (issues, CI/CD, Docker registry, package registry, wiki, environments) but consumes far more RAM. The choice depends on your need: a clean, fast Git, or a complete DevOps platform in a single product.

The Benefits of a Self-Hosted Forge

  • Unlimited private repositories with no per-seat subscription
  • CI/CD under your control, with your own runners on the VPS
  • Secrets and tokens stored on your own server, off a third-party platform
  • Built-in Docker image and package registry, close to your deployments
  • Compliance and data residency in Morocco fully under control
  • With Gitea: a single binary, back up by copying a folder and a database

Prerequisites by Chosen Forge

Gitea is frugal: 1 vCPU and 1 GB of RAM are enough for a small team, 2 GB with the database and a few runners. GitLab CE is far more demanding: aim for at least 4 GB of RAM (8 GB recommended in real-world use with CI), 4 vCPUs, and a fast disk, since the suite bundles PostgreSQL, Redis, Sidekiq, and Gitaly. In both cases you'll need Docker and Compose, a subdomain (git.yourdomain.com), a reverse proxy for TLS, and ideally a second subdomain if you enable the Docker registry. Plan for a dedicated volume for the repositories and a backup strategy.

Deploy Gitea (or GitLab) on a VPS with Docker

01

Create the Volumes and the Network

Prepare mkdir -p /srv/gitea/{data,db} and a dedicated Docker network docker network create forge. Separating data/db makes it easier to back up the code and the database independently.

02

Define the docker-compose.yml

For Gitea, declare the gitea/gitea service plus a postgres, mount the volumes, and expose HTTP port 3000 and Git SSH port 2222 locally. For GitLab, use gitlab/gitlab-ce with the GITLAB_OMNIBUS_CONFIG variable to set the external_url.

03

Launch and Finish the Installation

Run docker compose up -d. Gitea shows an installation wizard on first connection (fill in the database type and the domain); GitLab takes several minutes to initialize—retrieve the generated root password from the logs.

04

Configure the Reverse Proxy and SSL

Proxy git.yourdomain.com to the forge's HTTP port with Caddy or Nginx to obtain a Let's Encrypt certificate. Make sure to pass the correct X-Forwarded-Proto so that the HTTPS clone URLs are correct.

05

Enable Git SSH

Map the container's SSH port to a VPS port (e.g. 2222) and set up your keys. Set SSH_DOMAIN so that the git clone commands suggested by the interface are accurate.

06

Wire Up CI/CD

Register a runner: Gitea Actions (compatible with GitHub Actions syntax) or a Docker GitLab Runner. Limit its resources and isolate it in its own container so that a heavy job doesn't bring the forge down.

CriterionGiteaGitLab CE
Recommended minimum RAM1 to 2 GB4 to 8 GB
ArchitectureSingle Go binaryMulti-service suite (omnibus)
Startup timeNear-instantSeveral minutes
Built-in CI/CDGitea Actions (GitHub-style)GitLab CI/CD, very complete
Docker / package registryIncluded and lightweightIncluded, rich
Project management (issues, boards)EssentialAdvanced (epics depending on edition)
Ease of backupFolder + SQL dumpDedicated omnibus procedure
Ideal forModest VPS, small/medium teamComplete DevOps platform

On GitLab, avoid the OOM-kill on a small VPS by reducing concurrency: set puma['worker_processes'] to 2 and sidekiq['max_concurrency'] to 10 in the omnibus config. If RAM remains a problem, look at Forgejo (a community fork of Gitea), which keeps the lightness while covering 90% of a team's needs, registry and Actions included.

Your Git Forge, Ready to Clone

A ServOrbit Cloud VPS with a Docker template lets you deploy Gitea or GitLab with a reverse proxy, SSL, and a CI runner in a few steps, right from your client area.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.