Gitea is a lightweight, open-source Git service written in Go: repositories, pull requests, issues, wikis, packages and a GitHub Actions–compatible CI system, all in a single binary. Hosting it on your own VPS gives you private repositories without per-user fees, your code on a server you control, and fast clones from India. This guide sets up a production-ready instance.
What You Need
- A VPS with Docker and Docker Compose (see our Docker guide).
- A domain or subdomain, for example
git.example.com, pointing to the server. - Nginx and Certbot for HTTPS (see our Let's Encrypt guide).
Step 1: Docker Compose
# /srv/gitea/docker-compose.yml
services:
gitea:
image: gitea/gitea:1 # pin to a specific version in production
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=db:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=${DB_PASSWORD}
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "127.0.0.1:3000:3000"
- "2222:22"
depends_on: [db]
restart: unless-stopped
db:
image: postgres:16
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=gitea
volumes:
- ./postgres:/var/lib/postgresql/data
restart: unless-stopped
cd /srv/gitea
echo "DB_PASSWORD=$(openssl rand -hex 24)" > .env
chmod 600 .env
docker compose up -d
The web port is bound to localhost so only Nginx can reach it. Port 2222 is published for Git over SSH; allow it in the firewall with sudo ufw allow 2222/tcp. Docker-published ports bypass UFW, so publishing the web port on localhost matters.
Step 2: Nginx and HTTPS
server {
listen 80;
server_name git.example.com;
client_max_body_size 512m; # large pushes and release uploads
location / {
proxy_pass http://127.0.0.1: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;
}
}
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d git.example.com
Step 3: First-Run Configuration
Open https://git.example.com. In the installer:
- Server domain:
git.example.com - Gitea base URL:
https://git.example.com/ - SSH server port:
2222(the port users connect to, so clone URLs are correct) - Disable self-registration unless you want anyone to create accounts.
- Create the administrator account.
Settings are stored in data/gitea/conf/app.ini. You can also set any option through GITEA__section__KEY environment variables in the Compose file.
Step 4: Lock It Down
- Keep registration disabled and create accounts as admin, or require email confirmation and admin approval.
- Set new repositories to private by default (
[repository] DEFAULT_PRIVATE = private). - Require two-factor authentication for administrators.
- Restrict
REQUIRE_SIGNIN_VIEW = trueunder[service]if nothing should be visible without logging in. - Keep the server's SSH (port 22) for administration with keys only; Gitea's SSH on 2222 is only for Git.
Step 5: Clone and Push
Users add their public SSH keys under Settings → SSH/GPG Keys, then:
git clone ssh://git@git.example.com:2222/team/project.git
# or over HTTPS with a personal access token
git clone https://git.example.com/team/project.git
To migrate existing repositories, use "New Migration", which imports from GitHub, GitLab and others, including issues and pull requests where supported.
Step 6: CI with Gitea Actions
Gitea Actions uses workflow files compatible with GitHub Actions syntax in .gitea/workflows/. Jobs run on a separate runner, act_runner:
- Enable Actions in the site administration if it is not already enabled for your version.
- Create a runner registration token in the admin panel.
- Run
act_runner(as a container or binary) on the same or, better, a separate server, and register it with the token.
CI jobs can use much more CPU and memory than Gitea itself, and they run code from your repositories, so a separate runner server keeps builds from slowing Git operations and limits the impact of a malicious build script.
Step 7: Backups
Gitea's dump command creates an archive of repositories, configuration and a database dump:
docker compose exec -u git gitea gitea dump -c /data/gitea/conf/app.ini --file /data/gitea-dump.zip
mv data/gitea-dump.zip /var/backups/gitea-$(date +%F).zip
Run it nightly from cron (see our cron guide), copy archives off the server, keep several days, and test restoring to a staging server. Alternatively, stop the stack briefly and archive the data and postgres directories together with a PostgreSQL dump.
Features Worth Enabling
- Branch protection: require pull requests and passing checks before merging to the main branch.
- Package registry: Gitea can host container images and packages for npm, PyPI, Maven, Composer and others, so private packages live next to their code.
- Mirrors: push mirrors keep an off-site copy on another Git host; pull mirrors track upstream open-source projects.
- Webhooks: notify chat tools or trigger deployments on push.
- Organisations and teams: grant repository access by team rather than per user.
Step 8: Upgrades
Read the release notes, back up, change the image tag, then:
docker compose pull && docker compose up -d
docker compose logs -f gitea
Gitea migrates its database automatically on start. Upgrade one major version at a time if the release notes ask you to.
SkyRainCloud Plans for This Workload
Gitea itself is light: a small team's repositories run comfortably on the 2 vCore / 8 GB tier. Add vCores and RAM if the same server runs Gitea Actions jobs, which use far more resources than Git hosting.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.
Frequently Asked Questions
What is Gitea?
How much RAM does Gitea need?
Why use port 2222 for Git over SSH?
Can Gitea run GitHub Actions workflows?
act_runner. Many marketplace actions work, but check those that depend on GitHub-specific features.How do I stop strangers from signing up?
app.ini, and create accounts as an administrator.How do I back up Gitea?
gitea dump nightly, copy the archive off-site and test restores. It includes repositories, configuration and the database.