Installing Gitlist on Debian Latest

Gitlist is an open-source web-based application that helps programmers to create, browse and manage Git repositories. In this tutorial, we will learn how to install Gitlist on Debian Latest.

Prerequisites

Before we proceed with the installation process, we need to ensure that our system is up-to-date with the latest patches and updates. To do so, we will run the following commands:

sudo apt update
sudo apt upgrade

We also need to have Git installed on our Debian machine. To install Git, run the following command:

sudo apt install git

Installing Apache and PHP

Gitlist requires Apache and PHP to be installed on the system. To install them, run the following command:

sudo apt install apache2 php libapache2-mod-php php-mbstring php-zip php-gd php-json

Downloading Gitlist

To download Gitlist, we need to clone the Git repository:

git clone https://github.com/klaussilveira/gitlist.git

The above command will create a directory called gitlist in our current working directory.

Configuring Apache for Gitlist

Once Gitlist is downloaded, we need to configure Apache to serve Gitlist. To do so, create a new configuration file for the Gitlist website:

sudo nano /etc/apache2/sites-available/gitlist.conf

Add the following configuration to the file:

<VirtualHost *:80>
  ServerName gitlist.example.com

  DocumentRoot /var/www/gitlist/public
  <Directory /var/www/gitlist/public>
    AllowOverride All
    Require all granted
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/gitlist_error.log
  CustomLog ${APACHE_LOG_DIR}/gitlist_access.log combined
</VirtualHost>

Make sure to replace gitlist.example.com with your domain name or IP address.

Now, we need to enable the site and restart Apache:

sudo a2ensite gitlist.conf
sudo systemctl restart apache2

Configuring Gitlist

We need to make a copy of the configuration file provided with Gitlist:

cp /var/www/gitlist/config.ini-example /var/www/gitlist/config.ini

Open the configuration file:

sudo nano /var/www/gitlist/config.ini

Update the following configuration settings according to your Git repository location and authentication:

[git]
client = "/usr/bin/git"
default_branch = "master"
repositories[] = "/var/lib/git/my_repository.git"

[app]
debug = true
cache = "auto"
theme = "default"
date_format = "Y-m-d H:i:s"
timezone = "UTC"

[repositories.my_repository.git]
name = "My Repository"
owner = "My Organization"
show_size = true
show_author_gravatar = true
use_tree_view = true
file_history_limit = 0

[authentication]
enabled = true
type = "http"

Once you have made the necessary changes, save and close the file.

Accessing Gitlist

Now that Gitlist is properly configured, we can access it by navigating to http://gitlist.example.com in your browser, replacing gitlist.example.com with your domain name or IP address. You should be able to see your Git repository, branches, and files in your browser.

Congratulations! You have successfully installed Gitlist on your Debian system.

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!