How to Host GitLab on a VPS: Requirements and Planning
In this article9 sections
Self-hosting GitLab gives your team control over its repositories, users and deployment environment, but the server needs more than enough disk space for Git. GitLab includes a database, background jobs, web services and repository storage, and continuous integration can add a separate, heavy workload. Size the machine for the way your team will use it, then budget time for backups and upgrades.
This guide helps you decide whether GitLab belongs on a VPS, how to read its current requirements, and what to prepare before installation. If you are comparing a managed installation with an unmanaged server, see Siteharbour GitLab VPS hosting and review the provider’s current plan details before choosing.
First decide whether self-managed GitLab fits
GitLab.com removes server administration from your team. A self-managed installation may be appropriate when you have a specific data residency requirement, need to control the network or version, or want to integrate GitLab tightly with internal systems. It also makes your team responsible for availability, upgrades, monitoring and recovery.
For a personal code archive or a short-lived lab, a small community alternative may be simpler. For a team that depends on merge requests, CI jobs and issue history, compare the cost of self-hosting with the time required to maintain a production service. A low monthly server price does not include incident response or restore testing.
Use GitLab’s current requirements as the baseline
GitLab’s hardware recommendations change with releases and deployment size. Its current installation requirements list a single-node baseline of 8 vCPU and 16 GB RAM, while memory-constrained environments may run with at least 8 GB. Treat that lower figure as a constrained floor, not a general production target. Check the current GitLab requirements and sizing guide before purchasing a server.
Disk needs depend heavily on repositories, package registries, CI artifacts, uploads and logs. Reserve enough fast SSD storage for the application and leave room for growth and backups. Git repositories can expand quickly when teams commit build outputs or large assets; use Git LFS or an artifact store when appropriate instead of letting repository history grow without a plan.
There is no reliable way to size a GitLab VPS from the number of accounts alone. The count of active users, number of repositories, CI concurrency, artifact retention and request rate all matter. If you cannot estimate them yet, start with a pilot that resembles normal team work and measure memory, CPU, disk I/O and response times.
Do not put CI runners on the application budget by accident
The GitLab application and GitLab Runner do different work. The application stores repositories and coordinates pipelines; runners execute build and test jobs. A single machine can host both for a small lab, but a busy test suite can consume CPU, RAM and disk that the GitLab web interface needs.
For production use, decide whether runners will live on separate machines. Isolating them makes it easier to control job load and limit the effect of a pipeline that fills the disk or uses all available CPU. It also gives you a cleaner path to add runner capacity without moving the GitLab application and repository storage.
Prepare the server before installation
- Choose a supported operating system. Follow GitLab’s official installation guide for the current Linux package and confirm that the distribution release is supported.
- Set a static public address and DNS record. GitLab needs a stable external URL for clone links, callbacks and notifications. Point the intended hostname to the server before requesting a certificate.
- Restrict inbound traffic. Open only SSH and the HTTP/HTTPS ports required for your setup. Limit SSH to an administrative network or VPN where possible.
- Set up HTTPS. Use a valid certificate for the chosen hostname and keep renewal monitoring in place. Internal Git service does not mean that passwords and tokens should travel over plain HTTP.
- Separate system data and backups. Track available storage on the GitLab data volume and send backups to a different machine or object-storage location.
- Set an upgrade owner and schedule. Read the version upgrade path before installing updates. Keep a maintenance window and a recovery plan for changes that require intermediate versions.
For general Ubuntu server preparation and SSH hardening, use the VPS security checklist before opening a new service to the internet.
Back up more than the repositories
GitLab’s application backup covers its data according to the installation method, but your recovery plan also needs configuration and secrets. Keep copies of the configuration files and encryption secrets in a separate, protected location. If you lose the secrets file, some encrypted data or account secrets may no longer be usable even if the main backup is intact.
Back up on a schedule that matches how much work the team can afford to lose. Keep the copy outside the VPS, set a retention period, and run a restore on a separate instance before calling the backup strategy complete. A file that has never been restored is not a tested recovery plan. GitLab documents the process in its backup guidance.
Include enough free disk space for backup creation. The archive may temporarily need substantial space, particularly on an instance with large repositories or artifacts. Monitor backup jobs and alert on failures rather than assuming a cron job completed successfully.
Secure the first login and keep access narrow
- Use named user accounts and enable multi-factor authentication for administrators.
- Remove public sign-up if the instance is private to your organization.
- Use least-privilege roles for projects, groups and runner tokens.
- Store CI variables as protected and masked values, and avoid printing secrets in job logs.
- Keep SSH keys, certificates and GitLab’s encryption secrets out of the repository and routine support tickets.
- Apply security updates and review GitLab’s advisories for the edition and version you run.
GitLab may store deploy keys, CI credentials and package artifacts that grant access to other systems. Treat the instance as part of your production security boundary, not as a disposable developer tool.
When to add resources or split services
Look at metrics during both ordinary use and the busiest CI window. A slow repository clone can point to storage or network throughput; a sluggish web interface under pipeline load may point to resource contention between runners and the application. Keep a small baseline of CPU, memory, disk use and job duration so a scale-up is based on a trend rather than a single incident.
As repositories, users and CI usage grow, consider moving runners to separate hosts, increasing SSD capacity, and reviewing GitLab’s reference architectures. High availability is a separate design with database and repository components; it is not achieved by adding a second generic VPS without planning how data and traffic are handled.
When a GitLab VPS is the right choice
A self-managed VPS works best when someone on the team can own Linux administration or when the provider’s setup and support scope covers the tasks you need. If GitLab is business-critical, confirm the plan meets GitLab’s current CPU, memory and storage baseline, and ask who handles the operating system, application upgrades, backups and restore requests.
See the GitLab VPS service for the available setup, or compare Siteharbour VPS plans if you plan to install and maintain GitLab yourself. Before ordering, share an estimate of active users, repository size and CI concurrency so the server can be sized to the workload.
Frequently asked questions
How much RAM does GitLab need on a VPS?
GitLab’s requirements depend on workload and version. The current single-node baseline is higher than the memory-constrained floor, so use the official requirements and sizing guidance for a production decision. CI runners and artifact processing can add load on top of the application.
Can I run GitLab and its runners on the same VPS?
For a small lab, you can combine them, but pipeline jobs compete with the GitLab application for CPU, memory and disk. Separate runners when job load is significant or when you need stronger isolation.
Is a GitLab backup enough to restore the service?
Not by itself in every setup. Keep GitLab’s configuration and secrets as well as application data, store copies off-server and test a restore on a separate instance.
Should I use GitLab.com or self-host GitLab?
Use the hosted service if you want GitLab to manage the infrastructure. Self-host when you need the control and are prepared to maintain the server, upgrades, access, monitoring and recovery process.