Page History

Install as a systemd Service

Tiago Dias edited this page on 23 Aug 2019

Clone this wiki locally
You can clone HTTP or SSH.

Install

Unpack the GitBucket Zip distribution to /opt .

Running as a Service

Followings will be assumed:

  • Java 8 is running correctly with /usr/bin/java
  • Install directory is /opt/gitbucket
  • The GitBucket (java) process will run as user gitbucket and group gitbucket, with UID and GID 555
  • A non-root user account that can use sudo to execute commands as root will be the example
    1. Add the user and the group: ```bash 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

2. Make the owner of the GitBucket to be the `gitbucket:gitbucket` user:
```bash
sudo chown -R gitbucket:gitbucket /opt/gitbucket
  1. Change gitbucket.service to suit your needs. Especially line 18. Consult https://github.com/gitbucket/gitbucket/wiki for further details.

  2. Install the systemd service unit configuration file, reload the systemd daemon, and start GitBucket:

    sudo cp gitbucket.service /etc/systemd/system/
    sudo chown root:root /etc/systemd/system/gitbucket.service
    sudo chmod 644 /etc/systemd/system/gitbucket.service
    sudo systemctl daemon-reload
    sudo systemctl start gitbucket.service
  3. Start GitBucket automatically when booting:

    sudo systemctl enable gitbucket.service
  4. If GitBucket is not starting properly, view the logs:

    journalctl --boot -u gitbucket.service

    or just follow the logs with:

    journalctl -f -u gitbucket.service