Table of Contents

Suppose you are running your laptop without Internet connection, but somehow still want to look up a specific topic in Wikipedia. For Linux users, one way to work around is to set up a local server using kiwix-serve to serve offline contents. Here are the steps. Note that Internet is required to download the program and associated ZIM files.

screenshot of kiwix

Step 1 Download kiwix-tools

You can use pre-built binaries or compile from source.

curl -L | tar -xz

For information on manual compilation, please visit official Github repository.

Step 2 Download ZIM files

The full list can be found here. Feel free to choose topics you need in various languages. Below is a simple example.

curl -LO

Step 3 Create a dedicated user and move all downloaded files to the user’s home directory

export KIWIX_PREFIX=/opt/kiwix
useradd -d $KIWIX_PREFIX -Mrs /sbin/nologin kiwix
mkdir -p $KIWIX_PREFIX/{bin,data}
mv kiwix-tools_linux-x86_64-3.1.2/* bin
mv *.zim data

Step 4 Generate a list for all ZIM files

$KIWIX_PREFIX/bin/kiwix-manage $KIWIX_PREFIX/data/library.xml add $KIWIX_PREFIX/data/*.zim

Step 5 Run the program

sudo -u kiwix $KIWIX_PREFIX/bin/kiwix-serve \
    --library $KIWIX_PREFIX/data/library.xml \
    --address --port 8080

Note that port under 1024 requires root access. More options are available via $KIWIX_PREFIX/bin/kiwix-serve --help.

Now go to and enjoy your offline wiki!

Here is a minimal template for systemd if the program should be launched at startup:


ExecStart=/opt/kiwix/bin/kiwix-serve --library /opt/kiwix/data/library.xml --address --port 8080 --daemon