Offline & Air-gapped Usage
How to use Zoi in environments with no internet access.
Zoi provides a strict offline mode designed for high-security, air-gapped, or network-restricted environments. This ensures that Zoi never attempts to touch the network and relies entirely on local metadata and pre-cached package archives.
Enabling Offline Mode
To force Zoi to operate without network access, use the global --offline flag with any command:
zoi install my-package --offlineWhen this flag is set:
- No Downloads: Zoi will never attempt to create an HTTP client or download any files.
- Local Metadata: Package version resolution (like
@stable) will skip remote JSON checks and use the information stored in the local SQLite metadata database. - No Git Pulls:
zoi syncand dependency resolution will assume the local registry is the source of truth and skipgit pulloperations.
Provisioning an Offline System
To use Zoi offline, you must first populate the local caches while you have an active internet connection.
1. Sync the Metadata
Run a sync to download the latest .pkg.lua definitions and build the SQLite search index.
zoi sync2. Populate the Archive Cache
You need the actual package binaries (.pkg.tar.zst). You can download these on a machine with internet and move them to the air-gapped system.
Using zoi cache add
If you have a folder of downloaded archives, you can "index" them into Zoi's internal cache:
zoi cache add ./my-downloads/*.pkg.tar.zstUsing --pkg-dir
Alternatively, you can keep your archives in a separate directory and tell Zoi to search it automatically during installation:
zoi install my-package --pkg-dir /mnt/usb/packages --offlineBest Practices for Air-gapped Environments
Registry Bundling
You can bundle an entire Zoi registry (including the Git history and the SQLite .db files) into a compressed archive and extract it into ~/.zoi/pkgs/db/ on the target machine.
Using the Binary Cache
Regularly manage your local archive cache to save space:
zoi cache ls: List all archives currently available for offline install.zoi cache clear: Remove all archives from the local cache.
Sysroot Bootstrapping
You can combine offline mode with the --root flag to bootstrap an entire filesystem from an external drive:
zoi install base linux vim --root /mnt/new-disk --pkg-dir /mnt/usb/archives --offline2026 © All Rights Reserved.
- All the content is available under CC BY-SA 4.0, expect where otherwise stated.
- Source code is available on GitLab, licensed under Apache 2.0.
Last updated on
