What You Need
- A VPS with 1 GB RAM (Gitea sips resources)
- Ubuntu 22.04 or 24.04 with SSH
- A domain or subdomain pointed at the server
Step 1: Install Docker
curl -fsSL https://get.docker.com | shStep 2: Compose with Caddy HTTPS
Save as docker-compose.yml. This runs Gitea with SQLite (fine for a personal or small-team instance) and Caddy for automatic certificates:
services:
gitea:
image: gitea/gitea:latest
restart: always
environment:
- GITEA__server__DOMAIN=git.example.com
- GITEA__server__ROOT_URL=https://git.example.com/
- GITEA__server__SSH_DOMAIN=git.example.com
volumes:
- gitea:/data
ports:
- "2222:22"
caddy:
image: caddy:2-alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
depends_on:
- gitea
volumes:
gitea:
caddy_data:Note Gitea's SSH is mapped to host port 2222 so it does not collide with your own SSH on port 22.
Step 3: The Caddyfile
git.example.com {
reverse_proxy gitea:3000
}Bring it up:
docker compose up -dStep 4: First-Run Setup
Open https://git.example.com and complete the install screen. The database is SQLite (already configured), so just set your admin account. Then — and this matters — go to Site Administration and disable open registration unless you want the public signing up:
Set "Disable Self-Registration" and require admin approval for new users.Step 5: Clone Over SSH
Add your public key in Gitea under Settings → SSH Keys, then clone using the mapped port:
git clone ssh://[email protected]:2222/youruser/yourrepo.gitgitea volume. A tar of /data plus your SQLite file is your whole server — off-site copy it with rclone and you can rebuild anywhere in minutes.What It Costs
Gitea is one of the lightest useful things you can self-host, so the Micro plan (1 vCPU, 1 GB) runs a personal or small-team instance comfortably. On NoctHost that is a couple of dollars a month, billed hourly from a prepaid balance you top up with crypto — no card and no KYC, which suits keeping private repositories genuinely private.