Running Wikipedia offline

This post explains how to run Wikipedia offline on Linux inside a Docker container.

Prerequisites (not explained here):

  • a web browser to access the offline copy
  • a Linux server connected to your network
  • Docker on the Linux server

1. Download a ZIM archive of Wikipedia. In this example I used wikipedia_en_all_maxi_2023-11.zim. You can find the latest version at the Wikipedia dumps [DUMP], but, if possible, just use this as an index to locate the file name and download it over Bittorrent or google the exact file name [GOO] for an alternative download location in order to save Wikipedia some traffic. Remember where you downloaded the file to, in my example it is “/home/george/Downloads”.

2. Save this script somewhere as “run.sh”:

#!/bin/bash

dump_path="/home/george/Downloads"
dump_file="wikipedia_en_all_maxi_2023-11.zim"

docker run -d --restart=always \
--volume "$dump_path:/data" \
--name kiwix \
-p 7070:80 \
kiwix/kiwix-serve:latest \
"/data/$dump_file"

3. make the script runnable: chmod u+x run.sh

4. run the script: ./run.sh

5. Your personal offline Wikipedia copy is now accessible at http://servername:7070

You can troubleshoot the installation by looking at the console outputs with:

docker logs -f kiwix

Resources

[DUMP] https://dumps.wikimedia.org/kiwix/zim/wikipedia/

[GOO] https://www.google.com/search?q=%22wikipedia_en_all_maxi_2023-11.zim%22

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.