Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Gitea on Hetzner (2026 Guide)

Learn how to self-host Gitea on Hetzner with a step-by-step 2026 guide covering setup, configuration, and recommended specs for a smooth deployment.

How to Self-Host Gitea on Hetzner (2026 Guide)

Gitea is a lightweight, self-hosted Git service that provides a simple interface for managing your repositories. Itโ€™s perfect for developers looking to keep their projects private or control their own infrastructure. In this guide, we will set up Gitea on a Hetzner VPS, a cost-effective and reliable hosting solution.

Benefits of Self-Hosting Gitea

  1. Privacy: You control your data and access.
  2. Customization: Tailor your Git service to fit your needs.
  3. Cost-effective: Affordable VPS options are available.

Choosing a Hetzner VPS Plan

When choosing a plan for Gitea, consider the following options:

ProviderPriceMemoryStorageCPU
Hetzner4.15 EUR/mo2 GB20 GB SSD1 vCPU
Contabo VPS5.99 EUR/mo4 GB100 GB SSD2 vCPU
DigitalOcean6 USD/mo2 GB25 GB SSD1 vCPU
Vultr6 USD/mo2 GB50 GB SSD1 vCPU
Linode5 USD/mo2 GB25 GB SSD1 vCPU

For our Gitea installation, Hetznerโ€™s 2 GB plan is typically sufficient for a small team or a few personal projects. However, if you plan to host larger repositories or have a significant number of users, consider opting for a plan with more RAM and storage.

Setting Up Gitea on Hetzner

  1. Create a Hetzner VPS:

    • Go to Hetznerโ€™s website and create an account.
    • Select a desired VPS package.
    • Choose your server region (preferably the closest to your location).
    • Set up your server and make a note of the IP address.
  2. Access Your VPS:

    • Use SSH to connect to your server:
      ssh root@YOUR_VPS_IP
  3. Update the System:

    • Update your package lists and install required packages:
      apt update && apt upgrade -y
      apt install -y git sqlite3
  4. Install Gitea:

    • Download the latest Gitea release (check the Gitea releases page for the newest version):
      wget -O gitea https://dl.gitea.io/gitea/vX.X.X/gitea-X.X.X-linux-amd64
      chmod +x gitea
  5. Create a Gitea User:

    adduser --system --shell /bin/bash --gecos 'Gitea' --group --disabled-password git
  6. Set Up Directories:

    mkdir -p /var/lib/gitea/{custom,data,indexers,log}
    chown -R git:git /var/lib/gitea
    chmod 750 /var/lib/gitea
  7. Configure Gitea:

    • Create a configuration file:
      cp gitea /usr/local/bin/
  8. Run Gitea:

    • Start Gitea with:
      /usr/local/bin/gitea web
  9. Access Gitea:

    • Open your web browser and navigate to http://YOUR_VPS_IP:3000.

Finalizing Setup

Now you can follow the instructions on the web interface to complete the setup. Ensure you configure the database, create an admin user, and set up the necessary security considerations.

FAQs

1. Can I run Gitea on a lower-spec VPS than the Hetzner recommended plan?

While itโ€™s possible to run Gitea on lower-spec VPS setups, it may compromise performance. A low-end system with insufficient RAM or CPU can lead to slow response times, especially with larger repositories or multiple users accessing it simultaneously. For optimal performance, even for a small number of projects, itโ€™s recommended to opt for at least the Hetzner 2 GB plan.

2. How does Gitea compare to other self-hosted Git solutions?

Gitea stands out due to its lightweight nature and ease of setup. Alternatives like GitLab or Gogs may offer more features but often require more resources and can become unwieldy for small projects. Gitea provides essential Git operations with a clean interface, making it ideal for developers wanting a straightforward self-hosted experience without the overhead.

3. What security measures should I take when hosting Gitea?

Security is paramount in self-hosted applications. Here are steps to enhance the security of your Gitea instance:

For more VPS options, check out our full VPS comparison. This will help you explore other providers that might fit your needs better!