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-ipUpdate 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 perlStep 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 gitNow, 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.pubSwitch 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.pubStep 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-adminInside, you will find a `gitolite.conf` file. It looks like this:
repo testing
RW+ = @all
repo project-alpha
RW+ = admin
R = dev-teamSimply 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.