September 08, 2026 · by Alex M.
If you work with source code and want full control over your repositories, Gitea is one of the best open-source solutions available today. Easy to install, fast, and with a modern GitHub-like interface, Gitea runs excellently on a SSD VPS even with modest resources.
In this guide you'll learn how to install Gitea on an Ubuntu 22.04 server, configure it behind an Nginx reverse proxy, and secure it with an SSL certificate — all step by step.
Gitea is a self-hosted Git platform written in Go. It offers:
Unlike GitLab, which requires substantial resources, Gitea is ideal if you choose an entry-level or mid-range NVMe VPS.
Before starting, make sure you have:
git.example.com) with DNS pointing to your VPS IPIf you don't have a server yet, you can pick a 1C VPS from CLIQHOST, perfectly suited for this type of application.
Start by updating packages:
sudo apt update && sudo apt upgrade -y
Install Git and other required dependencies:
sudo apt install -y git wget curl nginx
For security, Gitea should run under a non-root user:
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Gitea' \
--group \
--disabled-password \
--home /home/gitea \
gitea
sudo mkdir -p /var/lib/gitea/{custom,data,log}
sudo chown -R gitea:gitea /var/lib/gitea/
sudo chmod -R 750 /var/lib/gitea/
sudo mkdir /etc/gitea
sudo chown root:gitea /etc/gitea
sudo chmod 770 /etc/gitea
Check the official Gitea download page for the latest stable release, then download the binary:
wget -O /tmp/gitea https://dl.gitea.com/gitea/1.22.0/gitea-1.22.0-linux-amd64
Move the binary and set permissions:
sudo mv /tmp/gitea /usr/local/bin/gitea
sudo chmod 755 /usr/local/bin/gitea
Verify the installation:
gitea --version
Gitea has native SQLite support — no additional installation needed. This is the simplest option.
sudo apt install -y mariadb-server
sudo mysql_secure_installation
Create the database and Gitea user:
sudo mysql -u root -p
CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'secret_password';
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost';
FLUSH PRIVILEGES;
EXIT;
To have Gitea start automatically, create a service file:
sudo nano /etc/systemd/system/gitea.service
File contents:
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target
After=mariadb.service
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=gitea HOME=/home/gitea GITEA_WORK_DIR=/var/lib/gitea
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable gitea
sudo systemctl start gitea
Check status:
sudo systemctl status gitea
Gitea is now running on port 3000 (default).
Create an Nginx virtual host for your domain:
sudo nano /etc/nginx/sites-available/gitea
server {
listen 80;
server_name git.example.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;
}
}
Activate the configuration:
sudo ln -s /etc/nginx/sites-available/gitea /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
Obtain the certificate:
sudo certbot --nginx -d git.example.com
Certbot will automatically modify the Nginx configuration for HTTPS. If you prefer a commercial certificate with extended validation, check out CLIQHOST SSL certificates for different needs.
Open https://git.example.com in your browser. You'll see the Gitea installation page.
| Field | Recommended value |
|---|---|
| Database Type | SQLite3 or MySQL |
| Site Title | Your name |
| Repository Root Path | /var/lib/gitea/data/repositories |
| Git Hooks Path | /var/lib/gitea/data/home |
| HTTP Port | 3000 |
| Application URL | https://git.example.com |
Create the administrator account and complete the installation.
After installation, the configuration file is at /etc/gitea/app.ini. Some useful settings:
[service]
DISABLE_REGISTRATION = true
[mailer]
ENABLED = true
FROM = [email protected]
SMTP_ADDR = smtp.example.com
SMTP_PORT = 587
USER = [email protected]
PASSWD = smtp_password
[repository]
MAX_CREATION_LIMIT = -1
DEFAULT_PUSH_CREATE_PRIVATE = true
After any changes, restart the service:
sudo systemctl restart gitea
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status
From the web interface, go to Settings → Security → Two-Factor Authentication and enable TOTP.
Periodically check official Gitea releases and update the binary:
sudo systemctl stop gitea
sudo wget -O /usr/local/bin/gitea https://dl.gitea.com/gitea/1.22.x/gitea-1.22.x-linux-amd64
sudo chmod 755 /usr/local/bin/gitea
sudo systemctl start gitea
Gitea includes a native backup command:
sudo -u gitea gitea dump -c /etc/gitea/app.ini --tempdir /tmp
This generates a .zip file containing repositories, database, attachments and configuration. Schedule this with a cron job:
sudo crontab -e
0 2 * * * sudo -u gitea gitea dump -c /etc/gitea/app.ini --tempdir /tmp --file /backup/gitea-$(date +\%Y\%m\%d).zip
For a more robust infrastructure with managed backups, CLIQHOST server management can automate this process for you.
| Solution | Min. RAM | Ease of install | Features |
|---|---|---|---|
| Gitea | ~100 MB | ⭐⭐⭐⭐⭐ | Medium |
| GitLab CE | ~4 GB | ⭐⭐ | Advanced |
| Gogs | ~50 MB | ⭐⭐⭐⭐⭐ | Basic |
| Forgejo | ~100 MB | ⭐⭐⭐⭐⭐ | Medium |
Gitea offers the best balance between functionality and resource consumption — perfect for small teams and personal projects that want independence from GitHub or GitLab Cloud.
sudo journalctl -u gitea -n 50 --no-pager
Check permissions on /etc/gitea/app.ini and /var/lib/gitea/.
Make sure Gitea is running on port 3000:
sudo ss -tlnp | grep 3000
Verify that the Gitea SSH port (default 22 or 2222) is open in the firewall and that the SSH key is correctly added to the Gitea account.
Installing Gitea on a Linux VPS is a relatively straightforward process that gives you complete control over your source code without depending on third-party services. With the right setup — Nginx as a reverse proxy, active SSL, automated backups and 2FA — you get a robust and secure Git platform.
If you want to get started quickly, choose an SSD VPS or NVMe VPS from CLIQHOST, optimised for Linux applications. Need help with the setup? Our server management team is available to assist you. Also check out the CLIQHOST blog for more practical technical guides.
Real reviews from customers who trust CLIQHOST for performance, reliability and expert technical support.
"We moved our online shop from a foreign host and the difference is night and day — pages load instantly and support replies in minutes, in Romanian."
"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."
"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."