Skip to content

Latest commit

 

History

History
124 lines (92 loc) · 4.17 KB

README.md

File metadata and controls

124 lines (92 loc) · 4.17 KB

Deploy & Maintain a Gogs Server

A quick guide to Gogs (Git Server) for complete beginners.

contributions welcome HitCount

Why? 🤷‍♂️

You need a simple Git server without the steep learning curve of Git SCM or overhead of running a GitLab instance.

Gogs is a performance-friendly Git web interface written in the Go programming language. It claims to make setting up and managing GIT painless; let's test that!

What? 📦

In our case @dwyl, we are mostly happy with the GitHub service. 👌
Except for a few annoying aspects of the interface and the occasional outage, GitHub is good. We are exploring having a Gogs server running as a hot backup which we can use when GitHub is unavailable or if they ever lose our data!

Who? 🤓

The audience for this guide is "us" @dwyl.
If anyone else finds it helpful that's a bonus.
Please ⭐ the repo if you find it useful. Thanks!

How? 👩‍💻

There are several options for running Gogs:

  1. Directly on your main machine/workstation - can be advantageous in terms of setup speed, but clutters your main machine with a server that requires resources + maintenance.

  2. On your machine using Docker - provides good isolation/separation, reasonably fast startup times and can be easily "killed" when no longer needed.

  3. On a secondary computer e.g. RaspberryPi - complete isolation, more "hackable" and simulates production more closely. Obviously having a second machine is a luxury not everyone has. But we figure a $15 RasbperryPi Zero is not a stretch for most people doing DevOps.

  4. On 3rd Party/Cloud Service e.g. AWS or Fly.io - perfect once you have decided Gogs is for you and you want a Production instance for your project. We use Fly.io because it's:
    a) Simplicity: deploying to Fly.io is much simpler than other VPS/Cloud services (AWS!).
    b) Cheaper than an equivalent ($2/month)
    c) Our main app already runs on Fly.io so having the Gogs/Git server co-located is good for latency/speed/performance.

We chose to install Gogs on a RaspberryPi for 3 reasons:
a) Keeps it fully isolated on a separate machine. Which simulates "production".
b) Allows us to test connecting to it over a network. i.e. real world tests.
c) Means we can run the instance long-term and store actual (backup) data on it.

There are quite a few steps for setting this up, so we documented them in a separate doc. See: /install-gogs-raspberrypi.md

Once we had setup the Gogs server on the RPi with nginx and systemd to auto-boot whenever we restart the RPi, we tested connecting to Gogs on the RPi and documented the steps: /connect-to-raspberrypi.md

Once we confirmed that everything was working on the local RaspberryPi, we felt confident to deploy to Fly.io

Fly.io

Once we had everything working & tested on the RaspberryPi, we felt confident so we deployed a "Production" instance to Fly.io.

See: https://github.com/dwyl/gogs-server


Reading 📚

Pages we read on the journey: