A Docker container that automatically downloads and serves ZIM files using Kiwix, with built-in HTTP-based updating capabilities.
- π Automatic Updates: Periodically checks for and downloads new ZIM file versions
- π Library Management: Automatically manages the Kiwix library with downloaded content
- π§Ή Cleanup: Removes old versions and unlisted files to save disk space
- π HTTP-only: Uses HTTP downloads instead of rsync for better compatibility
- β‘ Resume Support: Resumes interrupted downloads automatically
- π Verification: SHA256 checksum verification for downloaded files
Create your docker-compose.yml:
version: '3.8'
services:
kiwix:
image: ghcr.io/egiraffe/kiwix-with-updater:latest
ports:
- "8080:8080"
volumes:
- ./data:/home/app/data
environment:
- UPDATE_INTERVAL_HOURS=24
- KEEP_OLD_VERSIONS=1
- WAIT_FOR_FIRST=1
restart: unless-stoppedThen run:
docker-compose up -dThat's it! The container automatically:
- β Downloads ZIM files based on default configuration
- β Serves them via web interface on http://localhost:8080
- β Updates periodically
- β No manual configuration required
You can configure what to download in two ways:
services:
kiwix:
image: ghcr.io/egiraffe/kiwix-with-updater:latest
environment:
ITEMS: |
wikipedia wikipedia_en_all_maxi_
wiktionary wiktionary_en_all_nopic_
gutenberg gutenberg_en_all_services:
kiwix:
image: ghcr.io/egiraffe/kiwix-with-updater:latest
volumes:
- ./data:/home/app/data
- ./items.conf:/home/app/data/items.confCreate items.conf:
wikipedia wikipedia_en_all_maxi_
wiktionary wiktionary_en_all_nopic_
gutenberg gutenberg_en_all_
| Variable | Default | Description |
|---|---|---|
UPDATE_INTERVAL_HOURS |
24 |
Hours between update checks |
KEEP_OLD_VERSIONS |
0 |
Number of old ZIM versions to keep |
WAIT_FOR_FIRST |
0 |
Wait for first download before starting server |
ITEM_DELAY_SECONDS |
5 |
Delay between processing items |
HTTP_BASE |
https://download.kiwix.org/zim |
Base URL for downloads |
PRUNE_UNLISTED |
0 |
Remove files not in items list |
UNLISTED_GRACE_HOURS |
24 |
Grace period before removing unlisted files |
UNLISTED_DRY_RUN |
0 |
Test mode for unlisted file removal |
PORT |
8080 |
Port for web interface |
version: '3.8'
services:
kiwix:
image: ghcr.io/egiraffe/kiwix-with-updater:latest
ports:
- "8080:8080"
volumes:
- ./data:/home/app/data
environment:
ITEMS: |
wiktionary wiktionary_en_all_nopic_
stack_exchange gardening.stackexchange.com_en_all_
wikipedia wikipedia_en_all_maxi_
gutenberg gutenberg_en_all_
zimit medlineplus.gov_en_all_
other zimgit-post-disaster_en_
UPDATE_INTERVAL_HOURS: 12
KEEP_OLD_VERSIONS: 1
WAIT_FOR_FIRST: 1
PRUNE_UNLISTED: 1
restart: unless-stoppedOnce running, access Kiwix at: http://localhost:8080
docker-compose logs -f kiwixdocker-compose exec kiwix /entrypoint.sh update-nowdocker run -d \
--name kiwix-with-updater \
-p 8080:8080 \
-v "$(pwd)/data:/home/app/data" \
-e UPDATE_INTERVAL_HOURS=24 \
-e KEEP_OLD_VERSIONS=1 \
-e WAIT_FOR_FIRST=1 \
ghcr.io/egiraffe/kiwix-with-updater:latest./data/ # Your host data directory
βββ zim/ # Downloaded ZIM files
β βββ *.zim # ZIM files
β βββ .tmp/ # Temporary download directory
βββ library.xml # Kiwix library file
βββ items.conf # Items configuration (if using file method)
- Check logs:
docker-compose logs kiwix - Verify port 8080 isn't already in use
- Ensure data directory exists
- Check internet connectivity
- Verify ZIM file names in items configuration
- Check available disk space
- Verify port mapping in docker-compose.yml
- Check firewall settings
- Ensure container is running:
docker-compose ps
This project is licensed under the GPL3 License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- π Report issues
- π¬ Discussions