How to Install Gogs on Debian Latest

Gogs is a self-hosted Git service that allows you to create and manage your own Git repositories. In this tutorial, we will walk through the steps required to install Gogs on Debian latest.

Prerequisites

Before we begin, make sure you have the following:

Step 1: Update and Upgrade System Packages

First, update the system package list and upgrade any outdated packages by running the following commands:

sudo apt update
sudo apt upgrade

Step 2: Install Required Dependencies

Gogs requires several dependencies to be installed on the system. Install the required dependencies by running the following command:

sudo apt install git build-essential libpam-dev

Step 3: Download Gogs

Download the latest stable version of Gogs from the official website.

wget https://dl.gogs.io/gogs_latest_linux_amd64.tar.gz

Step 4: Extract Gogs

Extract the downloaded Gogs archive to your desired directory. In this example, we'll use /opt/gogs as the installation directory.

sudo tar -xvf gogs_latest_linux_amd64.tar.gz -C /opt/

Step 5: Create Gogs User

Next, create a new user for Gogs to run as on the system. This ensures that Gogs doesn't run as the root user, which can be a security risk.

sudo adduser --system --group --disabled-login gogs

Note: --disabled-login flag ensures that the newly created user cannot login to the system.

Step 6: Configure Gogs

Navigate to the Gogs installation directory and edit the custom/conf/app.ini file to configure Gogs for your needs.

cd /opt/gogs/
sudo nano custom/conf/app.ini

Replace the following parameters with your own values:

Save your changes and exit the editor.

Step 7: Start Gogs

Start the Gogs service by running the following command:

sudo -u gogs ./gogs web

You can now access your Gogs installation by opening your web browser and navigating to the URL that you set in step 6.

Conclusion

Congratulations! You have successfully installed Gogs on Debian latest. Now you can create and manage your own Git repositories on your own server.

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!