Console Login
Home / Blog / DevOps & Infrastructure / Building a Bulletproof Private Git Server for Agile Teams in Norway
DevOps & Infrastructure 11 views

Building a Bulletproof Private Git Server for Agile Teams in Norway

@

Is Your Version Control System Slowing You Down?

Let’s be honest. If you are still using Subversion (SVN) in 2011, you are fighting a losing battle. The distributed nature of Git has revolutionized how we handle code, branching, and merging. But here is the problem: relying on public cloud repositories hosted in the US can be a nightmare for latency, and for some Norwegian companies, it is a legal gray area regarding data sovereignty.

I have seen it too many times. A developer in Oslo tries to push a large commit to a server in San Francisco. The connection times out. Production deployment is delayed. The coffee gets cold. It is unacceptable.

Today, we are going to build a private, secure, and blazing fast Git server on a CoolVDS instance running Ubuntu 10.04 LTS. We keep the data in Norway, the latency low, and the control in your hands.

Why Self-Hosted Git?

While services like GitHub are excellent for open source, many enterprises require strict data isolation. Placing your intellectual property on a shared public cloud implies a level of trust that not every CTO is willing to grant. Furthermore, under the watchful eye of Datatilsynet (The Norwegian Data Inspectorate), keeping your data within national borders simplifies compliance significantly.

Pro Tip: Latency kills productivity. Pinging a server in Oslo from Trondheim takes ~15ms. Pinging a server in Virginia takes ~120ms. Over thousands of git objects, that difference adds up to minutes of wasted time per day.

The Architecture: SSH + Gitolite

We are not going to mess around with complex HTTP setups that require heavy Apache configurations. We are using the industry standard for 2011: Gitolite over SSH. This provides granular access control without giving your developers full shell access to the server.

Step 1: The Foundation

First, spin up a CoolVDS instance. For a team of 10-20 developers, our 1GB RAM / SSD plan is ideal. Yes, we offer SSD storage—disk I/O is the primary bottleneck for Git garbage collection (`git gc`), and standard SATA drives just don't cut it when the whole team commits at 5 PM.

Log into your server:

ssh root@your-coolvds-ip

Update your system and install the core dependencies. We rely on the stable repositories:

apt-get update && apt-get upgrade -y apt-get install git-core perl

Step 2: dedicated User and Gitolite

Never run Git as root. Create a dedicated user for the repository handling:

adduser --system --shell /bin/bash --group --disabled-password --home /home/git git

Now, we need your local workstation's public SSH key (`~/.ssh/id_rsa.pub`) to initialize the admin access. Upload it to the server:

scp ~/.ssh/id_rsa.pub root@your-coolvds-ip:/tmp/admin.pub

Switch to the git user and install Gitolite:

su - git git clone git://github.com/sitaramc/gitolite gitolite/src/gl-system-install gl-setup /tmp/admin.pub

Step 3: Managing Repositories

Here is the beauty of this setup: you don't administer the server by logging into it anymore. You administer it via Git. Back on your local machine, clone the admin repo:

git clone git@your-coolvds-ip:gitolite-admin

Inside, you will find a `gitolite.conf` file. It looks like this:

repo testing RW+ = @all repo project-alpha RW+ = admin R = dev-team

Simply commit and push changes to this file to create new repositories or change permissions. The hooks handle everything instantly.

Hardware Matters: The I/O Bottleneck

Many VPS providers oversell their storage. They put hundreds of virtual machines on a single RAID array of 7.2k RPM SATA drives. When your neighbor decides to compile a kernel, your Git checkout speed drops to zero. This is the "noisy neighbor" effect.

At CoolVDS, we utilize KVM virtualization. Unlike OpenVZ, KVM provides stricter isolation of resources. Furthermore, our storage backends utilize enterprise-grade SSDs or high-speed SAS RAID-10 arrays. When you run `git clone`, the disk seeks are virtually instant. For a version control system that creates thousands of tiny files, IOPS (Input/Output Operations Per Second) is the only metric that matters.

Conclusion

You now have a secure, private Git server running on Linux. Your code resides in Norway, subject to local laws, and your push/pull times are limited only by the speed of light across the fiber network.

Don't let sluggish infrastructure hamper your development cycle. If you need a host that understands the difference between 'uptime' and 'performance', you know where to look.

Ready to speed up your workflow? Deploy a CoolVDS SSD Linux instance in under 60 seconds and take control of your code.

/// TAGS

/// RELATED POSTS

Building a CI/CD Pipeline on CoolVDS

Step-by-step guide to setting up a modern CI/CD pipeline using Firecracker MicroVMs....

Read More →

Taming the Beast: Kubernetes Networking Deep Dive (Pre-v1.0 Edition)

Google's Kubernetes is changing how we orchestrate Docker containers, but the networking model is a ...

Read More →

Stop SSH-ing into Production: Building a Git-Centric Deployment Pipeline

Manual FTP uploads and hot-patching config files are killing your stability. Here is how to implemen...

Read More →

Decomposing the Monolith: Practical Microservices Patterns for Nordic Ops

Moving from monolithic architectures to microservices introduces network complexity and latency chal...

Read More →

Beyond the Hype: Building "NoOps" Microservices Infrastructure in Norway

While Silicon Valley buzzes about AWS Lambda, pragmatic engineers know the truth: latency and vendor...

Read More →

Ditch Nagios: Monitoring Docker Microservices with Prometheus in 2015

Monolithic monitoring tools like Nagios fail in dynamic Docker environments. Learn how to deploy Pro...

Read More →
← Back to All Posts