I incorporated some refactors from https://github.com/assarbad/containerized-kiwix-server. Check out this version if you want to use podman and other nice features of this approach (e.g. using make
for some build steps).
# inside the folder where you downloaded the ZIMs (e.g. ~/Downloads)
$ mkdir -p ./dockerized-kiwix-server/zims
$ cp *.zim ./dockerized-kiwix-server/zims
This will create the Linux machine, download the latest version of Kiwix tools (including kiwix-serve
), copy the ZIM files over, then create the Kiwix library XML file.
$ pwd # -> ./dockerized-kiwix-server
$ docker build -t kiwix-serve .
This starts the container and the Kiwix server, and makes it available on your machine at http://localhost:8080
.
$ docker run -d --name kiwix-serve -v $(pwd)/zims:/zims:ro -p 8080:8080 kiwix-serve
To turn it off:
$ docker stop $(docker ps -qf "name=kiwix-serve")
To start it again:
$ docker start kiwix-serve
Go to http://localhost:8080.