Run your own Git server with Gitea. Docker Compose setup, SSH key authentication, mirroring GitHub repos, CI/CD with Gitea Actions, and resource usage on low-power hardware.
Git is the engine of modern software development, but you don't need to rely on a third-party platform for your private repositories. Gitea is a lightweight, painless way to bring that power in-house. This guide will walk you through deploying your own feature-rich, self-hosted Git server using Docker, tailored for the resource-conscious home lab.

Gitea is a community-driven, open-source Git hosting service written in Go. Think of it as a self-contained alternative to GitHub, GitLab, or Bitbucket that you can run on your own hardware. It provides a familiar web interface for repository management, issue tracking, pull requests, wikis, and more.
Self-hosting Gitea offers several compelling advantages, especially for the home server enthusiast:
For a home server focused on low power consumption, Gitea is an ideal candidate. Its single binary, Go-based architecture is inherently efficient, requiring minimal CPU and memory overhead compared to heavier alternatives like GitLab.

Before proceeding, ensure your system meets the following requirements:
git.yourhomeserver.net) or local DNS entry pointing to your server's IP. For purely local use, you can use the server's IP address.nano or vim, and managing Linux services.80 (HTTP), 443 (HTTPS), and 22 (SSH - optional, see configuration) on your server are accessible from your network.
We'll use Docker Compose to manage Gitea and its database (SQLite for simplicity, or PostgreSQL for heavier use). This method isolates the service and simplifies updates and backups.
First, create a dedicated directory and the docker-compose.yml file.
mkdir -p ~/docker/gitea
cd ~/docker/gitea
nano docker-compose.yml
Paste the following complete configuration. This setup uses SQLite for ease, binds-mounts for data persistence, and includes a reverse proxy (Caddy) for automatic HTTPS. Replace all placeholder values (your-user, your-password-here, git.yourdomain.com) with your own.
version: '3.8'
services:
caddy:
image: caddy:2-alpine
container_name: gitea_caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "2222:22" # Maps host port 2222 to container port 22 for SSH.
environment:
- CADDY_INGRESS_NETWORKS=gitea_network
volumes:
- ./caddy_data:/data
- ./caddy_config:/config
- ./Caddyfile:/etc/caddy/Caddyfile:ro
networks:
- gitea_network
server:
image: gitea/gitea:latest
container_name: gitea_server
restart: unless-stopped
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=sqlite3
- GITEA__database__PATH=/data/gitea/gitea.db
- GITEA__server__DOMAIN=git.yourdomain.com
- GITEA__server__SSH_PORT=22
- GITEA__server__SSH_LISTEN_PORT=22
- GITEA__server__ROOT_URL=https://git.yourdomain.com
volumes:
- ./gitea_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /home/your-user/.ssh/authorized_keys:/data/git/.ssh/authorized_keys:ro # For SSH key passthrough
networks:
- gitea_network
depends_on:
- caddy
networks:
gitea_network:
external: false
Next, create the Caddyfile for the reverse proxy configuration:
nano Caddyfile
git.yourdomain.com {
log {
output file /data/access.log
}
reverse_proxy server:3000
}
Finally, create the necessary directories and start the stack:
mkdir -p gitea_data caddy_data caddy_config
sudo docker compose up -d
The services will start. Gitea will be available shortly at http://git.yourdomain.com (or your server's IP). The first visit will trigger the initial configuration wizard.
The web-based installation wizard appears on first launch. Here are the key settings:
SQLite3, /data/gitea/gitea.db). Our Docker Compose file already configured this via environment variables./data/git/repositories (default, inside the container).22 (default, but note: the SSH traffic is routed through the Caddy container on host port 2222).3000 (default).git.yourdomain.com (must match your ROOT_URL).git.yourdomain.com.2222 (This is the host port you expose to the outside world. Crucial for correct git clone URLs).https://git.yourdomain.com.admin as the username for security. Use a strong password.After clicking "Install Gitea," you'll be logged in and ready to go.
Gitea packs a surprising number of features. Let's break down the most useful ones.
Creating and cloning repositories works exactly like GitHub. You can make them public, private, or internal (visible to all logged-in users). The web interface provides a rich code viewer, file editor, and commit history browser.
To push/pull code via SSH (on port 2222), add your public SSH key.
cat ~/.ssh/id_ed25519.pub) and give it a title.git clone ssh://git@git.yourdomain.com:2222/username/repo-name.git
This killer feature lets you create a local, synchronized copy of a repository from GitHub, GitLab, etc.
https://github.com/go-gitea/gitea.git).These collaborative tools function nearly identically to their GitHub counterparts. You can manage milestones, labels, assignees, and templates. Wikis use Markdown and are a great place for project documentation.
Gitea has a built-in CI/CD system compatible with GitHub Actions syntax. To enable it:
act_runner as a service. Create a runner token in the admin panel, then deploy the runner (simplest via Docker). See the official documentation for detailed setup..gitea/workflows/build.yaml (or .github/workflows/...) file in your repository to define your pipeline (e.g., build with Go, deploy via SSH).Gitea can act as a private registry for various package types, a fantastic feature for homelab development.
docker push git.yourdomain.com/username/project/image:tag).Gitea's efficiency makes it an excellent fit for low-power servers like the Intel N100 mini-PCs or Raspberry Pi 5. Below is a realistic snapshot of resource usage under typical loads (5-10 users, ~50 repositories, periodic Actions runs).
| Hardware Platform | Idle RAM Usage | Load RAM Usage (5 concurrent clones) | CPU Usage (Peak during Action) | Notes |
|---|---|---|---|---|
| Intel N100 (16GB RAM) | ~120 MB | ~250 MB | 15-25% per core | Effortless. SQLite is fine for this scale. |
| Raspberry Pi 5 (8GB RAM) | ~180 MB | ~300 MB | 35-50% per core | Very capable. Use a fast SSD/USB 3 drive for gitea_data. |
| Raspberry Pi 4 (4GB RAM) | ~150 MB | ~280 MB | 60-80% per core | Still viable for personal/small team use. |
Key Takeaways:
act_runner consumes additional resources only when a workflow is executing. You can limit its parallelism in the runner config to avoid overwhelming your system../gitea_data volume. Regularly back it up.
# Simple backup script (run via cron)
cd ~/docker/gitea
tar -czf /path/to/backups/gitea-backup-$(date +%s).tar.gz gitea_data/
fail2ban on your host and configure a jail for Gitea to block brute-force attacks.act_runner on a different machine or as a separate container with resource limits (docker compose deploy.resources) to isolate CI/CD workload from the main Gitea service.USER_UID and USER_GID in your docker-compose.yml match your host user's IDs (check with id -u and id -g).2222. Your clone URL must be ssh://git@git.yourdomain.com:2222/.... Check the SSH Port setting in Administration > Settings > General.docker compose restart server) can help. Consider adding -e GITEA__performance__ENABLED=true to environment variables for more aggressive GC.3000.Gitea delivers a powerful, professional-grade Git hosting experience with a fraction of the resource footprint of its competitors. For the home server enthusiast, it represents the perfect sweet spot: it’s lightweight enough to run silently on a Raspberry Pi in a closet, yet robust enough to handle serious collaborative development, complete with modern CI/CD.
By following this guide, you’ve not only gained control over your code but also built a cornerstone for a wider self-hosted development ecosystem. From here, you can integrate it with your Docker registry, continuous deployment pipelines, and project management tools, all within the privacy and limits of your own network. The power—and now the repository—is in your hands.

Use Cases
Go paperless with Paperless-ngx on your home server. Docker Compose installation, scanner integration, OCR configuration, auto-tagging rules, and mobile app setup.
Use Cases
Self-host Bitwarden with Vaultwarden on your home server. Docker Compose setup, HTTPS with Nginx Proxy Manager, Tailscale remote access, and family sharing configuration.
Use Cases
Replace Google Photos with Immich on your home server. Complete Docker Compose setup on Intel N100, machine learning face recognition, mobile app configuration, and backup automation.
Check out our build guides to get started with hardware.
View Build Guides