{"id":1241,"date":"2025-10-06T18:00:46","date_gmt":"2025-10-06T16:00:46","guid":{"rendered":"https:\/\/sven-seeberg.de\/wp\/?p=1241"},"modified":"2025-10-07T12:41:37","modified_gmt":"2025-10-07T10:41:37","slug":"offline-wikipedia-wlan-access-point-with-raspberry-pi","status":"publish","type":"post","link":"https:\/\/sven-seeberg.de\/wp\/?p=1241","title":{"rendered":"Offline Wikipedia Hotspot on Raspberry Pi"},"content":{"rendered":"\n<p>Recently, I pondered what would happen in case of a black out \/ internet outage and noticed that I would not even have that much material to read, as books are less and less common, including encyclopedias. Luckily, I discovered the <a href=\"https:\/\/kiwix.org\/\">Kiwix<\/a> project, which I really like. It allows downloading full dumps of all <a href=\"https:\/\/www.mirrorservice.org\/sites\/download.kiwix.org\/zim\/wikipedia\/\">Wikipedia articles<\/a> in many languages and serve them in the local network. Other <a href=\"https:\/\/www.mirrorservice.org\/sites\/download.kiwix.org\/zim\/\">wikis\/sites<\/a> are available as well.<\/p>\n\n\n\n<p>As large power banks, laptop batteries and other sources of energy are nowadays available in large quantities, I explored the idea of using a Raspberry Pi as a low power consumption WLAN access point that serves Wikipedia dumps with <a href=\"https:\/\/github.com\/kiwix\/kiwix-tools\">kiwix-tools<\/a>.<\/p>\n\n\n\n<p>Currently, I&#8217;m using a Raspberry Pi 3 with only 1GB of memory. I inserted a 256GB SD card that can easily contain a dump of the English and German Wikipedia including images.<\/p>\n\n\n\n<p>If you want to set up your own hotspot &amp; Wikipedia server, use the following procedure:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Download the .zim files you like, for example <a href=\"https:\/\/www.mirrorservice.org\/sites\/download.kiwix.org\/zim\/wikipedia\/wikipedia_en_all_maxi_2025-08.zim\">wikipedia_en_all_maxi_2025-08.zim<\/a>.<br><code>mkdir wikipedia<br>cd wikipedia<br>wget <a href=\"https:\/\/www.mirrorservice.org\/sites\/download.kiwix.org\/zim\/wikipedia\/wikipedia_en_all_maxi_2025-08.zim\">https:\/\/www.mirrorservice.org\/sites\/download.kiwix.org\/zim\/wikipedia\/wikipedia_en_all_maxi_2025-08.zim<\/a><\/code><\/li>\n\n\n\n<li>Install the kiwix-tools package and also dnsmasq:<br><code>sudo apt install kiwix-tools dnsmasq tmux<\/code><\/li>\n\n\n\n<li>Create a Kiwix Library and add the downloaded ZIM file:<br><code>kiwix-manage lib.xml add wikipedia_en_all_maxi_2025-08.zim<\/code><br>You can add additional files, if you like.<\/li>\n\n\n\n<li>To set up a WLAN hotspot with NetworkManager, run <code>sudo raspi-config<\/code> and select NetworkManager to manage your network config.<\/li>\n\n\n\n<li>Add a usable domain to the \/etc\/hosts file, for example wikipedia.local. Replace the IP address with the IP address of your Raspberry Pi. AFAICT NetworkManager will use 10.42.0.1\/24:<br><code>sudo bash -c 'echo \"10.42.0.1 wikipedia.local\" &gt;&gt; \/etc\/hosts'<\/code><\/li>\n\n\n\n<li>NetworkManager internally uses dnsmasq as a DNS server when configuring a hotspot. However, it will not use the \/etc\/hosts file to serve local domain names. Therefore disable the internal dnsmasq by adding the line <code>dns=none<\/code> in the <code>[main]<\/code> section of the <code>\/etc\/NetworkManager\/NetworkManager.conf<\/code> file.<\/li>\n\n\n\n<li>Start and enable dnsmasq:<br><code>systemctl start dnsmasq.service<br>systemctl enable dnsmasq.service<\/code><\/li>\n\n\n\n<li>Start the hotspot:<br><code>nmcli device wifi hotspot ssid wikipedia.local password \"YOUR_SECRET\"<\/code><br>This command prints a UUID, which you need for additional configuration. You can later always retrieve the UUID with <code>nmcli con show --active<\/code>.<\/li>\n\n\n\n<li>Optionally: if you want to make the Hotspot available to neighbors, you can disable the WLAN security\/password. Additionally, you can (should) disable routing into your private LAN, if the Pi is connected via network cable.<br><code>sudo nmmtui-edit<br><\/code><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"485\" class=\"wp-image-1248\" style=\"width: 600px;\" src=\"https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13.png\" alt=\"Use nmtui-\" srcset=\"https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13.png 1041w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13-300x243.png 300w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13-1024x828.png 1024w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13-768x621.png 768w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/Screenshot-from-2025-10-06-18-10-13-371x300.png 371w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br>If you want to always start the WLAN network, check the &#8220;Automatically connect&#8221; option.<\/li>\n\n\n\n<li>Start the hotspot with <br><code>nmcli connection up $(nmcli con show --active | grep wifi | awk '{print $2}')<\/code><\/li>\n\n\n\n<li>Create a systemd service for Kiwix and start it. Run <code>sudo nano \/etc\/systemd\/system\/kiwix.service<\/code> and add the following content:<br><code>[Unit]<br>Description=Kiwix Serve<br>After=network-online.target<br>Wants=network-online.target<br>[Service]<br>ExecStart=\/usr\/bin\/kiwix-serve --port 80 --library \/home\/pi\/wikipedia\/lib.xml<br>Restart=always<br>RestartSec=15<br>[Install]<br>WantedBy=multi-user.target<\/code><\/li>\n\n\n\n<li>Start and enable the service:<br><code>systemctl daemon-reload<br>systemctl start kiwix.service<br>systemctl enable kiwix.service<\/code><\/li>\n<\/ol>\n\n\n\n<p>You should now be able to connect to the wikipedia.local hotspot and open http:\/\/wikipedia.local (not https!) in any device that has a browser (for example smartphone).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"464\" height=\"1024\" src=\"https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002-464x1024.png\" alt=\"\" class=\"wp-image-1252\" srcset=\"https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002-464x1024.png 464w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002-136x300.png 136w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002-768x1695.png 768w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002-696x1536.png 696w, https:\/\/sven-seeberg.de\/wp\/wp-content\/uploads\/2025\/10\/signal-2025-10-06-183704_002.png 928w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/figure>\n\n\n\n<p>Worth noting: kiwix.org <a href=\"https:\/\/kiwix.org\/en\/kiwix-hotspot\/\">sells ready to use hotspots<\/a>, which probably directly supports the project.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, I pondered what would happen in case of a black out \/ internet outage and noticed that I would not even have that much material to read, as books are less and less common, including encyclopedias. Luckily, I discovered &hellip; <a href=\"https:\/\/sven-seeberg.de\/wp\/?p=1241\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1241","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1241"}],"version-history":[{"count":23,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions"}],"predecessor-version":[{"id":1271,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions\/1271"}],"wp:attachment":[{"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sven-seeberg.de\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}