I was getting a bit tired of manually upgrading Gitea, so I initially considered writing an Ansible playbook to automate the process.
However, after some research, I discovered Gitea’s fantastic feature of hosting Debian repositories and decided to build my own APT repository instead.
Since this is my first time building a Debian package, it’s far from perfect, but I plan to improve it over time. Currently:
No package signing yet (will be added later)
No user or config files are created
It simply replaces the binary under /opt/gitea/bin/
Comes with a systemd unit that expects Gitea to run under the gitea user
How to Install
If you want to try it, just add the following line to /etc/apt/sources.list.d/gitea.list: deb [trusted=yes] https://git.24unix.net/tracer/gitea-deb/raw/branch/apt-repo/ ./
Then update and install: apt update && apt install gitea
If you prefer not to install binaries from a third party (which I totally understand – I’m neither a Debian maintainer nor affiliated with Gitea), you can build the packages yourself.
Just clone:
Maybe someone finds this useful!
Edit: There a currently packages for AMD64 and ARM64.
I wanted to share an update on the Debian repository I posted about earlier!
I’ve reorganized things and added a second dedicated repository just for building the .deb packages.
This separation keeps the release repository (gitea-deb) clean and focused, while the new gitea-deb-builder handles the automated fetching, verifying, and packaging process.
The current setup only handles final releases — it does not automatically package release candidates (RC) or pre-release versions.
For example, there’s an RC out right now that’s not picked up by my build script.
If there’s enough interest, I might extend the script to optionally include RC builds in a separate repo or section.
As before, the .deb packages currently:
Replace only the binary under /opt/gitea/bin/
Expect the systemd unit to run Gitea under the gitea user
Do not include package signing (yet; planned for later)
If you’re using the APT repo, the install line remains:
deb [trusted=yes] https://git.24unix.net/tracer/gitea-deb/raw/branch/apt-repo/ ./
Let me know if you’re interested in seeing RC or nightly builds included!
And thanks again to the Gitea team for making it so easy to hook into.
If you prefer to build the packages yourself, the build scripts and setup are available here: gitea-deb-builder repository
Just a quick hint, I forgot to think about the apt-repo line.
The branch has changed, it’s now
deb [trusted=yes] https://git.24unix.net/tracer/gitea-deb/raw/branch/master/ ./
The latest stable version 1.23.8 is now available.
Edit: As I cannot edit my first post any longer, could any admin or mod change the apt src in the first post or add a note that there were follow up posts with additional information?
time for another update on the Debian packages. Quite a bit has changed:
Signed APT repository. The packages are now published in the Debian package registry of my Gitea instance, so the repository is signed and trusted=yes is no longer needed.
One repository per package. I merged the separate builder repositories back in; build scripts and packages now live together:
gitea-deb – Gitea
gitea-runner-deb – Gitea Runner
gitea-cli-deb – new: gt, the new Gitea CLI
New package gitea-cli. It installs /usr/bin/gt plus completions for bash, zsh and fish. The upstream checksums are verified against their signature. Note that it conflicts with Debian’s genometools, which also ships /usr/bin/gt. gt needs Gitea 28 or newer on the server.
The systemd units moved from /etc/systemd/system/ to /usr/lib/systemd/system/. On upgrade, the old unit is kept as *.service.dpkg-old. If you changed it, move your changes into a drop-in (systemctl edit gitea).
Requires=mariadb.service was removed from the Gitea unit. If your Gitea uses a local MariaDB, add a drop-in:
[Unit]
Requires=mariadb.service
After=mariadb.service
The Gitea package now creates the gitea system user if it doesn’t exist. Existing users are kept.
The maintainer scripts no longer call systemctl directly, so the packages also install in containers and chroots. A failed upgrade starts the service again.
Please upgrade: the older packages installed their files owned by uid 5001, the build user, instead of root. The new versions ship root-owned files and hand the affected directories back on upgrade.
Each version also gets a release in the repository, with both architectures attached and the SHA256 sums in the release notes.
Packages are published for the current Debian stable (trixie at the moment).
If you use the old source (deb [trusted=yes] https://git.24unix.net/tracer/gitea-deb/raw/branch/master/ ./ or the gitea-runner-deb one): it keeps working until the end of 2026, then it goes away. Please remove that line and add the registry source above.
As before: if you’d rather build the packages yourself, everything is in the repositories, and each README explains how.
Maybe they don’t differ much at all.
I was not aware of that repo, that is the reason why I built one for my personal usage and just wanted to share it.