Notes and instructions for upgrading Forgejo, the self-hosted lightweight software forge.
Follow these steps to upgrade a binary (not Docker) Forgejo installation. These instructions are adapted from the Forgejo upgrade guide and Forgejo installation guide.
SSH to the server with a sudo-capable user account.
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
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
Stop the running (existing) Forgejo binary.
sudo systemctl stop forgejo.service
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
Start the newly-replaced Forgejo binary.
sudo systemctl start forgejo.service
Make sure that everything works!