How to install and update Gogs (self-hosted Git service) on Synology NAS

For years I have used my Synology NAS with a lightweight Git service called Gogs. Written in Golang, hardware resources friendly and containing only basic functions I need. And with a slick user interface. The problem is the Synology package is unofficial and not maintained. So how to install Gogs and then update to the latest version on Synology NAS?

Things would be much easier if I have newer Synology Diskstation with Docker support. However my Synology Diskstation 214+ doesn’t support Docker. Probably because of slow CPU and low RAM.

On the other hand, it is powerful enough to run Gogs. Think of it like a very simple GitHub or GitLab. No CI/CD features, only Git management, users, teams, mirrors, webhooks wiki, issues and simple tasks. It also supports Git hooks so you can prepare your deployments workflow this way, no matter of missing CI/CD user interface.

If you have Synology with Docker support, feel free to try Gogs in Docker containers. There is also a popular fork called Gitea.




Gogs installation on Synology Diskstation

There is a third party SPK package for Gogs. Installation is very simple even for the not experienced users or developers. Just follow these steps:

  1. Install Git using default Symfony DSM package manager

  2. Install MariaDB the same way

  3. Create a database named gogs. You can use PhpMyAdmin for that.

  4. Go to your Package Center for your Synology DSM, click the Settings button and enable third-party packages.

  5. Now download and install Gogs SPK file for your Synology Diskstation platform. Mine was ARM based.

  6. Run the app from Synology DSM icon and follow the instruction to set up the Gogs.

How to update Gogs to the latest version on your Synology NAS

The problem is the package mentioned above contains an old version of Gogs. Luckily, update is not very hard:

  1. Enable SSH access to your Synology

  2. Download and unpack the latest Linux version of Gogs for your platform (ARM) from the binary packages list.

  3. Unpack the downloaded archive. You should get gogs folder with gogs executable, scripts folder and a pair of readme files.

  4. SSH to your Synology and stop the Gogs service using command:
    synoservicecfg --stop pkgctl-Gogs

  5. Copy the new version to the folder /volume1/@appstore/Gogs/gogs. You will probably need sudo access.

  6. Now start the service again using this command: synoservicecfg --start pkgctl-Gogs

  7. Everything should go smooth and you should see a new Gogs version using your web browser.

Maybe you are asking why I do not use GitLab, GitHub, Bitbucket or other cloud services. I simply do not need them. I just need storage with a simple Git management to be able to work from different places (home & office desk). I do not need sophisticated CI/CD for large projects, I’m happy with PHPloy and some shell scripts.