Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Offline Wikipedia Wireless Access Point on a Raspberry Pi using Kiwix

Update system
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade
Modify these Settings to Suit
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo raspi-config
sudo raspi-config
sudo raspi-config

Localisation Options > Change Locale

Localisation Options > Change Timezone

Localisation Options > Change Keyboard Layout

Localization Options > Change Wi-fi Country

Download Kiwix Server

https://www.kiwix.org/en/downloads/kiwix-serve/

Copy link for GNU/Linux ARM (32bits)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
wget (paste in url)
wget (paste in url)
wget (paste in url)
Decompress Kiwix Server
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
tar -zxvf kiwix-tools_linux-armhf.tar.gz
tar -zxvf kiwix-tools_linux-armhf.tar.gz
tar -zxvf kiwix-tools_linux-armhf.tar.gz
Install Kiwix Binaries
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo mv kiwix-tools_linux-armhf-3.0.3/* /usr/local/bin/
sudo mv kiwix-tools_linux-armhf-3.0.3/* /usr/local/bin/
sudo mv kiwix-tools_linux-armhf-3.0.3/* /usr/local/bin/
Download Zim File

https://wiki.kiwix.org/wiki/Content_in_all_languages

Copy to server using scp

Copy to /var/local/
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo mv wikipedia_en_simple_all_nopic_2020-02.zim /var/local/
sudo mv wikipedia_en_simple_all_nopic_2020-02.zim /var/local/
sudo mv wikipedia_en_simple_all_nopic_2020-02.zim /var/local/
Create Kiwix Service
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/systemd/system/kiwix.service
sudo nano /etc/systemd/system/kiwix.service
sudo nano /etc/systemd/system/kiwix.service

Paste this in file:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[Unit]
Description=Kiwix Service
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/kiwix-serve /var/local/wikipedia_en_simple_all_nopic_2020-02.zim -p 80
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
[Unit] Description=Kiwix Service After=network.target [Service] Type=simple User=root Group=root ExecStart=/usr/local/bin/kiwix-serve /var/local/wikipedia_en_simple_all_nopic_2020-02.zim -p 80 Restart=always RestartSec=3 [Install] WantedBy=multi-user.target
[Unit]
Description=Kiwix Service
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/kiwix-serve /var/local/wikipedia_en_simple_all_nopic_2020-02.zim -p 80
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Control-o to save and control-x to exit (use this to exit and save nano)

Enable and Start Kiwix Service
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo systemctl enable kiwix
sudo systemctl enable kiwix
sudo systemctl enable kiwix
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo systemctl start kiwix
sudo systemctl start kiwix
sudo systemctl start kiwix
Assign Static IP to wlan0
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/dhcpcd.conf
sudo nano /etc/dhcpcd.conf
sudo nano /etc/dhcpcd.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface wlan0
static ip_address=192.168.1.1/24
nohook wpa_supplicant
interface wlan0 static ip_address=192.168.1.1/24 nohook wpa_supplicant
interface wlan0
     static ip_address=192.168.1.1/24
     nohook wpa_supplicant
Commit Changes to dhcpcd
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo systemctl daemon-reload
sudo systemctl restart dhcpcd
sudo systemctl daemon-reload sudo systemctl restart dhcpcd
sudo systemctl daemon-reload
sudo systemctl restart dhcpcd
Install dnsmasq (DNS and DHCP Server)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo apt install dnsmasq
sudo apt install dnsmasq
sudo apt install dnsmasq
Make Backup of dnsmasq.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
Edit dnsmasq.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/dnsmasq.conf
sudo nano /etc/dnsmasq.conf
sudo nano /etc/dnsmasq.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface=wlan0
dhcp-range=192.168.1.2,192.168.1.254,255.255.255.0,24h
address=/#/192.168.1.1
interface=wlan0 dhcp-range=192.168.1.2,192.168.1.254,255.255.255.0,24h address=/#/192.168.1.1
interface=wlan0
dhcp-range=192.168.1.2,192.168.1.254,255.255.255.0,24h
address=/#/192.168.1.1
Install hostapd (WiFi Access Point Software)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo apt install hostapd
sudo apt install hostapd
sudo apt install hostapd
Edit hostapd.conf
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/hostapd/hostapd.conf
sudo nano /etc/hostapd/hostapd.conf
sudo nano /etc/hostapd/hostapd.conf
Config for Password Protected WiFi Access Point
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface=wlan0
driver=nl80211
ssid=kiwix
hw_mode=g
channel=6
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=password
interface=wlan0 driver=nl80211 ssid=kiwix hw_mode=g channel=6 wmm_enabled=0 macaddr_acl=0 auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP wpa_passphrase=password
interface=wlan0
driver=nl80211
ssid=kiwix
hw_mode=g
channel=6
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=password
Config for Open WiFi Access Point
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
interface=wlan0
driver=nl80211
ssid=kiwix
hw_mode=g
channel=6
interface=wlan0 driver=nl80211 ssid=kiwix hw_mode=g channel=6
interface=wlan0
driver=nl80211
ssid=kiwix
hw_mode=g
channel=6
Additional Online Resources for WiFi Setup

https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md

https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf

Enable WiFi Setup
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo nano /etc/default/hostapd
sudo nano /etc/default/hostapd
sudo nano /etc/default/hostapd
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
DAEMON_CONF="/etc/hostapd/hostapd.conf"
DAEMON_CONF="/etc/hostapd/hostapd.conf"
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Commit Changes to hostapd and dnsmasq
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo systemctl daemon-reload
sudo systemctl unmask hostapd
sudo systemctl enable hostapd dnsmasq
sudo systemctl start hostapd dnsmasq
sudo systemctl daemon-reload sudo systemctl unmask hostapd sudo systemctl enable hostapd dnsmasq sudo systemctl start hostapd dnsmasq
sudo systemctl daemon-reload
sudo systemctl unmask hostapd
sudo systemctl enable hostapd dnsmasq
sudo systemctl start hostapd dnsmasq
Enable Read Only System (Optional)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo raspi-config
sudo raspi-config
sudo raspi-config

Advanced Options > Overlay FS

Choose “Yes” to enable overlay file system and/or “Yes” to write protect boot partition.

Leave a comment

Your email address will not be published. Required fields are marked *