Gogs also known as Go Git Server is an open source cross-platform self-hosted Git server written in Golang, similar to the GitLab which is written in Ruby. It is easy to install and configure and offers a lot of customization options while installing, it lets you choose between MySQL, SQLite, and PostgreSQL as a Database backend. It is also one of the lightest and fastest self-hosted Git server solution, it does not offer a lot of features like GitLab, but whatever it offers, it does it without pain. If you don’t already have a Debian server, you can get a VPS on Digital Ocean, by signing up with this referral you get $10 credit and I get $25 credit. Installing Gogs is easy it’s available as a precompiled package from Packager. It receives updates like every other package you would install on your system. So you can do the setup once and receive an update on new builds. This setup being pre-built, might not support SQLite, for this guide, I am using MariaDB. You can use PostgreSQL over MariaDB if you prefer it.
Adding Gogs repository key.
Add Gogs packager.io repository to your
sources.list.d directory/ For Jessie
sudo echo "deb https://deb.packager.io/gh/pkgr/gogs jessie pkgr" | sudo tee /etc/apt/sources.list.d/gogs.listCode language: PHP (php)
sudo echo "deb https://deb.packager.io/gh/pkgr/gogs wheezy pkgr" | sudo tee /etc/apt/sources.list.d/gogs.listCode language: PHP (php)
Updating local package database to fetch meta of the new repository.
Adding MariaDB repository, choose the setup depending on the version of Debian you are using and the closest mirror you prefer, from here.
Logging into MariaDB console.
mysql -u root -p
Creating a new Database for Gogs.
CREATE DATABASE gogs;
Exiting MySQL console.
exitCode language: PHP (php)
Installing NGINX to reverse proxy Gogs to port 80.
Editing the NGINX config
Add the following lines to your NGINX config.
sudo service nginx restart
I compiled a list of software and services that I use to improve my workflow, here is the link to the list.