Self-Hosted Git Platform: GitLab to Gitea
My code, pull requests, CI/CD pipelines and container images live on hardware I run. The platform started on self-hosted GitLab CE. In November 2026 I moved it to Gitea, which does the same job on a fraction of the resources.
Gitea runs in a small LXC container on pve-1, is published at git.labjom.com through Cloudflare Tunnel, and drives every deployment in the lab with Gitea Actions.
How it fits together
Why move off GitLab
GitLab CE did everything I needed, but it was the heaviest thing on the host. It shared a VM with my public apps and kept that VM at 4 vCPUs and 9 GB of RAM, mostly for itself. My Kubernetes lab already used Gitea and Gitea Actions, so I was maintaining two Git platforms that did the same job.
Consolidating both labs onto one always-on host was the moment to pick one. Gitea won on footprint: it runs in an LXC container with 1 GB of RAM, includes a container registry, and its Actions use the same workflow syntax as GitHub Actions, which I also use for products hosted elsewhere.
The migration
- Import. Gitea's migration API pulled each GitLab project with its full history, every branch and tag, and its merge requests as pull requests, along with labels and milestones. The homelab site came over with 21 pull requests and GridTwin with 6.
- Verify. I compared every branch head in Gitea against GitLab before changing anything else. They matched exactly.
- Rewrite the pipelines. Each project's
.gitlab-ci.ymlbecame a.gitea/workflows/ci-cd.yamlin the same commit, so no branch ever had both or neither. - Replace the shell runner. GitLab deployed through a shell runner next to the apps' secret files. Its replacement is an
act_runnerin host mode, running as a normal user on the same VM, so deploys still find each app's.envand nothing secret moves into Git. - Cut over and clean up. After the first Gitea deploys went green, GitLab and its runner were uninstalled and their tunnel hostname removed. Two product repos that are hosted elsewhere moved to GitHub, where they already deploy from.
Two runners, two jobs
| Runner | Where | Runs |
|---|---|---|
| devbox | Docker runner on the workstation VM | Tests, Angular and .NET builds, Trivy image scans, SonarQube scans, image pushes to the registry |
| apps-host | Host mode on the Debian app VM | Deploy jobs only: docker compose up next to each app's .env, a health check, then pruning |
Build and test jobs never touch the app VM, and deploy jobs only run once they pass. A job that targets the apps-host label can only land on that one machine.
What every repo gets
homelab (this site)
Pull requests run a production Angular build. A push to main builds the Nginx image on the app VM, swaps the container and checks the site answers. Details.
GridTwin
pytest and mypy for the API and an Angular build, then the stack is rebuilt with Docker Compose and the job waits until the twin reports ready.
DataBI
.NET tests, two images, a Trivy gate on critical vulnerabilities, a push to Gitea's registry and a GitOps commit that Argo CD rolls out to k3s. Details.
All of them
A SonarQube job scans the code on every push and reports to my own SonarQube server, without ever blocking a deploy. Details.
What it freed up
| Debian app VM | With GitLab | After |
|---|---|---|
| vCPU | 4 | 2 |
| RAM | 9 GB | 4 GB |
| Disk used inside the VM | 107 GB | 27 GB |
| Host thin pool | 86% full | 31% full |
Most of the disk was Docker build cache left behind by years of pipelines (67 GB). Deploy jobs now prune cache older than a week after every run, and fstrim runs weekly so freed blocks go back to Proxmox. The freed RAM now runs the monitoring VM.
Security
- Published only through Cloudflare Tunnel; no router ports are open.
- Git over SSH and the registry stay on the home network.
- Secrets live in Gitea's encrypted Actions secrets or in
.envfiles on the server, never in Git. - Each deploy job fetches its commit with a short-lived per-job token.
- The GitLab token used for the import was read-only, and GitLab is now gone.