4.8 article rate

  • Created: Dec 22, 2022
  • 5 min read

How Do We Save about ~$10,000 a Year Using Self-Hosted GitLab

Self-Hosted GitLab CE vs GitLab Premium

GitLab is a powerful, open-source code management platform that offers different subscription types. Although there is a free version that is open to everyone, the premium version has additional features and support.

Like other IT companies, we always look for ways to optimize costs and improve efficiency. This blog post will describe how we moved to Self-Hosted GitLab and saved about ~$10,000 a year for a client.

Moving from GitLab CE to GitLab Premium

In October 2022, GitLab changed its subscription model. There are three types of subscriptions: 

  • Free
  • Premium—$19 per user/month
  • Ultimate—$99 per user/month.

So, switching to a paid subscription or looking for alternatives became necessary in large teams and projects.

The free plan supports up to 5 users in a project or group and is unsuitable for us. It is possible to deploy our self-hosted GitLab CE, but this will require infrastructure and support costs.

In one of our projects, all the binding in the form of CI and environments had already been made for the specifics of GitLab, and the number of repositories numbered several dozen. First, we looked at the proposals of GitLab so as not to waste time on pipelines. Moreover, we had to consider that the total number of users in the project is ~64.

The free plan supports up to 5 users in a project or group and is not suitable for us. It is possible to deploy our self-hosted GitLab CE, but this will require infrastructure and support costs.

Let’s do the simple math.

If we buy a Premium subscription: 64 users * $19 = $1216 per month or $14 592 per year (Subscriptions must be purchased immediately for one year).

And if we raise our GitLab in AWS (the cost in GCP is about the same):

  • The minimum recommendation for a self-hosted instance for a service of up to 500 users is 4 CPU 8 Mem, which is ~$130 per month;
  • 200Gb drive with daily snapshots up to 14 days is ~$26 per month;
  • RDS database with daily snapshots storage for up to 10 days is ~$50 per month;
  • S3 bucket for storing caches and artifacts is ~$1 per month.
  • Total: ~$207 per month.

NB: Here, we consider only the main GitLab service without runners because their value in all cases is constant.

After the calculations, we presented the results to the customer and discussed the obvious benefit of $1K per month. We also separately drew attention to the need to support and regularly update our own GitLab CE. We added about ~6 hours a month for support and started moving.

When it comes to IT, there are a number of strategies and best practices you can adopt to help achieve optimized cost goals. In our blog post, we explore some top ways to optimize IT costs.


Using Terraform, we created a network, storage, S3, instance, and RDS in the cloud. This is our favorite IaC (Infrastructure as Code) approach, which makes it convenient to manage the infrastructure and, if necessary, reuse the finished code.

As a VM image, we used the official GitLab CE AMI (Amazon Machine Image)—an image that is updated and maintained by GitLab itself. And for us to update the GitLab version and not be afraid that the instance will break, we used the ASG (Auto Scaling Group) with the Launch template, to which we transferred the AMI image, instance type, disk configuration, etc.

Moreover, we used a small bash script in User Data to automatically reconfigure and roll our data and configs. It runs immediately after creating the instance, checks the availability of the allocated IP address and storage with data and configuration, and subsequently reconfigures the new model into “our” GitLab.

So, “Our” GitLab is configured and tested. Next, we must migrate users and repositories from SaaS GitLab to self-hosted GitLab.

If you're like most people, you're always looking for ways to save money. One of the options is to use cloud services. Cloud cost optimization is a hot topic these days, learn more about it in our new article.


To avoid violating the deadlines and not interfering with the developers themselves, it was necessary to agree on and draw up a plan to migrate repositories. For the convenience of user migration, we added Google OAuth with authorization in our Google organization and asked all developers to log in to the new GitLab, thus getting users.

Furthermore, the repositories had to be migrated one by one manually through the export/import mechanism. At the same time, it was necessary to consider that the CI/CD and webhook settings are not exported because they depend on the environments. They had to be adjusted manually for each repository. In addition, we had to connect our group runners as shared runners from GitLab SaaS will not be available.

We moved the repositories, set up the CI environment and webhooks, and checked with the developers that everything worked.

Pros and cons of such a decision:

Price + -
Support - +
Logs + -
Administration + -
Full access to the API + -
Privacy + -

While Self-Hosted GitLab provides more options, it requires you the need your own support.


For a modest amount of money, the client received git hosting (GitLab CE), which is slightly inferior in functionality to the premium version of SaaS in some aspects but is generally suitable for work.

If you have a large team and are not willing to pay > $10K per year, so working with self-hosted GitLab is for you. Of course, such a choice will oblige you to deal with support, allocate additional time for engineers, and the responsibility for the work of GitLab will be entirely on the DevOps team, but this can save you a lot of money.

If you have a small team and don't want to spend time maintaining git hosting, SaaS is a great option. You can get an out-of-the-box, working solution by buying a subscription rather than worrying about infrastructure.

Want to learn more? You can read about how the Mad Devs team optimized the infrastructure for Veeqo, an inventory and shipping e-commerce platform. You can also contact us, and we'll answer all your questions.

Overview of cloud delivery

An Overview of Cloud Delivery Models

An Overview of Cloud Delivery Models

An Overview of Cloud Delivery Models

Cloud computing is often the best option for businesses of all sizes. There are many advantages to moving to the cloud, such as reducing costs and...

Cloud service

Cloud Service: Which Type of Cloud Computing Services...

Cloud Service: Which Type of Cloud...

Cloud Service: Which Type of Cloud Computing Services to Choose in 2023?

Cloud computing is the process of delivering computing services (software, databases, servers and networking) over the Internet. It allows you to...

DevOps Engineer Skills Matrix

DevOps Engineer Skills Matrix

DevOps Engineer Skills Matrix

DevOps Engineer Skills Matrix

This article will discuss critical DevOps engineering skills that make you an expert. So, since we understand that people come to our company from...