3.0 KiB
Gitea Updater for Ubuntu 24.04 Server
Update Gitea on Ubuntu 24.04 server.
Not a demo, not a quick hack.
This updater is designed for production systems.
Why this updater exists
Keeping Gitea updated should be simple, safe, and predictable.
This script updates the shared Gitea binary and restarts only the instances that were running, leaving stopped instances untouched.
No menus. No guesswork. No surprises.
What this updater does
✔ Detects installed and latest Gitea version
✔ Skips update if already current
✔ Downloads and replaces binary safely
✔ Backs up previous binary automatically
✔ Restarts only running Gitea services
✔ Logs all activity for auditing
What this updater does NOT do
It won’t stop you from running the script without reading the documentation like there’s no tomorrow. Skip the README, and whatever happens next is your headache, not a bug report.
Compatibility
This updater is guaranteed to work on systems installed using:
Other installation methods may use different paths, service names, or layouts.
You are free to modify the script if your environment differs.
1. Clone
git clone https://git.x-files.dk/webapps/gitea-updater-ubuntu.git
cd gitea-updater-ubuntu
2. Install the updater
sudo install -m 755 giteaupdate /usr/local/sbin/giteaupdate
3. Run manually
sudo giteaupdate
All activity is logged to:
/var/log/gitea/gitea-update.log
Backups are stored in:
/var/log/gitea/
Optional: Automatic Updates (Cron)
Create:
/etc/cron.d/giteaupdate
Example:
#
# Gitea automatic updater
# Runs weekly to keep Gitea current
#
# Minute Hour Day Month DayOfWeek User Command
5 5 * * 5 root /usr/local/sbin/giteaupdate >/dev/null 2>&1
File Locations
| Path | Purpose |
|---|---|
/usr/local/bin/gitea |
Gitea binary |
/var/log/gitea/gitea-update.log |
Update log |
/var/log/gitea/ |
Backup binaries |
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| Update fails | Network issue | Re-run script |
| Service not starting | Config or system issue | systemctl status gitea* |
| No update performed | Already current | Expected behavior |
More Information
More guides and documentation can be found on wiki.x-files.dk
License
Licensed under the MIT License.