Switching to Gogs

tech choice self-hosted code management github gitlab gogs

For the last year or so, I have been using GitLab to store and manage my code. There were several reasons for choosing it.

First off, I'm obsessed with self-hosting. I've always been wary of entrusting any of my personal information/data - especially something as vital to a programmer as his code - to anyone but myself, let alone some company. My photos and videos are self-hosted (with proper automatic backups, of course), my documents (few as they are) are self-hosted, my phone numbers are self-hosted (not on my phone), and, certainly, my code is self-hosted.

Until switching, all my code was in raw, bare git repositories stored on one of my servers. For a long time, this suited me just fine. However, I started needing the features offered by a web service, especially the ability to show and share my code with others.

In addition to not liking cloud services in general, I had some reasons to not trust GitHub, though most of those were/are irrational. I've heard bad things about the management of the company. I don't generally operate on rumours or the like, but it bolstered ex post facto my desire for a self-hosted solution. Furthermore, I don't like the virtual monopoly that GitHub has on the code storing business. I acknowledge the presence of network effects, and the benefits of having a unified gateway to the open-source world. I also know that in some cases, it may be unavoidable. That still doesn't mean that I like it. I have the same problem with any similarly-positioned company, such as npm (an organization with which I have no qualms or for which I have no general dislike), or facebook (that's a different story).

GitLab offered (at the time) virtually all the features that GitHub has, and has continued non-stop to add to its repertoire. Today, it may have surpassed its more popular competitor in available functionalities. It certainly had everything that my coworkers and I needed at my work. So, a few years ago, I recommended to my team at work that we unify our scattered code repositories into our own company GitLab instance. We have had some interesting incidents in getting it running, and in maintaining it, but most of those were in our initial inexperience in installing third-party services. Aside from these, I have had an excellent experience using it, and I will continue to use it at work, and recommend it to others. Because of this success, I decided to use it at home; and (as mentionned earlier) I have done so for the last year.


GitLab is rather resource-intensive. It requires at least 2GB of memory, and runs several processes at once, even when not serving anyone. It can run on a raspberry pi (pretty much the only server available to me with my budget), but it would have to be the only program running on said server. This can easily be justified for a team of developers, but not for me working by myself.

A couple weeks ago, I re-discovered Gogs. When I first explored available solutions (ultimately ending in my choosing GitLab), Gogs was not very well developed (I believe the developer was working mostly by himself at the time) - plus it had a strange name (I'm still not a fan!). Since then, it has progressed significantly. It now offers all the features I need (issue tracker, comments, pull requests, etc), it has greater community support, and the website (main and hosted) has undergone a pretty redesign. Plus (the deciding factor), it can run on my raspberry pi.

So I decided to give it a go (no pun intended). Installation (as per website instruction) was a breeze. Because it modifies the native authorized_keys (ssh) file, I opted to use Gogs' built-in ssh server. The systemd config file had to run the gogs process as root to overcome some authorization issues. I modified the domain in the custom/conf/app.ini file to match mine. After a successful test, I transfered (using their "mirror" tool) all of my repositories over. All in all, the tinkering and testing took an evening. Transfering my repositories took another evening (in hindsight, I probably should have written a script).

So far, it's been working well!

Add a comment

Previous Post Next Post