Article
Gogs: setting up self-hosted GitHub clone
Forget scripto-Perlo-C porridge to setup a web interface for Git! Forget installing thousands of dependencies to setup your own repository hosting! Gogs is here to make your life easier!
Gogs is a GitHub clone written in Go, which you can host on your own server. It's a web interface to Git repositories plus a simple bug tracker. Gogs is very easy to install and use.
Installing Gogs
Gogs is distributed as a single statically linked binary plus a collection of configs and auxiliary files. All you need to do is download the distribution, unpack it and rungogs web
to start the web server.
Then go to localhost:3000
to open a one-page installation:
Set database type to SQLite — it's a good fit for websites with small to medium traffic, and since it's embedded, there's not need to configure any database servers. Fill in other details (in most cases you can leave the defaults) and create a new admin account. That's it! You now may want to:
- check the official FAQ to learn how to run Gogs as a daemon;
- read documentation on configuring and running Gogs.
Disabling public access
If you're setting up repository hosting for your private projects, probably you'll want to lock it down so that signing in with password is required to view anything there. To do so, open Gogs directory, findcustom/conf/app.ini
(note that it's in the custom
directory, do not edit conf/app.ini
from the root one) and edit two values in [service]
section, changing them to true
:
; Does not allow register and admin create account only
DISABLE_REGISTRATION = true
; User must sign in to view anything.
REQUIRE_SIGNIN_VIEW = true
The first one disables public registration, making admin responsible for creating users manually if needed; the second one requires users to sign it to view any repositories.