The Era of Distributed Version Control is Here
If you are still shouting across the office to ask if anyone has the file locked in Subversion, you are doing it wrong. It is 2011. The Linux kernel development team proved that Distributed Version Control Systems (DVCS) are the only scalable way to handle code. But here is the problem: GitHub is excellent for open source, but their pricing for private repositories scales poorly for growing teams. Furthermore, do you really want your proprietary code hosted on US servers subject to the PATRIOT Act?
Today, we are going to build a fortress. We will set up a private, centralized Git server using Gitolite on a CoolVDS instance hosted right here in Norway. This gives you granular access control, zero per-user licensing fees, and single-digit millisecond latency for your developers in Oslo.
Why Self-Host? Latency and Control
I have seen development teams struggle with git push operations that take forever because their hosting provider oversells bandwidth. When you are syncing gigabytes of assets, every millisecond of round-trip time (RTT) counts. By hosting on VPS Norway infrastructure, specifically CoolVDS, you ensure that your TCP handshakes are almost instantaneous for local teams. We aren't routing traffic through Frankfurt or London just to commit a bug fix.
Pro Tip: Don't rely on standard FTP-grade hosting for repositories. Git is I/O intensive during packing and unpacking objects. You need a system with dedicated RAM and high-speed disk arrays, like the Enterprise RAID-10 SAS setups we standardise on at CoolVDS.
The Stack: CentOS 5 and Gitolite
We will use CentOS 5.5 for its stability. While Debian 6 (Squeeze) was just released, many enterprise shops still prefer the Red Hat ecosystem. We will use Gitolite, which is currently the industry standard for managing Git hosting without giving every developer a shell account on your server.
Step 1: Prepare the Server
First, log into your CoolVDS instance. We need to install Git. On CentOS, the default repositories have an ancient version, so we will use the EPEL repository to get a 1.7.x release.
rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install git perl-Time-HiResStep 2: Create the Git User
Security is paramount. Never run your repositories as root. We create a dedicated user that will handle all SSH connections.
useradd -m git
passwd -l gitStep 3: Install Gitolite
Switch to the git user and clone the Gitolite source. We are installing from the source to ensure we have the latest hooks and configuration options.
su - git
git clone git://github.com/sitaramc/gitolite
gitolite/src/gl-system-install
gl-setup /tmp/your-admin.pubThis command sets up the authorized_keys file automatically. Unlike a basic SSH setup, Gitolite restricts users to only running the git command. They cannot get a shell prompt. This is crucial for security compliance.
Managing Access: The Configuration
The beauty of Gitolite is that you manage the server by pushing to a special repo called gitolite-admin. You don't need to SSH into the server to add users; you just edit a text file and push. Itβs Infrastructure as Code before the buzzword even catches on.
Here is a sample gitolite.conf for a standard development team:
repo gitolite-admin
RW+ = admin
repo coolvds-backend
RW+ = bjorn lars
R = deployment-botWhen you push this configuration, Gitolite instantly updates the permissions. Bjorn and Lars can write, but your deployment script can only read. This granular permission model is essential for compliance with strict Norwegian internal data handling protocols, keeping the Datatilsynet happy by enforcing least-privilege access.
Hardware Matters: The Xen Advantage
A Git server might seem lightweight, but during a large git gc (garbage collection) or a massive clone, it eats CPU cycles and disk I/O. Many budget VPS providers use OpenVZ, where "noisy neighbors" can steal your CPU time. If another customer on the node is running a runaway script, your commits lag.
At CoolVDS, we use Xen virtualization. This provides true hardware isolation. Your RAM is yours. Your disk throughput is guaranteed. For a critical piece of infrastructure like a code repository, you cannot afford the instability of container-based virtualization. Stability is the foundation of DevOps.
Conclusion
You now have a fully functional, private Git server hosted in Norway. You own the data, you control the backups, and you aren't paying monthly fees per user. Plus, your push/pull speeds will be blazing fast thanks to local peering.
Ready to migrate your SVN repo? Deploy a Xen VPS on CoolVDS today and experience the difference dedicated resources make for your engineering workflow.