How to Self-Host Gitea on Linode (2026 Guide)
Gitea is a lightweight, self-hosted Git service thatโs perfect for developers looking to manage their code repositories. This guide will walk you through the steps to install Gitea on a Linode VPS, providing you with a robust version control system tailored for your projects.
Why Choose Linode for Gitea?
Linode is chosen for its reliability and competitive pricing. At just 5 USD/mo, you can get a high-performance instance (1 GB RAM, 1 CPU, 25 GB SSD) suitable for Gitea hosting. Below is a quick comparison of popular VPS providers to help you see why Linode stands out:
| Provider | Monthly Price | RAM | CPU | SSD Storage | Link |
|---|---|---|---|---|---|
| Contabo VPS | 5.99 EUR | 4 GB | 1 | 200 GB | Contabo |
| Hetzner Cloud | 4.15 EUR | 2 GB | 1 | 20 GB | Hetzner |
| DigitalOcean | 6 USD | 1 GB | 1 | 25 GB | DigitalOcean |
| Vultr | 6 USD | 1 GB | 1 | 25 GB | Vultr |
| Linode | 5 USD | 1 GB | 1 | 25 GB | Linode |
For a full VPS comparison, visit our best VPS providers page.
Prerequisites
Before diving into the installation process, ensure you have:
- A Linode VPS instance up and running (a basic 1 GB plan is sufficient).
- Access to the terminal via SSH. (You can use tools like PuTTY or the terminal on Linux/Mac.)
- A domain name (optional but recommended).
- Basic Linux command line knowledge.
Step-by-Step Installation of Gitea on Linode
Step 1: Connect to Your Linode Instance
First, connect to your Linode VPS:
ssh root@your-linode-ip
Replace your-linode-ip with your VPSโs IP address.
Step 2: Install Required Dependencies
Before installing Gitea, you need to set up some dependencies:
sudo apt update
sudo apt install -y git mariadb-server nginx
Step 3: Configure MariaDB
Next, set up a database for Gitea:
-
Log in to MariaDB:
sudo mysql -u root -p -
Create a new database and a user:
CREATE DATABASE gitea; CREATE USER 'giteauser'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON gitea.* TO 'giteauser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Replace your_password with a strong password.
Step 4: Download Gitea
Now, download and install Gitea:
export GITEA_VERSION=$(curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest | grep tag_name | cut -d '"' -f 4)
wget https://dl.gitea.io/gitea/${GITEA_VERSION}/gitea-${GITEA_VERSION}-linux-amd64 -O gitea
chmod +x gitea
sudo mv gitea /usr/local/bin/
Step 5: Create Gitea User
Run Gitea under its own user:
sudo adduser --system --home /var/lib/gitea --shell /bin/bash --gecos 'Gitea' gitea
sudo mkdir /var/lib/gitea/{custom,data,log}
sudo chown -R gitea:gitea /var/lib/gitea/
Step 6: Configure Gitea
Create the configuration file:
sudo cp /usr/local/bin/gitea /etc/init.d/
sudo update-rc.d gitea defaults
Edit the gitea configuration file to set the database and other settings needed for your setup.
Step 7: Set Up Nginx
Configure Nginx to serve Gitea:
-
Create a new configuration file for Gitea:
sudo nano /etc/nginx/sites-available/gitea -
Paste the configuration below:
server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } -
Enable the site:
sudo ln -s /etc/nginx/sites-available/gitea /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx
Step 8: Start Gitea
You can now start Gitea:
sudo -u gitea /usr/local/bin/gitea web
Step 9: Access Gitea
Open your web browser and navigate to http://your-domain.com (or your VPS IP). Follow the web interface instructions to complete the setup.
FAQs
What is Gitea and why should I self-host it?
Gitea is an open-source, self-hosted Git service that provides a simple and efficient way to manage and collaborate on Git repositories. Self-hosting allows you to have complete control over your source code, including privacy, customization, and security configurations. This is particularly beneficial for developers who want a robust version control system without the limitations of traditional hosting options.
How much does it cost to host Gitea on Linode?
Hosting Gitea on a Linode VPS costs 5 USD/month for the basic plan. This plan includes 1 GB of RAM, adequate for running Gitea efficiently for small to medium-sized projects. If you need more resources, Linode offers flexible pricing plans that accommodate different requirements, so you can upgrade your instance as necessary.
Can I use a custom domain with Gitea on Linode?
Yes, you can use a custom domain with Gitea on Linode. In the Nginx configuration file, you can set the server_name directive to your domain name. Make sure to point your domainโs DNS records to your Linodeโs IP address. This allows you to access your Gitea installation through your custom domain easily.
By following these steps, youโll have a fully functional Gitea instance running on Linode, ready for managing your code repositories effectively. Happy hosting!