Don't ask me how I did it (ok, you can ask, in fact I'm going to tell you...), but somehow I now have a remote git server and gitolite for repo and user administration installed and running on Ubuntu 11.10 using an Amazon EC2 Micro instance.
I've spent all morning on this, tested it on 3 different instances (I love it how you can just throw away an EC2 instance and start again with a new one in a matter of minutes) and have kept a log of the steps which got me there. Please note that there may be errors or illogical jumps in this summary, but maybe it will be helpful nonetheless - or it may even work outright, who knows.
BEfore we get started, here are some links that helped me (but note I had to pick some steps from some links, and other steps from others...). In particular I did not clone gitolite to my local machine (as this post suggests but ended up using
Links I used:
git + gitolite + git-daemon + gitweb setup on Ubuntu 11.10 server
How to setup git server using gitolite in Ubuntu 11.10 Oneiric
Install Gitolite To Manage Your Git Repositories

First of all, get yourself an instance of Ubuntu (you may swap this for your preferred Linux distro). If you are in love with EC2 then head over to alestic.com and click the selection at the top of the page (I'm using the us-east region), and then pick your preferred image.
The neat thing is that if you already have an Amazon Web Services account you can launch your instance with virtually one click, very neat. I picked the Ubuntu 11.10 Oneiric EBS boot image, 64 bit.
Once booted, SSH into your instance (consult other blogs for details on this if you need help).
I then ran the following commands first:
2sudo apt-get upgrade
Then create a tmp folder
which is where you will copy your public key into. Now open another local Terminal window and copy your public key - consult the steps for generating new keys from other sources if needed.
2scp ~/.ssh/id_rsa.pub yourEC2server.com:/tmp/stefan.pub
Note that SCP is not always straight forward - I struggle with the syntax at times - and EC2 complicates it a bit. So the format may in fact look more like this:
I then installed git, gitolite and some stuff which I am not sure is strictly needed:
Then added my git user details and added the git user
2git config --global user.email "my@domain.com"
3sudo adduser --system --shell /bin/bash --gecos 'git version control' --group --disabled-password --home /home/git git
The system should reply with
2Adding new group `git' (GID 111) ...
3Adding new user `git' (UID 105) with group `git' ...
4Creating home directory `/home/git' ...
I then switched to the git user account, added a PATH variable and then actually ran the gitolite setup.
2echo "PATH=$HOME/bin:$PATH" > ~/.bashrc
3# run gitolite setup, passing a reference to the .pub file we uploaded earlier. In my case this file was in the ubuntu/tmp folder.
4gl-setup /home/ubuntu/tmp/stefan.pub
Hit enter when asked, and quit the file that opens in VIM with :wq.
I was now able to exit the remote SSH session and could now clone a the remote gitolite-admin repository:
Amazingly this worked. Please note that I may well have left out a step, or got the order slightly wrong. If needed I could create a screencast sometime (please shout), I think this would make things clearer. Make sure you read the gitolite instructions for how you add users and repos. One mistake I made was to not push my changes to the remote and then was left wondering why my new repos were not showing... Git newbie, I know.
Lastly I downloaded a trial of Tower, a GUI based git client that comes highly recommended - they even have a 25% off offer running right now.
Good luck.

#1 by Alex on 3/3/12 - 6:50 PM
#2 by Stefan Richter on 3/5/12 - 11:09 AM
thanks for letting me know, great to hear that it worked for you.
#3 by betty on 6/4/12 - 8:43 AM
Any clues or suggestions?
#4 by betty on 6/4/12 - 10:43 PM
Also as a note for you windows developers out there I use winSCP to copy the first public key into the tmp folder.
#5 by Stefan Richter on 6/6/12 - 10:59 AM
thanks for the follow up, glad to hear it is working now.
#6 by Val Kotlarov Hoffman on 6/20/12 - 11:59 AM
Just one thing - needed to run -
gl-setup /tmp/mykey.pub
because the scp copied it there, not into /home/ubuntu/tmp.
Otherwise, thanks, this was very helpful.
Val
#7 by Stefan Richter on 6/20/12 - 12:12 PM
thanks for the tip and I'm glad it's working for you.
#8 by Andrew Wren on 1/31/13 - 5:06 PM
I had to modify one step for my setup (a clean Debian Etch install):
I had to su to the gitolite user not the git user to run the gl-setup step. Other than that it worked brilliantly.