Skip to content
KB4IT Help

Install KB4IT

How-to guide Installation basic
On this page

Before you start

  • GNU/Linux, macOS 13 or newer, or Windows 10 or 11.
  • Python 3.11 or newer: check with python3 --version (on Windows: py --version). uv can install Python for you.

Everything else KB4IT needs (Mako, Markdown, PyYAML, lxml, Rich and Textual) is installed with it.

Install with uv

uv installs KB4IT in its own environment and puts the kb4it command on your path.

On Linux and macOS:

curl -LsSf https://astral.sh/uv/install.sh | sh   # only if you do not have uv yet (or: brew install uv)
uv tool install KB4IT

On Windows, in PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"   # only if you do not have uv yet
uv tool install KB4IT

Open a new terminal afterwards, so the kb4it command is found.

Install with pipx

pipx install KB4IT

Install with pip

pip install --user KB4IT

Tip

uv and pipx keep KB4IT apart from your other Python packages, so an upgrade of one never breaks the other. Prefer them to pip.

Install a Linux package

Each GitHub release has a .deb and an .rpm for x86_64 (amd64) and aarch64 (arm64). They install KB4IT in /opt/kb4it with everything it needs, so the installation works without internet access, and put kb4it in /usr/bin.

On Debian 12 or newer and Ubuntu 24.04 or newer:

sudo apt install ./kb4it_0.9.0_amd64.deb

On Fedora, and on RHEL, Rocky Linux and AlmaLinux 9 or newer:

sudo dnf install ./kb4it-X.Y.Z-1.x86_64.rpm

The package uses a Python from 3.11 to 3.14. On RHEL 9, whose python3 is 3.9, dnf installs python3.11 or python3.12 next to it. Remove the package with sudo apt remove kb4it or sudo dnf remove kb4it.

Run in a container

The image ghcr.io/t00m/kb4it has KB4IT with its extras, for amd64 and arm64, and needs no Python on your machine. Run it from the folder of your knowledge base, which it sees as /work:

docker run --rm -v "$PWD:/work" --user "$(id -u):$(id -g)" ghcr.io/t00m/kb4it:X.Y.Z build config/repo.json

--user makes the files it writes yours. To preview the site while you write, publish the port and listen on every address inside the container:

docker run --rm -p 8642:8642 -v "$PWD:/work" ghcr.io/t00m/kb4it:X.Y.Z serve config/repo.json --host 0.0.0.0

Then open http://127.0.0.1:8642/. With rootless Podman, --userns=keep-id keeps your user ID inside the container, so it can write to the folder and the files stay yours. On hosts with SELinux, such as Fedora and RHEL, also add :Z to the folder so the container may read it:

podman run --rm --userns=keep-id --user "$(id -u):$(id -g)" -v "$PWD:/work:Z" ghcr.io/t00m/kb4it:X.Y.Z build config/repo.json

Use a fixed version such as X.Y.Z, or X.Y for its latest fixes; latest follows every release.

Check the installation

kb4it --version
kb4it themes

kb4it themes lists the themes you can use: apphelp, blog, bookshelf and techdoc.

Upgrade

uv tool upgrade KB4IT      # or: pipx upgrade KB4IT, or: pip install --user -U KB4IT

After an upgrade the next build of each site compiles everything once, because the pages carry the version that made them.

Remove

uv tool uninstall KB4IT    # or: pipx uninstall KB4IT, or: pip uninstall KB4IT

Your knowledge bases are not touched. KB4IT's own data (the list of projects, your custom themes and logs) is in ~/.kb4it/ (%USERPROFILE%\.kb4it on Windows); delete that folder too if you want nothing left.

Windows Subsystem for Linux

KB4IT runs natively on Windows, so WSL is not needed. If you already work inside WSL, install it there as on Linux; the sites it builds open in any Windows browser.

Run the latest code

To try changes that are not released yet:

git clone https://github.com/t00m/KB4IT
cd KB4IT
uv tool install . --force

kb4it --version then adds the git commit, for example KB4IT X.Y.Z (vX.Y.Z-12-gd925c10).