Every developer knows the feeling: a weird error, a half-remembered answer, and the exact StackOverflow page that would save the day — except you’re offline. StackOverflow deserves to be readable anywhere, with no network required.
Thankfully, Zim’s exist for many important information sources. After much futzing, stackoverflow is up to date now.
- Two complete StackOverflow ZIM archives, live on archive.org right now with every question, answer, comment, and tag page, fully searchable in Kiwix or any ZIM reader:
- The rebuild kit, now public at github.com/johnsmoses/stackoverflow-zim-rebuild — lets anyone rebuild or update the archive from a fresh StackExchange data dump, with all six CI jobs green as of publication.
What’s available
| Archive | Size | Contents |
|---|---|---|
stackoverflow-final.zim |
142 GB (152,103,236,002 bytes) | Full build with images — all 4,375,716 staged images |
stackoverflow-nopic.zim |
69 GB (73,421,904,273 bytes) | Text-only build (--without-images), same pages |
Both archives contain 85,441,337 ZIM entries: 24,152,540 question pages, 65,900 tag pages, and 101 list pages, built in July 2026 from the official StackExchange data dump (SNAPSHOT_ID=2026-07-06). Fully searchable — titles, tags, and full text — in Kiwix or any ZIM reader.
MD5 checksums (July 2026 upload records):
stackoverflow-final.zim:5a2ba64aba5264df6722bfae1eb887b5stackoverflow-nopic.zim:95beed5489d09793051b9f753d220d78
A note on images. 521,489 images failed to stage during the original build. A recovery pipeline brought back 410,856 of them (78.8%) using four sources: the archive.org stack-exchange-images corpus (62 ZIPs, 859 GB), the live CDN, XML dump scans, and an edge resolver. The ones that couldn’t be recovered render as a graceful “External visual asset unavailable” placeholder rather than a broken link.
How it was built
Three weeks, one data dump, and a lot of patience. The build runs on sotoki, the OpenZIM project’s StackOverflow-to-ZIM converter, fed by the official data dump. The pipeline looks like this:
| Stage | What happens |
|---|---|
| Dump & stage | Parse the official XML dump, render every question once to static HTML, catalog image failures |
| Recover images | Match the 521,489 failed hashes against the IA corpus, live CDN, XML scans, and an edge resolver |
| Assemble | Build the ZIM from the stage (--assemble-only) with sanitized titles |
| Verify | Re-derive checksums, compare against the July 2026 baseline |
Differences from base sotoki
The build depends on nine local modifications to sotoki, captured as a patch series (base 157ca9a, v3.0.2):
| Patch | What it does |
|---|---|
| 0001 | Staging/assemble/resume/content-threads CLI options and context fields |
| 0002 | Staged rendering with manifest checkpointing (atomic index.html + manifest.json) |
| 0003 | Assemble-only ZIM builder, Unicode title sanitization (fixes the libzim crash at ~21.7M), staged-HTML fixes |
| 0004 | Offline asset loading (local CSS/favicon), Redis-less tag/user fallback pages |
| 0005 | Bounded sort buffer + SOTOKI_SORT_TMP (fixes the 90 GB sort OOM), throttled Redis pipeline flushes |
| 0006 | Snapshot-aware incremental CLI (--incremental --snapshot-id, --prune-missing, --archive-dir) |
| 0007 | Canonical SHA-256 fingerprint + render-contract versioning — unchanged pages keep identical bytes |
| 0008 | Fresh Redis metadata rebuild (FLUSHDB, never FLUSHALL), incremental-mode metadata passes, opt-in stale-page pruning with audit journals |
| 0009 | Local dump archives via --archive-dir (per-snapshot build dir, forced re-extraction, SHA-256 stamping) |
The rebuild kit
The rebuild-kit repository, github.com/johnsmoses/stackoverflow-zim-rebuild, is now public. It pins the exact sotoki source state (upstream base + the 9-patch series) and provides everything needed to reproduce or update the archive:
- patch series and lockfile (
sotoki.lock), applied and verified by CI; - baseline restore tooling (the July 2026 stage is restorable from a verified bundle);
- the image recovery pipeline (
recovery/modules), dry-run by default; - Docker image workers, assembly verification, release workflow;
- 37+ offline tests that need no redis, libzim, or network.
The core flow is:
make bootstrap → make restore-baseline → make update →
make recover-images → make finalize-placeholders → make assemble → make verify
Point make update at a fresh dump: incremental mode re-renders only what changed, recovery tops up images, and make verify checks against the July 2026 baseline.
Licensing & takedown
- Stack Exchange content (questions, answers, comments, profile text) is CC BY-SA 4.0 — the share-alike obligation applies to the covered content, not to the tooling.
- The sotoki patches are GPL-3.0-only — a derivative of GPL-3.0 sotoki, shipped as patches rather than a fork bundle.
- The rebuild-kit tooling is CC0-1.0, dedicated to the public domain. Third-party image assets are not blanket-licensed; they are included on an availability basis and their rights belong to their actual rightsholders. Being findable on the Internet Archive is not the same as being licensed — availability is not a copyright license.
Try it
Download either ZIM from archive.org and open it in Kiwix — desktop, Android, iOS, or kiwix-serve on a Pi. Search titles, tags, and full text — no network needed.
Where this is going
Updates flow whenever Stack Exchange publishes a new dump; the kit handles the rest. The text-only stackoverflow-nopic.zim is promising material for offline search, RAG, and responsible LLM experimentation — suitability, not a claim of license-free training data; the licensing above still applies.
If you’ve ever wanted a personal, offline, fully searchable copy of StackOverflow — it’s here. And if you want to build your own, the rebuild kit is open.
No affiliation: this is an unofficial project. It is not affiliated with, endorsed by, or sponsored by Stack Overflow / Stack Exchange or the OpenZIM project.
Leave a Reply