Post

Kiwix/ZIM - Offline Wikipedia

Kiwix/ZIM - Offline Wikipedia

An abstract

There is a multitude of reasons why one would or should consider building a collection of specalized and generalist information available offline, and preserved in time. Whether one’s use case is looking to have a cornacopia of information available without access to the internet (camping, long-haul flights, outages, censorship). There is also a use case around wanting to have a snapshot in time of data that may be altered or lost in the future there.

Kiwix is a very powerful and easy to use tool combined with ZIM files to access wikis offline and are self host-able, either on mobile, desktop or web served. This allows you access to a good selection of pre-built offline copies of various websites or collections of data in a compact and easily viewable size leveraging FOSS software.

You can as of current get a full copy of English Wikipedia around ~100gb, or look at compressed version as small as a few gigs. These can easily be stored on phones, flash media or micro-servers like odriod or Raspberry Pis.

I will follow up with a part 2 about how to create your own ZIM files for a more curated collection of offline data.

The ZIM File Format

About ZIM

ZIM Repos

Methods to run

Mobile/Desktop

Kiwix offers an app for nearly every operating system in multiple flavors. Self contained apps for Andriod, iOS, and Linux. There is also the ability to serve Kiwix as a off-internet webserver leveraging Linux, or Windows.

Raspberry Pi

Kiwix Hotspot installer is a free application that turns a Raspberry Pi into a WiFi Hotspot that serves web content to a local network without Internet access.

Docker

Below is a simple docker-compose you can leverage to self-host a copy of a Kiwix Webserver.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
name: Kiwix
services:
    kiwix-tools:
        ports: 
            - '8081:80' #I prefer to not use port 80 as it is usually used
        volumes:
          - type: bind 
            source: <your_ZIM_file_location>
            target: /kiwix-data
        stdin_open: true
        tty: true
        image: ghcr.io/kiwix/kiwix-tools
        command: >
          sh -c "for i in /kiwix-data/*
                do
                echo $i >&2
                kiwix-manage /kiwix-data/library.xml add $i
                done
                kiwix-serve --library /kiwix-data/library.xml"
This post is licensed under CC BY 4.0 by the author.