Self-host Gitea or Forgejo on a no-KYC VPS
Your own git server with pull requests, issues, wikis, project boards, a package registry (containers, npm, PyPI and more) and Actions CI that reads GitHub workflow files. Sign up with a generated credential, pay with crypto, card or cash, and get full root.
- No email or ID
- Git over SSH on port 222
- Actions CI built in
Which plan fits
Gitea is light. The CI runner and the files you store decide the plan.
- Just you, or a small team
- Core: 2 vCPU, 4 GB, 50 GB. Gitea and PostgreSQL leave most of the memory free for a runner doing tests and linting.
- A team with CI on the same server
- Plus: 4 vCPU, 8 GB, 100 GB. Each Actions job runs in its own container, and compiles or Docker builds compete with Gitea for CPU and memory.
- Heavy builds or parallel jobs
- Max: 6 vCPU, 16 GB, 200 GB. Or keep Gitea on Core and put the runner on a second server.
- Large binaries
- Disk fills before memory does. LFS objects, release files and registry images all sit under /data, so size by storage if you keep them.
Why self-host it
No per-seat fees
Gitea has no user limit and no license fee. Add as many users, organizations and private repositories as the disk holds, and the plan price stays the same.
Lighter than GitLab
Gitea is one Go binary, and its docs say 2 cores and 1 GB of RAM typically cover a small team. GitLab's docs treat 16 GB as the baseline for a single server and 8 GB as the floor where memory is tight.
Your code off GitHub
Private repositories move from GitHub, which Microsoft owns, to a server you control. Delete the originals after the migration and the only copies are the ones you keep.
Install Gitea with PostgreSQL
Docker Compose on Debian 12 or Ubuntu 24.04. Point git.example.com at the server and replace it everywhere below.
# Debian 12 or Ubuntu 24.04, as root
curl -fsSL https://get.docker.com | sh
apt install -y caddy
mkdir -p /opt/gitea && cd /opt/gitea
cat > compose.yml <<'EOF'
services:
gitea:
image: gitea/gitea:latest
restart: unless-stopped
depends_on: [db]
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=change-me
- GITEA__server__ROOT_URL=https://git.example.com/
- GITEA__server__SSH_DOMAIN=git.example.com
- GITEA__server__SSH_PORT=222
- GITEA__service__DISABLE_REGISTRATION=true
volumes: ["./data:/data"]
ports: ["127.0.0.1:3000:3000", "222:22"]
db:
image: postgres:16
restart: unless-stopped
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=change-me
- POSTGRES_DB=gitea
volumes: ["./pg:/var/lib/postgresql/data"]
EOF
docker compose up -d
# HTTPS: Caddy fetches the certificate
cat > /etc/caddy/Caddyfile <<'EOF'
git.example.com {
reverse_proxy localhost:3000
}
EOF
systemctl reload caddy
# Open https://git.example.com and finish the installer.
# Registration is off, so create your admin account in
# the installer's administrator section.
# Forgejo: image codeberg.org/forgejo/forgejo:17 (the
# current major) and FORGEJO__ in place of GITEA__.Add a runner for Actions
Workflows in .gitea/workflows/ or .github/workflows/ run on a separate runner. Create a registration token at /-/admin/actions/runners. On Forgejo, use Forgejo Runner instead: create the runner under /admin/actions/runners and put the UUID and token it shows into the runner's config file, as described in Forgejo's runner docs.
# Jobs run in containers inside the runner's own
# Docker daemon, which is why it needs --privileged.
docker run -d --name gitea-runner --restart unless-stopped \
--privileged \
-e GITEA_INSTANCE_URL=https://git.example.com \
-e GITEA_RUNNER_REGISTRATION_TOKEN=paste-token-here \
-v /opt/gitea-runner:/data \
-v runner-docker:/var/lib/docker \
gitea/runner:6-dind
# The runner shows as Idle on the runners page once it
# has registered. The token is only needed the first time.Move your repositories from GitHub
Gitea's migration tool copies more than the git history when you give it a token.
Create a GitHub token
A personal access token with read access to the repositories you are moving. Private repositories need it, and it keeps you clear of GitHub's API rate limits.
Run New Migration
In Gitea, open the + menu, choose New Migration and GitHub, paste the repository URL and the token, and tick the wiki, labels, milestones, issues, pull requests and releases.
Change your remotes
In each clone: git remote set-url origin ssh://git@git.example.com:222/you/repo.git
Keep GitHub as a mirror
Optional. A push mirror in the repository settings forwards every push to GitHub, so the old URL stays current.
What to watch out for
Two SSH daemons on one server
The server's own sshd keeps port 22 and Gitea answers git on 222. Without SSH_PORT=222, Gitea shows clone URLs without the port and pushes reach the wrong daemon.
Open registration attracts spam
Public instances with sign-ups open are a steady target for spam accounts and repositories. Keep DISABLE_REGISTRATION on and create accounts yourself, or require email confirmation and a captcha.
A runner executes whatever the repository says
The runner above runs privileged. Register it only for repositories whose workflows you trust, and give anything else a separate runner on another server.
Notification mail
Password resets and notifications need SMTP, set in the [mailer] section. Port 25 is open on Blackbox, but mail from a new IP address often lands in spam, so a mail relay is the easier route.
Backups are yours to run
gitea dump writes the repositories, the database and app.ini into one archive. Run it on a schedule and copy the archive off the server.
Private repositories on Blackbox
A git server holds the full history of every private repository and the Actions secrets your workflows deploy with. On Blackbox the CPU encrypts the memory Gitea runs in, and with disk encryption on, the repositories are encrypted at rest with a passphrase only you know.
- Gitea decrypts Actions secrets in memory to hand them to a job. On Blackbox that memory is encrypted, and so is the memory of a runner on the same server while it builds your code.
- With disk encryption on, the repositories, the database and the SECRET_KEY in app.ini sit on a disk only your passphrase opens.
- After each reboot the server waits for that passphrase. You type it over SSH before the system starts.
Plans
| Plan | vCPU | RAM | NVMe | Traffic | Where | Price |
|---|---|---|---|---|---|---|
| Blackbox Core | 2 | 4 GB | 50 GB | 4 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $9.99/mo |
| Blackbox Plus | 4 | 8 GB | 100 GB | 8 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $19.99/mo |
| Blackbox Max | 6 | 16 GB | 200 GB | 16 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $39.99/mo |
| Blackbox Ultra | 8 | 32 GB | 400 GB | 32 TB per 31 days | MontrealAmsterdamNew York City (launch pre-order)Singapore (launch pre-order) | $79.99/mo |
Need a git server in New York City or Singapore before Blackbox opens there? The standard VPS line sells there too, with unmetered bandwidth, no IPv6 and no memory encryption.
Questions
Should I pick Gitea or Forgejo?
Either one runs a personal or team server well. Gitea is MIT licensed and has a company, Gitea Ltd, behind it. Forgejo is governed by its own contributors, and the non-profit Codeberg e.V. holds its domains. It moved to the GPLv3 or later with version 9 in 2024. Forgejo became a hard fork that same year and the code has drifted since: Gitea 1.22 was the last release that upgrades to Forgejo in place. Choose at the start, because switching later means moving repositories one at a time with the migration tool.
How much RAM do I need?
Gitea's own docs say 2 CPU cores and 1 GB of RAM is typically enough for a small team. Blackbox Core, with 2 vCPU and 4 GB, runs Gitea, PostgreSQL and a runner for light CI such as tests and linting. When builds start competing with Gitea for memory, move to Plus with 8 GB or give the runner a server of its own. 4 GB is the smallest plan we sell.
Can I run GitHub Actions workflows here?
Mostly. Gitea Actions is built to be compatible with GitHub Actions and reads the same workflow YAML, and Gitea fetches steps such as actions/checkout from GitHub by default. Forgejo Actions aims to feel familiar without promising compatibility, so expect small edits to workflows there. Jobs need a runner, registered with a token from Site Administration, Actions, Runners. Workflows that call the GitHub API or expect GitHub's hosted machines may need changes.
How do I migrate from GitHub?
Choose New Migration, then GitHub. With a personal access token, Gitea copies the repository along with its wiki, labels, milestones, issues, pull requests and releases. A pull mirror keeps syncing from GitHub instead, but it brings only the code and the wiki. A push mirror works the other way and sends your new commits back to GitHub.
Is it secure to expose to the public internet?
Yes, with the usual care. Serve it over HTTPS, keep open registration off, turn on two-factor authentication for admin accounts and keep the image up to date. Codeberg runs Forgejo publicly for a large community.
Can I use SSH for git push and pull?
Yes. The compose file maps port 222 on the server to the container's SSH daemon and leaves port 22 for logging in to the server itself. Add your public key under Settings, SSH / GPG Keys, then clone with ssh://git@git.example.com:222/you/repo.git.
What about LFS for big files?
Git LFS is built in. Objects go to the server's disk under Gitea's data directory, or to S3-compatible storage if you set the storage options in the [lfs] section of app.ini. LFS files, release downloads and container images in the package registry are what usually fill the disk.
Does Servury log my git traffic?
No. We keep no traffic logs and don't record what you push or pull. Blackbox also runs no agent inside your server. Gitea writes its own logs to your disk, and those are yours to configure.
Guides on this topic
- Why Developers Are Self-Hosting AI Agents and LLMs Instead of Relying on Cloud AI PlatformsWhy developers are moving language models and agents onto their own VPS, keeping prompts, documents, and agent memory private instead of sending them to a...
- Self-Hosted Apps vs SaaS: Why Running Your Own Nextcloud, Vaultwarden, or Pi-hole Beats Trusting a Third PartyWhat changes when you run your own Nextcloud, Vaultwarden, or Pi-hole instead of trusting a SaaS provider, and how an anonymous VPS narrows the last privacy...
- Managed vs Unmanaged VPS: Which Do You Actually Need?Managed means someone else has root. Unmanaged means you do. That decides the price, the privacy, and whether you can call anyone at 3 a.m. This guide helps...
- VPS vs Shared Hosting: When to Switch and Why?Shared hosting is where every site starts, and most stay too long. How to spot the moment you've outgrown it, what improves when you switch to a VPS, and when...