19

Is there a way I can run GitLab (http://gitlab.org/gitlab-ce) and GitLab CI (http://gitlab.org/gitlab-ci) on a Raspberry Pi device running Raspbian?

I want to have my own internal Git box where I can store code and possibly allow other friends access to upload their code too. Is it possible?

Thanks.

6 Answers 6

15

Official way for the Pi 2

There is a very easy way to install it on the Raspberry Pi 2.

wget https://s3-eu-west-1.amazonaws.com/downloads-packages/raspberry-pi/gitlab_7.9.0-omnibus.pi-1_armhf.deb
sudo dpkg -i gitlab_7.9.0-omnibus.pi-1_armhf.deb

You might prefer to go to the official page in order to get latest version. It's fast and easy, they recommend at least 1Gb swap.

On the Pi B and B+ you will hit the memory limit very soon and get degraded performance as you grow, but on the Pi 2 it works nicely, specially if you mount your repos on an external USB hard disk.

7

It is possible to install GitLab on the Raspberry Pi. You will need the Raspberry pi model B reversion 2012 or model B+ (512mb of RAM). Installing GitLab takes a very long time.

Steps:

  1. Get a fresh copy of the latest Raspbian and expand the file system. Be sure to boot to text mode.

  2. Free-up space by typing: sudo apt-get purge xorg lxde xinit openbox lightdm && sudo apt-get autoremove && sudo apt-get clean

  3. Add some more swap space by typing: sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 (this will take a minute or so)

  4. Activate the swap space by typing sudo mkswap /swapfile1 && sudo chmod 0600 /swapfile1 && sudo swapon /swapfile1

  5. Get an external hard drive and format it as ext4. (very important)

  6. Add the Git user: sudo adduser --disabled-login --gecos 'GitLab' git

  7. Delete everything in /home/git sudo rm -rf /home/git/* && sudo rm -rf /home/git/.*

  8. Add the following in /etc/fstab: (sudo editor /etc/fstab)

    /swapfile1 none swap defaults 0 0 /dev/sda1 /home/git ext4 defaults 0 0

  9. Reboot: sudo reboot

  10. Follow the instructions here for the latest version of gitlab (currently 7.7): https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/doc/install/installation.md

Notes: On step "Install Gems", when you type sudo -u git -H bundle install --deployment --without development test mysql aws, It will take several hours, especially while fetching the gem sources and installing "kgio". You can ignore all incompatibility messages during this process.

Another thing to note is that creating a project inside GitLab takes a very long time. Just return to the dashboard if it takes more than a minute.

4

You can find GitLab requirements here. If you have Raspberry Pi model B (512MB of RAM), I think that you can run GitLab but you might encounter performance issue.

I'd suggest that you take a look here to find lighter systems.

2
  • I had a look at Gitorious as an alternative but I don't know whether the Pi can handle that either Commented Oct 28, 2013 at 16:36
  • Maybe use cgit (git.zx2c4.com/cgit) which is a very fast and lightweight systemm
    – Razer
    Commented Oct 30, 2013 at 7:10
1

I use Gitolite on a small server and it's pretty awesome. There is no web UI. Gitolite itself is just a git repo you push and pull changes to to control access

https://github.com/sitaramc/gitolite

1

On your expanded, up-to-date raspbian, edit the swap space config file:

sudo vi /etc/dphys-swapfile

Change CONF_SWAPSIZE from 100 to 1000

Follow the instructions for the latest GitLab, at the moment: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/doc/install/installation.md

Happy gitting!

1
  • you may want to include why the user should increase the swapsize.
    – peterp
    Commented Dec 1, 2016 at 11:34
0

For those still interested in running versioning systems (and more) on a Pi, I wrote an article of what I tested here. In my experience, recent versions of GitLab are very difficult to run on a Pi 2/3, but work well on Pi 4. For Pi versions < 4 I suggest Gitea, for Pi == 4, I suggest GitLab. In the article, I listed docker images that can be used to run both services in a few minutes:

In the article there are also info on CI/CD with Jenkins and GitLab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.