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.
All you need to do is download the distribution, unpack it and run
Then go to
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:

Installing Gogs
Gogs is distributed as a single statically linked binary plus a collection of configs and auxiliary files.
gogs web
to start the web server.

localhost:3000
to open a one-page installation:

- 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.
Using Gogs
If you know how to use GitHub, you already know how to use Gogs! It reimplements most of the GitHub features: users, organizations, issues with labels and milestones, cloning via SSH and HTTPS. Unfortunately, one major feature that's currently missing is pull requests, but Gogs developers plan to implement it in the future.