Install Gitea, the self-hosted Git service, on your own VPS with Claude Code: PostgreSQL in Docker, HTTPS on your domain, a runner for Gitea Actions, and nightly backups restored once. Ten prompts and a starter kit tested on Docker.
What you build
| Part | What it is | What it does |
|---|---|---|
| Brain | Claude Code on your computer | Drives the VPS over SSH, shows every changing command and waits for your yes |
| Server | Your VPS with Docker and ufw | Only SSH and git over SSH (222) open; the web port stays on 127.0.0.1 |
| Memory | Gitea 28.4.0 and PostgreSQL 18 | Repositories, pull requests, issues, wiki and packages, on your disk |
| Front door | HTTPS via Cloudflare Tunnel or Caddy | Your domain with a certificate; the installer was only ever reached through a tunnel |
| Hands | Gitea Runner (5-dind) | Runs Gitea Actions jobs in its own Docker, away from the host |
| Safety net | backup.sh, restore.sh, a nightly cron | Database dump plus data folder, restored once on your own computer |
Where this comes from
Gitea is an open source, MIT-licensed Git service: repositories, pull requests, issues, a wiki per project, a package registry and CI/CD, in one Go program. It is built by the Gitea community (about.gitea.com, go-gitea/gitea). This pack does not change Gitea. It installs it the way the official Docker docs describe, then adds the parts a real server needs: a closed web port, HTTPS, a runner, and backups you have actually restored.
What you build
Your code ends up on a server you rent or own, at an address on your own domain, with no per-user fee. Claude Code does the typing over SSH; you approve every command that changes the server.
The one thing it deliberately does not do: open the Gitea installer to the internet. Whoever reaches that page first creates the admin, so you open it through an SSH tunnel from your own computer, and port 3000 stays on 127.0.0.1 for good. Prompt 09 checks that from the outside.
It also leaves out email sending, LDAP and SSO, Kubernetes and high availability. One server, done properly.
Do you need this? Be honest first
Yes, if you keep client code, course material or automations in Git and want them on a machine you control, or if you want your own CI runner instead of renting minutes.
No, if you are happy on GitHub and do not want to own a server's updates and backups. Gitea is light, but a server you never look at is still a server you are responsible for. If that sounds like a chore, stay where you are.
What you need
- The machine. Any laptop for Claude Code, plus a VPS with Ubuntu or Debian, at least 2 GB of memory and 20 GB of free disk. A spare Linux box at home works if SSH can reach it.
- The accounts. Claude Code (Pro, Max or Team, or an API key). A domain you control. GitHub only if you want to mirror a repository.
- The time. About two hours of prompts over one or two evenings, plus 30 to 45 minutes of machine setup.
What is in the zip
gitea-on-your-vps/
README.md the lesson: what you build, hosting, the rule that never bends
index.html the clickable guide: setup steps, ten prompts, copy buttons, progress bar
COSTS.md every cost, with the date it was read
CREDITS.md sources, and what was verified and what was not
DISCLAIMER.md as is, no warranty, use at your own risk
paths/ clean-machine setup for Windows (WSL2), Mac and Linux
prompts/ 00 project brief to 09 smoke check and handover
starter/ docker-compose.yml, .env.example, backup.sh, restore.sh,
runner/ and workflows/hello.yaml
What was verified and what was not
The starter kit ran on Docker (Docker 29.9.2): Gitea 28.4.0 and PostgreSQL 18 started, the installer came up with the database and SSH port already filled in, a pushed repository worked, the runner registered and turned the hello workflow green, backup.sh produced a database dump and a data archive, and restore.sh brought both back in an empty folder. The first restore.sh failed on that run, and the shipped one is the fixed version. The guide passed a browser check, every file was scanned for keys and private data, and two review passes by a second model were applied.
Not verified: the ten prompts run in order on a real VPS, the firewall and SSH steps on a real server, both HTTPS routes, the GitHub mirror, and the cron line. The pack ships as is, as a proof of concept, with no guarantee. When something breaks, paste the full error into Claude Code and ask it to fix it, then post what broke in the community.
Read the prompt before you run it
Hand each prompt to Claude first and ask what it plans to do on your server. Compare that with the prompt. A prompt costs a minute to fix. A wrong command on a live server costs an evening.



