Skip to content

LeafWiki

LeafWiki

License: MIT

This guide is tested with LeafWiki 0.12.0 on Uberspace 8.0.85. We can't guarantee it to work with newer versions.

LeafWiki is an open-source wiki app without the heavy stack. It consists of a single Go binary and uses SQLite databases solely to power a few core features. All content is stored on disk as .md files, which are readable in any editor, searchable with grep, and movable without exporting.


Note

For this guide you should be familiar with the basic concepts of:

Installation

Create a new directory ~/leafwiki and change into it:

[isabell@moondust ~]$ mkdir ~/leafwiki
[isabell@moondust ~]$ cd ~/leafwiki

Now download the latest version of the binary, rename it, and make it executable:

[isabell@moondust leafwiki]$ wget "https://github.com/perber/leafwiki/releases/download/v0.12.0/leafwiki-v0.12.0-linux-amd64"
--2026-08-02 11:32:40--  https://github.com/perber/leafwiki/releases/download/v0.12.0/leafwiki-v0.12.0-linux-amd64
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
[...]
leafwiki-v0.12.0-linux-amd64        100%[================================================================>]  40.73M   244MB/s    in 0.2s

2026-08-02 11:32:41 (244 MB/s) - β€˜leafwiki-v0.12.0-linux-amd64’ saved [42713250/42713250]
[isabell@moondust leafwiki]$ mv leafwiki-v0.12.0-linux-amd64 leafwiki
[isabell@moondust leafwiki]$ chmod +x leafwiki

Create the data directory and an .env file inside it:

[isabell@moondust leafwiki]$ mkdir data
[isabell@moondust leafwiki]$ touch .env

Configuration

LeafWiki requires some configuration in the .env file you just created. The following represents a basic configuration. You can find all available options in the official repository.

Note

You can use the following command to create a secret for the LEAFWIKI_JWT_SECRET option:

[isabell@moondust ~]$ LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 64; echo
hbCt1GeNfSGD9RxJjnRFi7jZNzQza8dcmvDxy5zqMshF7S6XaOLwvL9pKUOpyEb
LEAFWIKI_HOST=0.0.0.0
LEAFWIKI_PORT=8080
LEAFWIKI_DATA_DIR=./data
LEAFWIKI_ADMIN_PASSWORD="change_me_soon"
LEAFWIKI_JWT_SECRET=""
LEAFWIKI_ENABLE_REVISION=true
LEAFWIKI_LOG_LEVEL=warn

Warning

After logging in for the first time, immediately change the default password (change_me_soon) via the web interface.

Setup Systemd

Create a service:

[isabell@moondust ~]$ uberspace service add leafwiki "$HOME/leafwiki/leafwiki" --workdir "$HOME/leafwiki"

To use our .env file, add the following line below [Service] in the ~/.config/systemd/user/leafwiki.service file:

EnvironmentFile=%h/leafwiki/.env

Run the following commands to reload the daemon and restart the service:

[isabell@moondust ~]$ systemctl --user daemon-reload
[isabell@moondust ~]$ systemctl --user restart leafwiki

Setup Web Backend

Note

The default port for LeafWiki is 8080.

To make the application accessible from the outside, configure a web backend:

[isabell@moondust ~]$ uberspace web backend add / port 8080 --force
OK: Added webbackend '/' to your Asteroid

If LeafWiki is running, you can now access it at https://isabell.uber.space.

Updates

Note

Check the update feed regularly.

To update the software, download the latest version and replace the binary (leafwiki). Also check the release notes to see whether there's anything you need to be aware of. Then restart the service (systemctl --user restart leafwiki).

You can also update via the command line. To do so, create ~/bin/leafwiki-update.sh with the following content:

#!/bin/bash 
####################################################################
# LeafWiki update script                                           #
# based on: https://github.com/perber/leafwiki/blob/main/update.sh #
# as of: August, 2026                                              #
####################################################################

VERSION=""
PATH_TO_BINARY="${HOME}/leafwiki/leafwiki"

get_latest_version(){
    if [[ -z "${VERSION}" ]]; then
        LATEST_VERSION=$(curl -sL -H "User-Agent: bash-update-script" https://api.github.com/repos/perber/leafwiki/releases/latest | jq -r '.tag_name | ltrimstr("v")')

        if [[ -z "${LATEST_VERSION}" || "${LATEST_VERSION}" == "null" ]]; then
            echo "Failed to determine the latest LeafWiki version from GitHub." >&2
            exit 1
        fi

        VERSION=${LATEST_VERSION}
    fi
}

download_binary(){
    TMP_FILE="${HOME}/tmp/leafwiki-v${VERSION}-linux-amd64"
    mkdir -p "${HOME}/tmp"
    wget -O "${TMP_FILE}" "https://github.com/perber/leafwiki/releases/download/v${VERSION}/leafwiki-v${VERSION}-linux-amd64" || {
        echo "Download failed. Aborting update." >&2
        exit 1
    }

    if [ ! -s "${TMP_FILE}" ]; then
        echo "Downloaded file is empty. Aborting update." >&2
        rm -f "${TMP_FILE}"
        exit 1
    fi

    cp "$PATH_TO_BINARY" "${PATH_TO_BINARY}.bak" || {
        echo "Could not create backup of the current binary. Aborting update." >&2
        rm -f "${TMP_FILE}"
        exit 1
    }

    if ! mv "${TMP_FILE}" "${PATH_TO_BINARY}"; then
        echo "Installation of the new binary failed. Restoring backup." >&2
        cp "${PATH_TO_BINARY}.bak" "${PATH_TO_BINARY}"
        rm -f "${TMP_FILE}"
        exit 1
    fi

    chmod +x "${PATH_TO_BINARY}"
}

if [[ ! -x "${PATH_TO_BINARY}" ]]; then
    echo "LeafWiki is not present or not executable in ${PATH_TO_BINARY}. Aborting update." >&2
    exit 1
fi

echo "----------------------------------------"
echo "LeafWiki update in progress..."

get_latest_version
systemctl --user stop leafwiki
download_binary
systemctl --user start leafwiki

echo "...update completed!"
echo "New version: ${VERSION}"
echo "----------------------------------------"

Make the script executable:

[isabell@moondust ~]$ chmod +x ~/bin/leafwiki-update.sh