In this tutorial, we will show you how to install Gogs on Ubuntu 22.04 LTS. Gogs, short for Go Git Service, is a lightweight, self-hosted Git service that mirrors many of the functionalities of platforms like GitHub and GitLab. It’s written in Go, making it a highly efficient and portable solution for all your version control needs.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Gogs on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- Basic knowledge of the Linux command-line interface (CLI). This guide assumes you’re comfortable with executing commands in a terminal.
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Gogs.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install Gogs on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. Before we dive into the installation process, it’s essential to ensure your system is up-to-date. Run the following commands to update your system packages:
sudo apt update sudo apt upgrade
Next, install the necessary dependencies. For this guide, we’ll be using Git and SQLite. Install them using the following commands:
sudo apt install git sqlite3
Step 2. Installing Gogs on Ubuntu 22.04.
To install Gogs, first, download the latest binary from the official Gogs website. You can use the
wget command to download it directly to your server:
Next, extract the downloaded archive using the
tar -xvf gogs_0.13.0_linux_amd64.tar.gz
For security reasons, it’s recommended to create a dedicated system user for running Gogs. You can do this with the
sudo adduser --system --group --disabled-password --shell /bin/bash --home /home/gogs --gecos 'Gogs' gogs
Step 3. Configure Gogs.
Gogs come with a sample configuration file that you can use as a starting point. Copy this file to the actual configuration file:
cp /path/to/gogs/conf/app.ini.sample /path/to/gogs/conf/app.ini
Open the configuration file with your preferred text editor and modify the necessary fields according to your preferences. For example, you might want to change the
ROOT_URL, and database settings.
Gogs support several databases, including MariaDB, PostgreSQL, and SQLite3. For this guide, we’ll be using SQLite3, which we installed earlier. In the Gogs configuration file, ensure the following settings are present under the
TYPE = sqlite3 PATH = /path/to/gogs/data/gogs.db
Now that Gogs is installed and configured, it’s time to start the service. You can do this using the
sudo systemctl start gogs
To ensure Gogs starts automatically whenever your system boots, enable the service:
sudo systemctl enable gogs
Step 4. Accessing Gogs Web Interface.
You can access the Gogs web interface through a web browser using your server’s IP address or domain, followed by the port number you specified in the configuration file. The default port is 3000. So, if your server’s IP address is 192.168.1.100, you would navigate to
Congratulations! You have successfully installed Gogs. Thanks for using this tutorial for installing the Gogs on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official Gogs website.