Gitea: Git on Your Own Terms

Derek ArmstrongDerek Armstrong
6 min read

Welcome, fellow home lab enthusiasts! If you're anything like me, you've probably caught yourself thinking, "You know what my server rack needs? More services to tinker with!" Well, today we're diving into one of my favorite self-hosted applications: a personal Git server with Gitea. It's like having your own mini GitHub, without the corporate overlords or surprise "updates" to the terms of service.

Why Gitea? The Little Git Server That Could

In the world of self-hosted Git solutions, Gitea stands out like a sane person at a cryptocurrency convention. Written in Go, Gitea is ridiculously lightweight, blazing fast, and requires minimal resources - perfect for that dusty Raspberry Pi or the VM you've allocated just 512MB of RAM to.

While GitLab offers a more comprehensive DevOps platform with all the bells and whistles (and resource requirements to match), Gitea focuses on doing one thing extremely well: being a Git server that doesn't make your hardware weep. As one user aptly put it: "Gitea + SQLite is perfect for home lab. Zero maintenance overhead".

The interface will feel familiar to GitHub users, which makes the transition nearly painless. Plus, the project is actively maintained with regular updates and security patches.

The Pros: Why You'd Want Your Own Git Fortress

Data Sovereignty: Your Code, Your Rules

Having your own Git server means you're not subject to a third party's policies, outages, or sudden pricing changes. No third party has access to your data, ensuring security (which can still be questionable), and you have unlimited repository size.

Mirror, Mirror on the Wall, Who Has the Most Repos of All?

One of Gitea's killer features is its mirroring capability. You can:

  • Mirror repositories from GitHub, GitLab, or other services to create automatic backups

  • Push changes from your private Gitea instance to public repositories

  • Keep everything in sync with minimal effort

Gitea makes it trivial to mirror a repo. You just choose 'new migration' from under the '+' menu, and then click on the service you're migrating from.

Unrestricted Runner Minutes: CI/CD without the Meter Running

Unlike GitHub, which meters your CI/CD minutes like a stingy taxi driver, your self-hosted Gitea instance lets you run your CI/CD pipelines as long as your hardware can handle it. Want to set up a 3-hour build process that compiles your personal project on seven different architectures? Go wild!

Offline Access: Because Internet Outages Are a Thing

Another great reason to host your own Gitea instance is that it's available offline. When your internet decides to take an unscheduled vacation, you can still commit changes, browse code, and reference documentation.

Unlimited Private Repositories

You don't need to pay for private repositories or worry about limits from third-party services. With your own server, you have full control and can create unlimited private repositories at no extra cost. This lets you organize projects your way, whether they're small or large, and customize your workflow to fit your needs.

The Cons: The Price of Freedom

Maintenance: You Break It, You Fix It

Self-hosting means being your own system administrator. When things go sideways, there's no support ticket to file (unless you count yelling at your server rack).

Backups: Don't Be That Person

You absolutely need a backup strategy. "Just wondering what everyone is doing to back up a gitea container?” is a question you should answer before, not after, a disk failure.

Security: With Great Power Comes Great Responsibility

Security - continuous monitoring just in case someone gets curious...and lucky. If you're exposing your Gitea instance to the internet, you need to be vigilant about security. Do your homework, understanding how to impliment good security is a high value skill!

Protecting Your Code Castle

If you're keeping your Gitea instance local, behind your firewall, security is relatively simple. But if you're exposing it to the internet, consider:

  1. Using Cloudflare Zero Trust tunnels to avoid opening ports

  2. Enforcing two-factor authentication for all accounts

  3. Keeping your instance updated religiously

  4. Implementing strong password policies

Remember: The first registered user automatically gets admin privileges, so set up your account immediately after installation!

Setting Sail with Docker Compose

Getting started with Gitea is as easy as creating a docker-compose.yml file. Here's a basic example to get you started:

version: "3"

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "2222:22"

Save this to a file, run docker-compose up -d, and voilà! Your Gitea instance will be available at http://localhost:3000. The first user to register will become the admin.

For those who prefer a more rootless approach (because who doesn't like added security?), Gitea also offers a rootless Docker image that uses Gitea's internal SSH instead of OpenSSH.

Customization: Making It Your Own

The beauty of self-hosting is customization. Want to change the theme? Go for it. Need to integrate with your existing authentication system? It's possible. Want to add a dancing cat gif to the login page? Weird, but technically doable.

All configuration is stored in the app.ini file, which you can find in the custom directory of your Gitea installation.

Backup Strategies: Because Stuff Happens

Gitea provides a built-in dump command that creates a ZIP file containing everything needed to restore your instance. However, for a more robust solution, consider:

  1. Regular database backups

  2. Volume snapshots if you're using a filesystem that supports them

  3. Repository mirroring to another location

  4. Automated backup scripts that run on a schedule

Remember: a backup you haven't tested restoring from is just a file taking up disk space.

Conclusion: To Git or Not to Git?

Self-hosting Gitea is like brewing your own craft beer. Sure, you could just buy it from the store, but where's the fun in that? Plus, you get to brag about it to your friends who don't care but politely nod anyway.

The control, flexibility, and ownership you gain makes it worth the effort, especially if you're already maintaining a home lab. So fire up that Docker container and start gitting on your own terms. Your code deserves a home where it's treated like the precious resource it is, not just another tenant in a massive cloud datacenter.

References

  1. Gitea Documentation. (2023). Repository Mirror. https://docs.gitea.com/usage/repo-mirror

  2. Gitea Documentation. (2023). Installation with Docker (rootless). https://docs.gitea.com/installation/install-with-docker-rootless

  3. Stack Overflow. (2017). Which are the pros (and cons) of self-hosting your repositories. https://stackoverflow.com/questions/33740369/which-are-the-pros-and-cons-of-self-hosting-your-repositories-in-other-words

  4. XDA Developers. (2024). 5 reasons you should host your own Git server at home using Gitea. https://www.xda-developers.com/5-reasons-you-should-host-your-own-git-server-at-home-using-gitea/

  5. weblog.masukomi.org. (2022). Mirroring With Gitea. https://weblog.masukomi.org/2022/09/26/mirroring-with-gitea/

  6. phoenixNAP. (2025). How to Install Gitea with Docker on Ubuntu. https://phoenixnap.com/kb/gitea-docker

  7. Reddit. (2019). Pros & Cons: Self Hosted Git. https://www.reddit.com/r/selfhosted/comments/e9mvvk/pros_cons_self_hosted_git/

0
Subscribe to my newsletter

Read articles from Derek Armstrong directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Derek Armstrong
Derek Armstrong

I share my thoughts on software development and systems engineering, along with practical soft skills and friendly advice. My goal is to inspire others, spark ideas, and discover new passions.