GitBucket is an open-source Git platform that allows users to easily host and manage version control repositories. It is a great alternative to GitHub and Bitbucket that you can install on your own server.
In this tutorial, we will show you how to install GitBucket on a Debian latest VPS or dedicated server.
Before you begin, you will need:
GitBucket requires Java 8 or higher to run. You can easily install Java using the following command:
sudo apt-get update
sudo apt-get install openjdk-8-jre
Verify that Java is installed:
java -version
The output should look like this:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0+deb9u1-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
GitBucket requires Git to manage repositories. You can install Git using the following command:
sudo apt-get install git
Go to the GitBucket’s official website and download the latest version of the GitBucket.war file:
wget https://github.com/gitbucket/gitbucket/releases/download/4.36.2/gitbucket.war
Create a directory to store the GitBucket files:
sudo mkdir /opt/gitbucket
Move the downloaded GitBucket.war file to the /opt/gitbucket directory:
sudo mv gitbucket.war /opt/gitbucket
Change the ownership of the /opt/gitbucket directory to the user that will run GitBucket:
sudo chown -R username:username /opt/gitbucket
Create a systemd service file to manage GitBucket as a service:
sudo nano /etc/systemd/system/gitbucket.service
Add the following lines to the service file:
[Unit]
Description=GitBucket Service
After=syslog.target
After=network.target
[Service]
User=username
ExecStart=/usr/bin/java -jar /opt/gitbucket/gitbucket.war
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=gitbucket
[Install]
WantedBy=multi-user.target
Save and close the file.
Reload the systemd daemon to read the newly created GitBucket service file:
sudo systemctl daemon-reload
Start the GitBucket service and enable it to start at boot time:
sudo systemctl start gitbucket
sudo systemctl enable gitbucket
To verify that GitBucket is running, you can check the service status:
sudo systemctl status gitbucket
The output should look like this:
● gitbucket.service - GitBucket Service
Loaded: loaded (/etc/systemd/system/gitbucket.service; enabled; vendor preset: enabled)
Active: active (running) since ...
Main PID: ...
Tasks: ...
Memory: ...
CPU: ...
CGroup: ...
GitBucket is now installed and running! You can access the GitBucket web interface by navigating to your server’s IP address or domain name on port 8080:
http://your_ip_address_or_domain_name:8080/
You can log in using the default GitBucket credentials: Username: root and password: admin.
In this tutorial, you have learned how to install GitBucket on Debian latest. Now you can easily host and manage your own Git repositories, and work collaboratively with your team through GitBucket.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!