This is a guide to using Gollum (Git-powered wiki with browser frontend) to run a local wiki with certain requirements:
- Use latest stable version of Gollum (5.3.2 as of this writing)
- in a container
- with Podman, not Docker
- in rootless mode
- on a SELinux-enabled distro (Fedora 38)
- via a systemd user service
- Use a CommonMark-compliant parser (
commonmarker
0.23.9) instead of the defaultkramdown
- Store Gollum config in the same place as wiki contents
We will use this branch as the basis of a new wiki, with some example config included.
-
Clone this branch to
~/wiki
. This will be your wiki.git clone -b example --depth 1 https://github.com/jn64/gollum.git ~/wiki
-
Reset the git history (you don't need your wiki to be linked to this repo):
cd ~/wiki rm -rf ~/wiki/.git git init -b main git add -A git commit -m init
-
Build custom Gollum image that includes commonmarker instead of kramdown:
podman build -t gollum:v5.3.2-commonmark https://github.com/jn64/gollum.git#v5.3.2-commonmark
The resulting image is
localhost/gollum:v5.3.2-commonmark
(checkpodman images
). -
Create a container with this custom image:
podman run --name gollum -d --rm --security-opt label=disable -v "${HOME}/wiki":/wiki -v "${HOME}/wiki/.gollum":/etc/gollum -p 4567:4567 localhost/gollum:v5.3.2-commonmark --config /etc/gollum/config.rb
Test it by opening http://localhost:4567 in your browser. Make sure it works (edit, create new page, etc).
-
Generate systemd service from the running container's configuration:
podman generate systemd -n --new gollum | sed -E -e '/^(Wants|After)=network-online.target$/ d' > ~/wiki/.gollum/container-gollum.service
(The
sed
removes an unnecessary dependency onnetwork-online.target
) -
Stop the container:
podman container stop gollum
-
Install and enable the user service:
systemctl --user enable --now ~/wiki/.gollum/container-gollum.service
Done. Now the Gollum container will run automatically on your user login.
For convenience, pin or bookmark http://localhost:4567 in your browser.