You are here: start » handbook » runbooks » forgejo_upgrade

This is an old revision of the document!


Forgejo

Notes and instructions for working with Forgejo, the self-hosted lightweight software forge.

Upgrading Forgejo (binary)

Follow these steps to upgrade a binary (not Docker) Forgejo installation. These instructions are adapted from the Forgejo upgrade guide and Forgejo installation guide.

0. Prerequisites

SSH to the server with a sudo-capable user account.

1. Back up existing install

Switch to the Forgejo user (usually git), and back up the existing Forgejo installation, then flush the queues. Note that you'll need to specify the config file location, which by default is located at /etc/forgejo/app.ini. Once done, switch back to your sudo-capable user.

sudo -i -u git
forgejo dump --config /etc/forgejo/app.ini
forgejo manager flush-queues --config /etc/forgejo/app.ini
exit

2. Download the latest Forgejo binary

Check https://forgejo.org/download/ for the latest version. Make sure to change the name depending on your processor architecture (most commonly this would be amd64 or arm64).

wget https://codeberg.org/forgejo/forgejo/releases/download/vXX.Y.Z/forgejo-XX.Y.Z-linux-XXX64
chmod +x forgejo-XX.Y.Z-linux-XXX64

3. Stop Forgejo

Stop the running (existing) Forgejo binary.

sudo systemctl stop forgejo.service

4. Copy in the new binary

Copy the newly downloaded Forgejo binary over the existing binary.

sudo cp forgejo-x.y.z-linux-xxx64 /usr/local/bin/forgejo

Update the new binary's file permissions.

sudo chmod 755 /usr/local/bin/forgejo

5. Start Forgejo

Start the newly-replaced Forgejo binary.

sudo systemctl start forgejo.service

6. Make sure it works

Make sure that everything works!

handbook/runbooks/forgejo_upgrade.1759258714.txt.gz · Last modified: 2025-09-30 18:58 UTC
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International