How to install GitBucket on Ubuntu Server 18.04

Having your own local Git repository is not as difficult as you think.

"data-credit =" Image: iStockphoto / comzeal "rel =" noopener noreferrer ">   Programmer or freelance developer who works at home and writes the source code with the laptop

Image: iStockphoto / comzeal

If you use Git and are looking for an easy-to-use means to manage local repositories, you may want to take a look at GitBucket. This tool, written in Scala, offers:

  • Intuitive UI
  • Add-ons system
  • API compatibility with GitHub
  • Public and private repositories
  • GitLFS support
  • Repository viewer
  • Online file editor
  • Activity timeline
  • Email notifications
  • Account management and groups (through LDAP integration)
    [19659007] And more

SEE: 10 free alternatives to Microsoft Word and Excel (download TechRepublic)

What you will need

The only things you will need for This works are:

  • An updated and running instance of Ubuntu Server 18.04
  • A user account with sudo privileges

Java installation

The first thing to do is install Java. To do this, open a terminal window and issue the command:

  sudo apt-get install default-jdk -y 

Install NGINX

GitBucket requires a web server. We will use NGINX. If your Ubuntu server includes Apache, you must first stop it and disable it with the commands:

  sudo systemctl stop apache2
sudo systemctl disable apache2 

Install NGINX with the command:

  sudo apt-get install nginx -y 

How to add a new group

We are going to add a new group and a user without privileges for the operation of GitBucket Back in the terminal window, create the group with the command:

  sudo groupadd -g 555 gitbucket 

Then add the unprivileged user with the command:

  sudo useradd -g gitbucket --no-user -group - -home-dir / opt / gitbucket --no-create-home --shell / usr / sbin / nologin --system --uid 555 gitbucket 

How to download and install GitBucket

Now is the time download GitBucket with the command:

  wget[19659035font>Unavezqueelarchivosehayadescargadocreeunnuevodirectorioconelcomando:[19659026] sudo mkdir / opt / gitbucket 

Move the downloaded file to the newly created directory with the command:

  sudo mv gitbucket.war / opt / gitbucket 

Give the .war file the appropriate permissions with the command:

  sudo chown -R gitbucket: gitbucket / opt / gitbucket [19659027] How to create a Systemd file 

To start the service, you need to create a systemd file. Issue the command:

  sudo nano /etc/systemd/system/gitbucket.service[19659035//New filefilefileNext:[19659026[# GitBucket Service
Description = Manage Java service

WorkingDirectory = / opt / gitbucket
ExecStart = / usr / bin / java -Xms128m -Xmx256m -jar gitbucket.war
User = gitbucket
Group = gitbucket
Type = simple
Restart = in case of failure
RestartSec = 10

WantedBy = 

Save and close the file. Reload systemd with the command:

  sudo systemctl daemon-reload 

Start and enable the new service with the following commands:

  sudo systemctl start gitbucket
sudo systemctl enable gitbucket 

How to configure a database connection for GitBucket

Then we must configure a database connection for GitBucket. To solve this, issue the command:

  sudo nano /opt/gitbucket/database.conf[19659035//EnesefilefilefromNextinnenewfile:[19659026[db {
url = "jdbc: h2: $ {DatabaseHome}; MVCC = true"
user = "sa"
password = "sa"

How to configure NGINX as a reverse proxy

Now we need to create an NGINX virtual host file and configure NGINX as a reverse proxy. To do this, create a new file with the command:

  sudo nano /etc/nginx/sites-available/gitbucket.conf[19659035▪NewnewfilefilefileNext:[19659026grapupstream gitbucket {
server weight = 100 max_fails = 5 fail_timeout = 5;

server {
listen 80;

Location / {
proxy_set_header X-Fordered-Host $ host;
proxy_set_header X-Fordered-Server $ host;
proxy_set_header X-Fordered-For $ proxy_add_x_forwards_for;
proxy_pass http: // gitbucket /;

Save and close the file.

Enable the NGINX virtual host with the command:

  sudo ln -s /etc/nginx/sites-available/gitbucket.conf / etc / nginx / sites-enabled / 

Restart NGINX with the command: [19659026] sudo systemctl restart nginx

How to access the web interface

Open a web browser on your network and point it to http: // SERVER_IP: 8080 (where SERVER_IP is the IP address of your hosting server). It should be received by the GitBucket homepage. Log in with the root / root credentials. At this point, you should see a new instance of GitBucket ( Figure A ), where you can begin the process of creating and managing new repositories for your projects.

Figure A

The main page of GitBucket.

"data-credit =" "rel =" noopener noreferrer ">   gitbucketa.jpg gitbucketajpg [19659076font>toclickonthepop-upmenu"r"(upperrightcorner)tomaketheadministrationofthetestofthedifferentiationofthedifferentiationofthedifferentiationoftheremotecontroloftheinstallationofthedifferentproofsoftheinstallation] http: // / “width =” 70 “height =” 70 “/>

Weekly open source newsletter

You don't want to miss our tips, tutorials and comments about the Linux operating system and open source applications.
Delivered on Tuesdays

Register today

Register today

See also

For More Updates Check out Blog, Windows Softwares Drivers, Antivirus, Ms Office, Graphic Design Don’t Forget to Look Our Facebook Page Get Into Pc like us & follow on Twitter- @getinpc

Please Note: This content is provided and hosted by a 3rd party server. Sometimes these servers may include advertisements. does not host or upload this material and is not responsible for the content.