I Left GitHub and Hosted My Own Git Server. Here Is How.
troysk
June 1, 2026 · 3 min read
GitHub is the default that everyone uses and I used it for years, but I have private repositories I do not want Microsoft to touch and large binary files that make Git LFS on GitHub expensive and sometimes I just want to git push without worrying about someone else’s terms of service changing. Gogs is the answer, a self-hosted Git server written in Go that is so lightweight it can run on a Raspberry Pi Model A with sixty-four megabytes of RAM.
Gogs is the original Go-based Git server that started it all. Gitea was forked from Gogs back in 2016, and while Gitea has added more features over the years, Gogs has stayed focused on being as minimal and efficient as possible. The difference is stark, Gitea needs around a hundred megabytes of RAM while Gogs runs comfortably in under thirty megabytes. Gogs compiles to a single statically linked binary with no dependencies, and you can copy it to any Linux machine and have a working Git server in seconds.
The Docker setup is the simplest of any service I run. One image, one port mapping for the web interface, another port for SSH access, and a single volume for all your data. You run docker compose up, open your browser, and the setup page asks you a few questions about your database and admin account. SQLite works perfectly for personal use and requires zero configuration.
services:
gogs:
image: gogs/gogs:latest
ports:
- "3000:3000"
- "1022:22"
volumes:
- data:/data
restart: unless-stopped
volumes:
data:
Migrating repositories from GitHub is handled through the built-in migration tool. You enter your GitHub repository URL and an access token, and Gogs clones the entire repository including issues and pull requests. You can migrate one repository at a time or set up mirrors that stay in sync with the origin. I migrated all my private repos over a weekend and deleted my GitHub subscription on Monday morning.
SSH access requires adding your public key in the account settings, and after that git push and git pull work exactly as they do on GitHub. The only difference is the URL, which uses your own domain and the custom SSH port you configured. It feels identical to using GitHub because at the protocol level Git does not care where the server lives.
What Gogs does not have is worth mentioning. There is no built-in continuous integration runner, no package registry, no wiki, no advanced code review workflows. What you get instead is a rock-solid Git server that uses almost no resources and never needs maintenance. If you need CI, you can pair Gogs with Drone CI or Woodpecker, both of which integrate seamlessly. If you need a wiki, BookStack or Outline runs alongside it. The philosophy of Gogs is to do one thing well and let other tools handle the rest.
I chose Gogs over the alternatives because I wanted something that would sit on my server for years without me thinking about it. Gogs has been running on my machine for over a year now and I have not touched the configuration once. No updates broke anything. No database migrations failed. It just sits there accepting my git pushes and serving my repositories. There is something beautiful about software that fades into the background and does its job without demanding attention.
Forgejo and Gitea are both fine projects with more features and larger communities. But if you want the lightest possible Git server that you set up once and forget about, Gogs is the answer.
Owning your Git server is like owning your own home after renting. You have to maintain it yourself but nobody can change the terms or raise the price.
If this resonates why not subscribe to the newsletter? I write about self-hosting and taking control of your infrastructure.
Get New Articles
Weekly guides on self-hosting, privacy, and infrastructure.
No spam. Unsubscribe anytime.