Your Company's Private Git Server: Gitea on a Saudi VPS in an Hour

Your sensitive code deserves a Git server inside the Kingdom that you own fully. Gitea is lightweight and runs on the entry plan. We install it with Docker, back it up, and run simple CI with Gitea Actions, with no seat fees.
The Direct Answer: Gitea on a Saudi Server Gives You Full Sovereignty Over Your Code
If your company's code is sensitive, or you need data sovereignty inside the Kingdom, or the monthly per-developer seat fees on cloud platforms have worn you out, the answer is hosting your own private Git server. Gitea is an open-source Git platform written in Go, so lightweight it runs smoothly on the smallest server, and it gives you repositories, code review (pull requests), issue tracking, a wiki, and even built-in CI, all on your own infrastructure. Installing it with Docker takes under an hour, and an entry plan (1 vCPU, 2GB RAM, 20GB storage) is enough for a small to mid-size team.
The core difference from cloud platforms: your code stays on a server inside the Kingdom that you fully control, not on foreign servers, and you pay for the server once a year instead of escalating fees for every developer you add. A team of ten developers may cost you hundreds of riyals a month in seat fees on a cloud platform, while the entry plan at 3,450 SAR per year hosts an unlimited number of users and private repositories. In this article we define when self-hosting is worth it, install Gitea with Docker step by step, configure repository backups, run simple CI with Gitea Actions, and calculate the real resource requirements.
When Self-Hosting Is Worth It
Self-hosting is not for everyone, but it becomes the right decision in clear cases:
- Sensitive code or intellectual property: custom systems or algorithms you never want leaving your infrastructure.
- Data sovereignty and compliance: government entities or companies handling data that must stay inside the Kingdom.
- Seat cost: a large team whose monthly seat cost multiplies with every hire.
- Internal integration: a need to wire Git into your internal infrastructure and custom systems with full freedom.
On the other hand, if your team is very small, your projects are open source, and you want no maintenance burden, free cloud platforms may be enough. The decision is a balance between sovereignty and control on one side, and the responsibility of maintenance and backups on the other.
Installing Gitea with Docker Step by Step
On a new Linux cloud server, the steps are short and clear:
1. Install Docker and Docker Compose
Docker is the cleanest way, because it isolates Gitea and its database in containers, and eases upgrades and copying. Install Docker and the Compose plugin from the distribution's official repositories.
2. Write a docker-compose File
Create a project folder and inside it a compose file defining two services: the gitea service itself, and a database service (PostgreSQL is recommended for production over SQLite for larger teams). The important points in the file:
| Setting | Its job |
|---|---|
| volumes: ./gitea-data:/data | Keeps repositories and config outside the container so they survive upgrades |
| ports: 3000:3000 | The web interface port |
| ports: 222:22 | The SSH port for push and pull |
| environment DB_TYPE | Database type and connection details |
| restart: always | Restarts the container after any crash or boot |
3. Run and Complete the Setup
Run docker compose up -d and the containers come up. Open the browser to your server's IP and port 3000, and the initial setup screen appears: set the database type, the site URL, and create the first admin account. The important rule: the first account you register becomes the admin, so create it immediately before anyone else reaches it.
4. Secure Access
Do not leave your interface exposed unprotected: put Gitea behind a reverse proxy (Nginx or Caddy) with a free TLS certificate from Let's Encrypt to encrypt the connection, enable a firewall that opens only the web and SSH ports, and disable self-registration if you want an internal repository closed to your team.
Backing Up the Repositories
All your data is in the data folder bound to the container, and that is what you back up. Gitea provides a built-in backup command gitea dump that gathers the repositories, database, and config into one compressed file. The practical strategy: a scheduled task (cron) runs the command daily, then moves the output to isolated storage. Remember the golden rule: a copy on the same server is not enough protection, the real copy is isolated off it. Enable a daily backup with 7-day retention for 800 SAR per year as a server add-on, and you get an automated line of defense against losing your code even if the server fails entirely.
Simple CI with Gitea Actions
A strong feature is that Gitea supports Actions in a format largely compatible with GitHub workflows, so you write a YAML workflow file inside your repository and it runs automatically on every push. You need to run a runner (the job executor) and connect it to your Gitea instance. Practical examples for a small team:
- Quality checks on every push: running tests and a linter automatically, so broken code is not merged.
- Build and deploy: building assets then deploying them to the production server on merge to the main branch.
- Building Docker images: generating the container image and pushing it to an internal registry.
Because the runner runs on your server, the entire CI cycle stays inside your infrastructure, with no code leaking to external services, and no paid monthly minute limits. If heavy CI jobs strain the entry plan, upgrade by adding modest resources: +1 vCPU for 500 SAR or +2GB RAM for 600 SAR per year, with no move to a new server.
Migrating From GitHub or GitLab
You do not have to start from scratch. Gitea provides a built-in import tool that moves a full repository from another platform with its history: all branches, tags, and releases, along with issues and pull requests if you want. You give it the original repository's URL and an access token, and it pulls everything at once. For teams moving dozens of repositories, the migration can be automated through Gitea's API in a single script instead of moving repository by repository manually.
Mirroring as a Safe Transition Step
If you are not ready for a full cutover from your current platform, enable mirroring: the original repository stays on the old platform, and Gitea copies it automatically at an interval you set. This gives you a sovereign copy inside the Kingdom that updates itself, while your team continues on the old platform until your confidence in the move is complete. You can reverse the direction too: make Gitea the origin, and push a mirror to an external platform as an extra copy. The flexibility is total because you own both ends.
The Real Resource Requirements
Gitea is exceptionally lightweight compared to heavy alternatives, being a single Go binary with no bloated dependencies:
| Load | Sufficient resources | Plan |
|---|---|---|
| Small team, Gitea only | 1 vCPU, 2GB RAM | Entry (3,450 SAR/yr) |
| Mid team + light CI | 2 vCPU, 4GB RAM | Growth (6,900 SAR/yr) |
| Larger team + heavy CI | 4 vCPU, 8GB RAM | Business (11,500 SAR/yr) |
The bottom line: Gitea itself runs comfortably on the entry plan for a team of up to dozens of developers as long as CI is light. The bigger load comes from heavy CI jobs (frequent builds, long tests), and then you upgrade by adding resources only. Activation is automatic within seconds after payment on Riyadh servers at roughly 8ms latency, which means fast push and pull for your team inside the Kingdom.
A Practical Conclusion
To build your company's private Git server:
- Settle the need: sensitive code, data sovereignty, or saving seat fees means self-hosting is worth it.
- Install Gitea with Docker Compose on the entry plan, and secure it behind a reverse proxy with TLS.
- Enable gitea dump daily via cron, with an isolated daily backup for 800 SAR.
- Run CI with Gitea Actions inside your infrastructure, and upgrade resources only when the load grows.
To run Gitea with dedicated resources and full root inside the Kingdom, check the pricing and plans and start with the entry plan, it covers most teams and scales by adding resources when needed.


