Escaping Subversion: Building a Bulletproof Private Git Server with Gitolite in Norway
If you are still managing your project's source code with Subversion (SVN) in 2011, you are fighting a losing battle. The distributed nature of Git has revolutionized how we handle branching and merging, but it introduces a new dilemma for Norwegian development teams: Where do you host the repository?
Sure, GitHub is gaining traction, and Bitbucket offers free private repos, but let's talk about the elephant in the server room: The US Patriot Act. If your servers are located in the United States, your intellectual property is subject to foreign jurisdiction. For those of us answering to Datatilsynet (The Norwegian Data Protection Authority) or handling sensitive client data, "putting it in the cloud" isn't a strategy; it's a liability.
I've seen too many CTOs ignore the latency overhead of trans-Atlantic pipes. When your team in Oslo does a git clone of a 2GB repository hosted in Virginia, productivity dies. You need metal close to home. You need low latency to NIX (Norwegian Internet Exchange).
Today, we are going to set up a rock-solid, private Git server using Gitolite on a CoolVDS instance running Ubuntu 10.04 LTS. This setup gives you granular access control without the overhead of a heavy web interface.
Why Hardware IOPS Matter for Git
Many developers think Git is just CPU-bound. Wrong. Git is a filesystem thrasher. When you run garbage collection (git gc) or index a massive commit history, you are generating thousands of small I/O operations. On a traditional 7.2k SATA drive, your sleek DVCS turns into a sloth.
This is where the underlying infrastructure of your VPS provider becomes critical. We configure our CoolVDS instances on high-performance enterprise storage arrays. While standard VPS hosts oversubscribe their spinning disks, resulting in "I/O wait" spikes during peak hours, a dedicated slice with proper I/O isolation ensures your git push completes before you can switch windows.
Step 1: The Environment
I am assuming you have a fresh CoolVDS VPS provisioned. We stick to Ubuntu 10.04 Lucid Lynx for this tutorial because reliability trumps novelty in production.
First, log in as root and update your system. Never deploy on a stale kernel.
apt-get update && apt-get upgrade -y
Step 2: Install Git and Create the User
We need the core Git binaries. We also need to create a dedicated user that will handle the repositories. Do not run Git access via root. That is a rookie mistake.
apt-get install git-core
adduser --system --shell /bin/bash --group --disabled-password --home /home/git git
Step 3: Setting Up Gitolite
Gitolite is the standard for Git access control right now. It allows you to manage access via a single gitolite-admin repository, using SSH keys to identify users. It is far more secure than managing Unix users for every developer.
You will need your local workstation's public SSH key (usually ~/.ssh/id_rsa.pub). Upload it to your VPS:
scp ~/.ssh/id_rsa.pub root@your-coolvds-ip:/tmp/admin.pub
Now, 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
You will be prompted to check the configuration file. The defaults are usually fine for 99% of teams.
Step 4: Managing Access from Your Workstation
This is the beauty of Gitolite. You never need to log into the server again to add users. Go back to your local machine and clone the admin repo:
git clone git@your-coolvds-ip:gitolite-admin
Inside, you will see two folders: conf/ and keydir/.
- keydir/: Drop your developers' public keys here (e.g.,
johndoe.pub). - conf/gitolite.conf: Define your repositories and permissions.
Example configuration:
repo super-secret-project
RW+ = admin
RW = johndoe
R = deployment-bot
Commit and push these changes. Gitolite's hooks will automatically update the server configuration. It is seamless.
Pro Tip: Network latency kills flow. By hosting on CoolVDS within Norway, your ping times to the server are likely under 10ms. This makes SSH handshakes and small object transfers feel instantaneous compared to hosting in the US or Germany.
Data Sovereignty and Compliance
Under the current Personopplysningsloven, you are responsible for how personal data is secured. When you host code that might contain database dumps or customer logic on a US-controlled cloud, you are entering a grey area regarding the Safe Harbor framework.
By keeping your Git server on a Norwegian VPS, you simplify your compliance landscape. Your data stays under Norwegian law, physically located in high-security datacenters in Oslo, protected by strict access controls you define.
Summary
Stop tolerating slow pushes and legal ambiguity. A self-hosted Gitolite setup on a high-performance VPS gives you:
- Speed: Local peering prevents latency lag.
- Control: Granular permissions without per-user license fees.
- Privacy: Your code, your server, your jurisdiction.
Don't let your infrastructure be the bottleneck for your release cycle. Deploy a CoolVDS instance today and experience what raw, unthrottled I/O does for your development workflow.