← Back to Blog
How to Self-Host Gitea on a VPS (2026)
GitHub is great until it isn't — private repo limits, rate limits, or just the unease of having someone else hold all your code. Gitea is a lightweight self-hosted Git service that gives you the GitHub experience on your own hardware. It runs on a $5 VPS without breaking a sweat.
⚡ Deploy a VPS from $5/mo — Use code LAUNCH2026 for 50% offWhat You Need
- A VPS running Ubuntu 24.04 (1GB RAM is plenty)
- SSH access and about 10 minutes
If you are on Galaxy Cloud Solutions, use the one-click Gitea installer in your dashboard and skip straight to the configuration step.
Step 1: Create a Dedicated User
sudo adduser --system --shell /bin/bash --group --disabled-password --home /home/git git
Step 2: Download Gitea
GITEA_VER=$(curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d v)
sudo wget -O /usr/local/bin/gitea https://github.com/go-gitea/gitea/releases/download/v${GITEA_VER}/gitea-${GITEA_VER}-linux-amd64
sudo chmod +x /usr/local/bin/gitea
Step 3: Set Up Directories
sudo mkdir -p /var/lib/gitea/{custom,data,log} /etc/gitea
sudo chown -R git:git /var/lib/gitea /etc/gitea
sudo chmod 750 /etc/gitea
Step 4: Create the Systemd Service
sudo tee /etc/systemd/system/gitea.service << EOF
[Unit]
Description=Gitea
After=network.target
[Service]
User=git
WorkingDirectory=/var/lib/gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now gitea
Step 5: Access the Setup Wizard
Gitea runs on port 3000. Use an SSH tunnel to access it from your browser:
ssh -p YOUR_SSH_PORT -L 3000:localhost:3000 [email protected]
Open http://localhost:3000 — Gitea walks you through initial setup. SQLite works fine for personal use.
What You Get
- Unlimited private repositories
- Issues, pull requests, and project boards
- Built-in CI/CD with Gitea Actions
- Webhooks, API access, and OAuth
- Runs on 256MB RAM if you need to go lean
One-click Gitea installer included
Deploy a VPS, click install, and your Git server is running in under a minute. Plans start at $5/mo.
Get Started