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

guide

How to Self-Host Forgejo on Linode (2026 Guide)

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

How to Self-Host Forgejo on Linode (2026 Guide)

Self-hosting applications like Forgejo can empower developers and homelabbers by providing control over their data and tools. In this guide, we will walk you through the process of installing Forgejo on a Linode VPS. Forgejo is an open-source software that facilitates source code management using Git, similar to platforms like GitHub but with greater flexibility for self-hosted environments.

Why Choose Linode for Forgejo?

Before diving into the installation process, letโ€™s briefly discuss why Linode makes a great choice for hosting Forgejo. Linode offers high-performance virtual machines starting at just 5 USD per month, making it an affordable option for developers. Their infrastructure is streamlined for speed and reliability, essential for efficient Git hosting.

Linode VPS Pricing Overview

Here is a quick comparison of VPS providers based on their starting prices:

ProviderMonthly Price (EUR/USD)CPU CoresRAMStorage
Contabo VPS5.99 EUR/mo48GB200GB
Hetzner Cloud4.15 EUR/mo12GB20GB
DigitalOcean6 USD/mo11GB25GB
Vultr6 USD/mo11GB25GB
Linode5 USD/mo12GB50GB

For a complete comparison, check out our full VPS comparison.

Prerequisites for Self-Hosting Forgejo on Linode

Before we start with the installation, ensure you have the following:

  1. A Linode Account: Create an account on Linode, if you havenโ€™t already.
  2. A VPS Instance: Spin up a new Linode instance with at least 2 GB of RAM.
  3. Domain Name: Itโ€™s best practice to have a domain name pointed to your Linodeโ€™s IP address.
  4. Basic Knowledge of Linux Command Line: Familiarity with SSH and command-line operations will help.

Step-by-Step Installation Guide

Step 1: Access Your Linode Instance

Once your Linode instance is up and running, SSH into it:

ssh root@YOUR_LINODE_IP

Replace YOUR_LINODE_IP with your Linodeโ€™s public IP address.

Step 2: Update the System

Ensure your system is up-to-date with the latest security patches:

sudo apt update && sudo apt upgrade -y

Step 3: Install Dependencies

Forgejo requires several dependencies. Install them with:

sudo apt install -y git redis-server nginx postgresql

Make sure these services are enabled to start on boot:

sudo systemctl enable redis-server
sudo systemctl enable postgresql
sudo systemctl start redis-server
sudo systemctl start postgresql

Step 4: Configure PostgreSQL

Log into PostgreSQL to create a database and user for Forgejo. Use the following commands:

sudo -u postgres psql

Then execute:

CREATE DATABASE forgejo;
CREATE USER forgejo_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE forgejo TO forgejo_user;

Replace your_secure_password with a strong password.

Step 5: Download and Install Forgejo

Now, download Forgejoโ€™s latest version from their official releases page:

wget https://forgejo.org/release/forgejo_latest_linux_amd64.tar.gz
tar -xvzf forgejo_latest_linux_amd64.tar.gz
cd forgejo-*

Step 6: Configure Forgejo

Create a configuration file based on the sample provided:

cp forgejo.sample.toml forgejo.toml

Edit the forgejo.toml file:

nano forgejo.toml

Adjust the following settings:

Step 7: Set Up Nginx

Create a new Nginx configuration file for Forgejo:

sudo nano /etc/nginx/sites-available/forgejo

Add the following configuration:

server {
    listen 80;
    server_name YOUR_DOMAIN;

    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 and restart Nginx:

sudo ln -s /etc/nginx/sites-available/forgejo /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Step 8: Start Forgejo

Finally, start Forgejo with the following command:

./forgejo server

Your Forgejo instance should now be live at http://YOUR_DOMAIN.

Frequently Asked Questions

What are the benefits of self-hosting Forgejo?

Self-hosting Forgejo gives you complete control over your projects and data. You can customize the environment according to your workflow needs, ensuring privacy and security of your repositories. Additionally, you avoid vendor lock-in and have the freedom to modify the software as desired.

Is it difficult to set up Forgejo on Linode?

Setting up Forgejo on Linode is straightforward if you follow the outlined steps. With a foundational understanding of Linux and basic server management, most developers will find the process manageable. Linode also provides excellent documentation and support, which can assist during the setup.

Can I host multiple instances of Forgejo on a single Linode?

While it is technically possible to host multiple instances of Forgejo on the same Linode by configuring different ports and domains, it is not recommended. Doing so can lead to resource competition and reduced performance. Itโ€™s generally better to allocate separate Linode instances for high-availability configurations.

In conclusion, by following this guide, you have successfully set up Forgejo on Linode. This setup allows for a streamlined development workflow while providing the benefits of self-hosting. Embrace the flexibility of Forgejo and enhance your development efficiency today!