-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Installation on a Raspberry Pi
- Raspberry Pi 3
- 32GB SD Card
- Fresh Raspbian Instance (2019-09-26-raspbian-buster-lite)
The goal is to have a Git Server on a Raspberry Pi. GitBucket shall run as a service on the device.
First we need to install Java JRE on the RPi:
sudo apt-get install openjdk-8-jre
In order to set up a systemd Service we need to create a dedicated system-user for GitBucket
sudo groupadd -g 555 gitbucket
sudo useradd -g gitbucket --no-user-group --home-dir /opt/gitbucket --no-create-home --shell /usr/sbin/nologin --system --uid 555 gitbucket
sudo mkdir /opt/gitbucket
cd /opt/gitbucket
sudo wget https://github.com/gitbucket/gitbucket/releases/download/4.33.0/gitbucket.war
sudo chown -R gitbucket:gitbucket /opt/gitbucket
sudo nano /etc/systemd/system/gitbucket.service
Copy these lines into gitbucket.service file
# GitBucket Service
[Unit]
Description=Manage Java service
[Service]
WorkingDirectory=/opt/gitbucket
ExecStart=/usr/bin/java -Xms128m -Xmx256m -jar gitbucket.war
User=gitbucket
Group=gitbucket
Type=simple
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable gitbucket
sudo systemctl start gitbucket
Now you can check if GitBucket instance is running by typing:
systemctl status gitbucket
Everything is fine if you see something like:
pi@GitBucket:/opt/gitbucket $ systemctl status gitbucket
gitbucket.service - Manage Java service
Loaded: loaded (/etc/systemd/system/gitbucket.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-02 19:23:37 BST; 2s ago
Main PID: 4996 (java)
Tasks: 17 (limit: 2200)
Memory: 62.1M
CGroup: /system.slice/gitbucket.service
└─4996 /usr/bin/java -Xms128m -Xmx256m -jar gitbucket.war
Now you can access your GitBucket via http://IP_ADRESS_OF_RPI:8080/
Sign in with standard credentials root/root.