Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 39 ยท Mobile and Packaging

Bundling, Installers and Code Signing in Tauri

Turn a Tauri app into installers for Windows, macOS and Linux: bundle config, icons, formats, code signing and notarization, GitHub Actions builds, and a runnable bundle-config checker.

Running tauri dev is for you. Users need something they can double-click: an installer, a disk image or a package. Tauri's bundler produces these from one command, and it also handles icons, metadata and (with your certificates) code signing. This lesson covers the build, the formats per platform, the configuration that matters, and why signing is not optional if you want people to trust and install your app.

Real versus stand-in. Building installers needs the real toolchain, so the bash, json, toml and yaml blocks are real configuration to read and copy. The runnable blocks check configuration values and compute names in JavaScript.

The build command

Terminal
npm run tauri build

This does three things: runs your frontend build (build.beforeBuildCommand), compiles the Rust app in release mode, and packages the result into bundles under src-tauri/target/release/bundle/. By default it makes the formats for the operating system you are on, since Tauri does not cross-compile bundles for other desktops easily. Build Windows installers on Windows, macOS on macOS, Linux on Linux; a CI matrix does all three (see below).

Platform Bundles
Windows .msi (WiX Toolset), -setup.exe (NSIS)
macOS .app, .dmg
Linux .deb, .rpm, .AppImage
Android / iOS .apk, .aab, .ipa (see Mobile Development)

Choose formats with --bundles (tauri build --bundles nsis,msi) or with bundle.targets in the config.

The bundle section of tauri.conf.json

JSON
{
  "productName": "Notes",
  "version": "1.2.0",
  "identifier": "com.example.notes",
  "build": {
    "beforeBuildCommand": "npm run build",
    "frontendDist": "../dist"
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/[email protected]",
      "icons/icon.icns",
      "icons/icon.ico"
    ],
    "publisher": "Example Ltd",
    "copyright": "Copyright 2026 Example Ltd",
    "category": "Productivity",
    "shortDescription": "Fast markdown notes",
    "longDescription": "A small, fast note-taking app.",
    "resources": ["assets/templates/*"],
    "windows": {
      "nsis": { "installMode": "currentUser", "languages": ["English", "German"] }
    },
    "linux": { "deb": { "depends": ["libwebkit2gtk-4.1-0"] } },
    "macOS": { "minimumSystemVersion": "11.0" }
  }
}
  • identifier is a reverse-domain ID that must be unique and stable; changing it later breaks updates and moves the user's data folder.
  • version follows semantic versioning and feeds installers and the updater. You can also read it from Cargo.toml by leaving it out.
  • resources copies extra files next to the app, for example templates. Read them at runtime through the resource_dir.
  • installMode for NSIS: currentUser needs no administrator rights, perMachine does, both lets the user choose.

Icons

Provide one square PNG (at least 1024 by 1024) and let Tauri create every size and format:

Terminal
npm run tauri icon app-icon.png

This fills src-tauri/icons with the PNG sizes, icon.ico (Windows) and icon.icns (macOS), plus mobile icons.

Node.js Stand-in: validate a bundle config and compute file names

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Why code signing matters

An unsigned app triggers scary warnings: Windows SmartScreen says "Windows protected your PC", macOS Gatekeeper refuses to open the app at all ("is damaged" or "cannot be verified"), and many antivirus tools flag it. Signing proves the app comes from you and was not modified.

Windows

You need a code signing certificate (an EV or OV certificate from a certificate authority, or a cloud service such as Azure Trusted Signing). Point the bundler at it:

JSON
{
  "bundle": {
    "windows": {
      "certificateThumbprint": "A1B2C3...",
      "digestAlgorithm": "sha256",
      "timestampUrl": "http://timestamp.digicert.com"
    }
  }
}

For cloud or hardware-token signing, use signCommand to run your own signing tool for each file. Timestamping keeps signatures valid after the certificate expires. SmartScreen builds reputation over time, and an EV certificate gets trusted faster.

macOS

You need an Apple Developer account, a Developer ID Application certificate, and notarization, where Apple scans the app and issues a ticket. Tauri does both when these environment variables exist during tauri build:

Terminal
export APPLE_SIGNING_IDENTITY="Developer ID Application: Example Ltd (TEAMID)"
export APPLE_CERTIFICATE="<base64 of the .p12 file>"
export APPLE_CERTIFICATE_PASSWORD="..."
export APPLE_ID="[email protected]"
export APPLE_PASSWORD="<app-specific password>"
export APPLE_TEAM_ID="TEAMID"

If your app needs special rights (microphone, network server, JIT), declare them in an entitlements.plist; the Hardened Runtime is required for notarization.

Linux

Linux has no central gatekeeper, but you can sign .deb/.rpm repositories with GPG, and AppImages can carry a signature too. Distribute through your own apt/dnf repository or Flathub if you want automatic updates by the system.

Never commit certificates or passwords. Keep them in your CI provider's encrypted secrets.

Building for every platform in CI

The simplest way to produce all three desktop bundles is a GitHub Actions matrix, using the official tauri-action:

YAML
name: release
on:
  push:
    tags: ['v*']

jobs:
  release:
    strategy:
      fail-fast: false
      matrix:
        include:
          - platform: macos-latest
            args: --target aarch64-apple-darwin
          - platform: macos-latest
            args: --target x86_64-apple-darwin
          - platform: ubuntu-22.04
            args: ''
          - platform: windows-latest
            args: ''
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22 }
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
      - name: Linux dependencies
        if: matrix.platform == 'ubuntu-22.04'
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
      - run: npm ci
      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
          APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
        with:
          tagName: v__VERSION__
          releaseName: 'Notes v__VERSION__'
          releaseDraft: true
          args: ${{ matrix.args }}

The action builds each platform, attaches installers to a draft GitHub release, and can also write the updater manifest used in Updater and Releases.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Where does tauri build place the installers?

    Bundles are written under src-tauri/target/release/bundle, in a subfolder per format.
  2. 2. Which format is produced for Windows by the NSIS bundler?

    NSIS creates a setup executable; the WiX bundler creates an .msi.
  3. 3. Why is changing the app identifier after release a bad idea?

    The identifier names the app for the OS, updater and data folders, so it should stay stable.
  4. 4. What is notarization?

    macOS apps outside the App Store should be signed with a Developer ID and notarized by Apple.
  5. 5. How do you get Windows, macOS and Linux bundles from one repository?

    Each platform's bundles are best built on that platform, which a CI matrix automates.

Summary

  • tauri build compiles and packages installers per platform: MSI/NSIS, DMG/app, deb/rpm/AppImage.
  • Configure name, version, a stable reverse-domain identifier, icons and resources under bundle; generate icons with tauri icon.
  • Sign on every platform (Windows certificate and timestamp, macOS Developer ID plus notarization) and keep secrets in CI.
  • A GitHub Actions matrix with tauri-action builds and uploads all desktop bundles.

Next: Sidecars, Resources and Binary Size