Gitea is small Git server written in Go that comes with a basic feature set, similar to its resource-hungry cousins GitLab and GitHub.
Since it doesn't need much resources, Gitea is perfect for running on a Raspberry Pi.
We want a special user for gitea, and git-related operations: git
.
(Mostly b/c this will allow us to access repos via ssh with the format git@my-raspi-git
).
So,
## create user
sudo adduser git
## add user to group 'users'
sudo usermod -a -G users git
## create group 'gitusers'
sudo groupadd gitusers
## add 'git' to 'gitusers'
sudo usermod -a -G gitusers git
There are several ways to install Gitea:
- APT (through a few more registries)
- snap
- from source
We will be going over the easiest installation: via apt.
Awesome-Gitea lists 2 package registries for Debian, but we will use the Raspbian Addons, since it's the one explictly made for Raspbian.
The Raspbian installation guide details how to install the additional APT registries.
python3 <(curl -fSsL https://scripts.raspbian-addons.org/utils/repo.py)
This is fine. Just select the default registries and update the cache.
sudo apt update
Installing Gitea is a breeze through APT:
sudo apt install gitea
Installing through snap is equally straightforward, following the installation instructions at snapcraft.io.
Given that snap was installed with
sudo apt install snapd
sudo reboot
sudo snap install core
we install gitea through snap with
sudo snap install gitea
Installing from source following the official guide requires a few more dependencies:
- Go
- npm
- make
- git
The build command is
TAGS="bindata sqlite sqlite_unlock_notify" make build