Using Tauri's System Webview to Keep Desktop Binaries Small
Learn how Tauri uses the host OS webview to avoid bundling Chromium, how to verify the backend in use, and how to handle missing webview dependencies at deployment.
07 Feb 2026, 20:33 UTC

Desired outcome
Create a Tauri desktop application that renders with the host operating system's webview instead of bundling Chromium, then confirm the correct backend at runtime and verify the resulting binary is far smaller than an Electron equivalent.
Prerequisites
- Rust stable toolchain installed.
- Tauri CLI (installed via
cargo install tauri-cli), version 1.x or later. - A target machine with the appropriate system webview: Windows 10 1809+ with the WebView2 runtime, macOS 10.15+ (WKWebView is built in), or a Linux distribution with WebKitGTK (typically the
webkit2gtk-4.0package). - Basic familiarity with a terminal and
cargocommands.
Procedure
- Create a minimal project. Run this in the directory where you want the project:
cargo create-tauri-app my-tauri-app cd my-tauri-appFollow the prompts; any template works for this exercise.
- Confirm the default webview configuration. Open
src-tauri/tauri.conf.json. Tauri uses the system webview by default, so no change is required. If you want to be explicit, the bundler section can note it:{ "bundler": { "webview": "system" } } - Run the dev server and inspect the backend. From the project root, run:
cargo tauri devThis requires no special permissions; it starts a dev server and opens a window. Open the webview's developer tools (right-click and inspect, or the usual F12 shortcut where supported) and run in the console:
navigator.userAgentThe string reveals the backend:
Edg-flavored Chromium tokens indicate WebView2 on Windows, a Safari-like token indicates WKWebView on macOS, and WebKitGTK builds surface their own identifiers on Linux. - Build a release binary. Run:
cargo tauri buildArtifacts land under
src-tauri/target/release/bundle/. A release build can take several minutes on the first run because dependencies compile in release mode. - Measure the binary size. On Linux or macOS:
ls -lh src-tauri/target/release/bundle/On Windows, use
diron the equivalent path. A minimal Tauri app is typically well under 10 MB, compared with 100 MB or more for a comparable Electron bundle, because no Chromium runtime is shipped. - Test on a machine without the webview (optional). Copy the release artifact to a clean Windows machine lacking WebView2. On launch, Tauri prompts the user to install the WebView2 runtime. On Linux without WebKitGTK, the binary fails to start with a missing shared-library error. Either result confirms the dependency on the host webview rather than an embedded engine.
Handling the webview dependency at deployment
- Windows: ship the WebView2 Evergreen bootstrapper with your installer and run it silently during setup, or rely on the fact that most current Windows 10/11 systems already have it.
- Linux: declare
webkit2gtk-4.0(or your distro's equivalent) as a dependency in your.deb,.rpm, or AppImage packaging metadata. - macOS: no action needed; WKWebView ships with the OS.
Expected checks
- The dev-tools user agent matches the expected backend for the platform.
- The release artifact is dramatically smaller than an Electron equivalent.
- On a system missing the webview, you get either an install prompt (Windows) or a clear missing-library error (Linux), not a silent failure.
Limitations and recovery
- The app cannot run where the required webview cannot be installed, such as very old Windows releases without WebView2 support.
- CSS rendering, JavaScript performance, and content security policy behavior differ subtly between WebView2, WKWebView, and WebKitGTK. Test the UI on every target platform.
- You do not control the webview version; OS updates can change behavior under your app.
- Recovery from a failed launch is straightforward: install the missing runtime (WebView2 installer on Windows, the WebKitGTK package via your package manager on Linux) and re-run the binary. No rebuild is needed.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.