Before you begin
- Extensions enabled on the forge.
- A prebuilt package directory containing
extension.json, its executable and itsassets/directory. The executable must run on the host: for the container image, a Linux amd64 executable that is statically linked or built for musl. - Shell access as the forge's service account, with the same configuration and work path as the server.
Package commands
All package commands are subcommands of extensions. Commands that change packages need the forge stopped: while it runs, the host holds the package store lock and the command fails with extension packages are in use: stop Forgejo before changing packages.
| Command | What it does | Forge must be stopped |
|---|---|---|
extensions install DIRECTORY |
Validates and copies a prebuilt package directory into the package store. The package starts disabled. | Yes |
extensions install --replace DIRECTORY |
Replaces an installed package with the same ID, preserving its requested state, installation identity and data. | Yes |
extensions enable ID |
Requests that the package run, from the next start. | Yes |
extensions disable ID |
Requests that the package stop running, from the next start. Required packages cannot be disabled. | Yes |
extensions remove ID |
Deletes the package, its installation identity and its requested state. Private data is kept. Required packages cannot be removed. | Yes |
extensions list |
Prints each installed package as ID, version and enabled, disabled or invalid. |
No |
extensions status ID |
Prints the package's next-start state and manifest-valid or manifest-invalid. |
No |
extensions installation ID |
Prints the package's stable installation UUID, used for background bindings. | No |
extensions prepare, bind, bindings and unbind are covered in Verified extension catalog and Background collaboration.
What installation checks
Installation never runs package code. It refuses the package unless:
extension.jsonis valid for this host; see Package layout and manifest.- The executable exists and is executable, and every page and panel entry exists under
assets/. - The directory contains only regular files and directories: no symbolic links, devices or other special files.
- It has at most 10,000 files and 512 MiB in total.
- The ID is not already installed, unless you pass
--replace.
The package is staged completely before it replaces anything, so a failed install leaves the previous version in place.
Install a package in the container
Stop the forge, run the commands in one-off containers that mount the same volume and the package directory, then start it again:
FOUNTAIN_VERSION=15.0.10-fountain.3
image=ghcr.io/veighnsche/fountain:$FOUNTAIN_VERSION
docker stop fountain
docker run --rm -v fountain-data:/data -v "$PWD/hello:/package:ro" \
"$image" su-exec git forgejo extensions install /package
docker run --rm -v fountain-data:/data \
"$image" su-exec git forgejo extensions enable hello
docker run --rm -v fountain-data:/data \
"$image" su-exec git forgejo extensions status hello
docker start fountain
The status line reads hello, enabled and manifest-valid, separated by tabs, when the package is ready to start.
Install a package with the binary
Stop the service, then run the commands as the service account with the server's configuration and work path. This example assumes a systemd unit named fountain:
sudo systemctl stop fountain
sudo -u git fountain --work-path /var/lib/fountain \
--config /var/lib/fountain/custom/conf/app.ini extensions install ./hello
sudo -u git fountain --work-path /var/lib/fountain \
--config /var/lib/fountain/custom/conf/app.ini extensions enable hello
sudo systemctl start fountain
The install command confirms with Installed hello 1.0.0. Start Forgejo with [extensions] ENABLED = true to activate enabled packages.
Manage packages while the forge runs
Site administrators can enable and disable optional packages at Site administration → Extensions (/admin/extensions) without restarting Fountain.
Open Site administration, then Extensions, to see installed and available packages with their state.
The table shows each package's ID, name, version, state and detail, and marks required and available packages with labels.
- Enable starts an installed package. For a package that a catalog declares but that is not installed yet, the button reads Install and enable: Fountain downloads the pinned archive, verifies it and then starts it.
- Disable stops the package and records that it should stay stopped. It remains available for a package in the
failedstate, so you can clean it up. - Settings appears for an enabled optional package that provides an administration settings page.
- Required packages show no actions.
Fountain accepts one change at a time and returns to the list immediately; the State and Detail columns update as the work progresses. States are disabled, activating, enabled, deactivating and failed. A state marked unconfirmed means the host could not confirm the outcome, and the package is treated as failed until you retry.
Changes made here and with the CLI write the same requested state, which survives restarts. When the forge starts, required packages start first; optional packages are restored afterwards in the background, and a failing optional package is isolated without stopping the forge.
Replace a package
Stop the forge and install the new build with --replace:
docker stop fountain
docker run --rm -v fountain-data:/data -v "$PWD/hello:/package:ro" \
"$image" su-exec git forgejo extensions install --replace /package
docker start fountain
Replacement keeps the package's enabled or disabled state, its installation UUID and everything in .data/hello/.
Remove a package
docker stop fountain
docker run --rm -v fountain-data:/data \
"$image" su-exec git forgejo extensions remove hello
docker start fountain
The command prints hello: package removed; private data retained. Removal retires the installation UUID, so a later installation of the same ID receives a new identity and cannot take over the earlier installation's background operations. Delete .data/hello/ yourself if you no longer need the data.
Troubleshooting
| Symptom | What to check |
|---|---|
extension "hello" is already installed; use --replace to update it |
Use install --replace. |
package symlinks are not supported or package contains a non-regular file |
Copy the package with links resolved before installing. |
extensions list shows invalid |
The manifest no longer validates against this host, or the requested state file is unreadable. Run extensions status ID and check the manifest against Package layout and manifest. |
| The forge stops at startup after installing a package | Two packages claim the same route, or a global route matches an existing account name. Disable or remove one of them. |
A package stays failed |
Read the forge log for the package's start error, fix the package, then Enable again or Disable to clean up. |
Continue
To distribute pinned packages to several forges, set up a verified extension catalog.