A lightweight tool to archive websites as ZIM files for offline browsing with Kiwix.
ZIM Site Creator automates:
- Downloading a website with all pages and assets.
- Converting it into a ZIM file with
zimwriterfs. - Cleaning up temporary files.
- Raspberry Pi OS / Debian / Ubuntu
wgetzimwriterfs(included in zim-tools)
Install dependencies on Raspberry Pi:
sudo apt update
sudo apt install wget zim-toolszimwriterfs becomes available after installing zim-tools.
Clone the repository:
git clone https://github.com/MaxHuiskes/Create-Zim-Files.git
cd Create-Zim-Files
chmod +x make_zim.shsudo ./make_zim.sh <site_url> <output_folder> <zim_title> <zim_description> <creator>sudo ./make_zim.sh http://textfiles.com /media/disk2t/data/selfmade \
"Textfiles.com Archive" \
"Archived text files from textfiles.com" \
"textfiles.com"Arguments:
site_url→ website to downloadoutput_folder→ location where the.zimwill be storedzim_title→ title inside ZIM metadatazim_description→ description metadatacreator→ creator metadata
The script deletes the temporary download directory and leaves only the final .zim.
Serve the ZIM files with kiwix-serve:
version: "3.8"
services:
kiwix:
image: ghcr.io/kiwix/kiwix-serve
container_name: kiwix
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- /media/disk2t/data:/data
command: ["--library", "/data/library.xml"]Steps:
- Place
.zimfiles in/media/disk2t/data/. - Update
library.xml:
kiwix-manage /media/disk2t/data/library.xml add /media/disk2t/data/*.zimor to also include subfolders
sudo kiwix-manage /media/kiwix/data/library.xml add $(find /media/kiwix/data -type f -name "*.zim") --zimPathToSave=/data- Start:
docker compose up -d- Access via:
http://<server-ip>:8080
Requires pandoc + texlive:
sudo apt install pandoc texlive-xetex
pandoc docs/explanation.md -o docs/explanation.pdfFork → Change → Pull Request.
MIT License