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.
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 run
gogs 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, find
custom/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
; 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.
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.
There is a demo server running at https://try.gogs.io, feel free to register there and experiment with it. Click Explore if you want to browse existing repositories.
A word of caution and a splash of cold water to cool off your excitement: Gogs recently had SQL injection vulnerabilities. They were fixed, but string concatenation in the SQL query with user supplied data is kinda unacceptable these days. I hope developers will take security more seriously.
Project and source code
Authors: see https://github.com/gogs/gogs/graphs/contributors