Testing In-App Updates with a Local CDN
The Tauri updater downloads from CrabNebula CDN in production. To test the full update flow locally (download, install, relaunch), you can run a local server that mimics the CDN.
Prerequisites
- Two copies of the repo: the old version (simulates what the user has installed) and the new version (simulates what they’re updating to)
- A signing keypair for update bundles
1. Generate a Test Signing Keypair
bun tauri signer generate -w ~/.tauri/test-update.key# Press Enter twice for empty passwordThis creates ~/.tauri/test-update.key (private) and ~/.tauri/test-update.key.pub (public).
2. Configure the Old Build to Use Localhost
In the old build’s src-tauri/tauri.conf.json, point the updater at your local server:
"updater": { "endpoints": [ "http://localhost:8888/update/{{target}}-{{arch}}/{{current_version}}" ], "pubkey": "<contents of ~/.tauri/test-update.key.pub>"}3. Build the New Version with Test Signing
From your current repo (the version you want to update to):
TAURI_PRIVATE_KEY="$(cat ~/.tauri/test-update.key)" TAURI_PRIVATE_KEY_PASSWORD="" bun tauri buildIf the build doesn’t generate a .sig file alongside the bundle, sign it manually:
TAURI_PRIVATE_KEY_PASSWORD="" bun tauri signer sign -f ~/.tauri/test-update.key \ src-tauri/target/release/bundle/macos/Thunderbolt.app.tar.gz4. Build the Old Version
From the old repo checkout:
bun tauri build --debug5. Start the Local Update Server
bun run scripts/local-update-server.tsThis serves on port 8888. When the old build’s updater checks for updates, the server:
- Reads the new version from
src-tauri/tauri.conf.json - Returns a 204 (no update) if versions match, or an update manifest pointing at the local bundle
- Serves the
.tar.gzbundle and its signature when the updater downloads it
6. Run the Old Build and Trigger the Update
open path/to/old-build/src-tauri/target/debug/bundle/macos/Thunderbolt.appDon’t drag it to /Applications — run it directly from the build output. Log in, wait for the update notification, click Download, then Restart.
Troubleshooting
- No bundles found: Make sure step 3 completed and
src-tauri/target/release/bundle/macos/contains a.tar.gzfile - Signature mismatch: The pubkey in the old build’s
tauri.conf.jsonmust match the private key used to sign the new build - No update offered (204): The version in the new build’s
tauri.conf.jsonmust be higher than the old build’s version - Server not reachable: Check that nothing else is using port 8888