Gogs is a lightweight self-hosted Git service. Since it has almost no dependencies, you can setup your own Git service in almost no time. All you need is a small server for hosting it. I am using a Raspberry Pi 2 with Raspbian to host my private Gogs Git service. In this small post I’ll show you how.
Start by updating all the apt-packages:
Also ensure Git is installed on your server:
Create a user
Before installing Gogs we will first create a new dedicated user for running Gogs:
First of all switch to the new user named git:
Now fetch the latest binary package of Gogs from the download page for your operating system:
There are no further steps required. We just need to configure Gogs as a Systemd service, so it will automatically start when the server starts or reboots. Gogs alredy comes with a well preconfigured Systemd script. So let’s use it:
Gogs should now start a installer and configuration page on http://localhost:3000/. Open the page in your browser and configure it your needs. In most cases the default configuration is sufficient to run Gogs. Anyways, detailed installation information are available in the documentation.
If you plan to bind Gogs to a port below 1024, it might be necessary to grant permission to the executable first:
For further configuration options and tweeks take a look at the Configuration Cheat Sheet. Changes to the
custom/conf/app.ini file required a restart of the Gogs service: