Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 39 ยท Getting Started

Install Tauri and Create Your First App

Install the Tauri prerequisites on Windows, macOS and Linux, scaffold a project with create-tauri-app, run it in dev mode and understand each command you type.

Getting a first window on screen takes only a few commands, but they depend on prerequisites that differ per operating system. This lesson walks through them and explains what each step does, so that a failed step makes sense instead of looking like magic.

The commands below run on your own computer, not on this page. The live examples in this lesson are JavaScript stand-ins, for example a checklist that models how the tools find each other.

Step 1: system prerequisites

Tauri compiles Rust code and links it with the system webview, so you need a compiler toolchain and the webview itself.

  • Windows: Microsoft C++ Build Tools (the "Desktop development with C++" workload) and WebView2. WebView2 ships with Windows 10 (recent updates) and Windows 11.
  • macOS: Xcode Command Line Tools for desktop apps, or full Xcode if you target iOS.
  • Linux: a C toolchain plus development packages for WebKitGTK and a few libraries. Package names differ per distribution, so follow the list in the official docs for yours.

Step 2: install Rust

Rust is installed with rustup, the Rust toolchain manager. After installing, open a new terminal so your PATH is updated, then check:

Terminal
rustc --version
cargo --version

rustc is the compiler and cargo is Rust's build tool and package manager. Tauri's build runs through cargo, so you rarely call rustc yourself.

Step 3: install Node.js

Your frontend tooling (a bundler, a dev server) runs on Node.js. Install a current LTS version, then check node --version. You may use npm, pnpm, yarn, bun or deno. This tutorial uses npm.

Step 4: scaffold a project

Terminal
npm create tauri-app@latest

The tool asks a few questions:

  1. Project name, for example hello-tauri.
  2. Identifier, a reverse-domain string such as com.example.hello-tauri. It identifies your app to the operating system and cannot be changed lightly later.
  3. Frontend language: TypeScript/JavaScript, Rust (for Rust frontends like Leptos or Yew), or .NET.
  4. Package manager and a UI template: vanilla, React, Vue, Svelte, Solid, Angular and so on.

Then enter the folder and install dependencies:

Terminal
cd hello-tauri
npm install

Step 5: run it

Terminal
npm run tauri dev

The first run is slow because cargo downloads and compiles every Rust dependency, which can take several minutes. Later runs only rebuild what changed. When it finishes, a native window opens showing your frontend, with a small form that calls a Rust command. Edit a frontend file and the window updates without restarting; edit Rust and Tauri recompiles and restarts the app.

If this step fails, the cause is almost always a missing prerequisite. Read the first error message: a missing linker, a missing webkit2gtk package or a missing WebView2 runtime are the common ones.

What you just created

You can add Tauri to an existing frontend project too. Run the CLI's init in that project instead of starting from a template:

Terminal
npm install --save-dev @tauri-apps/cli@latest
npx tauri init

It asks for your dev server URL and build output folder, and creates the src-tauri folder next to your existing code. The next lesson tours that folder.

Try it: a prerequisite checker (stand-in)

This stand-in models the idea of a "doctor" script: check a list of tools, report what is missing. The tool list and versions here are hard-coded sample data, not read from your machine.

Node.js Stand-in: a tiny environment checklist

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.

Real tooling has a similar command, npx tauri info, which prints your versions and flags problems. Run it first whenever setup fails and include its output when you ask for help.

Try it: what the identifier looks like (stand-in)

The identifier must be reverse-domain style. This stand-in validates one; the rules are a simplified version of what real tooling expects.

Node.js Stand-in: validate an app identifier

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.

Common first-run problems

  • "command not found: cargo". Open a new terminal after installing Rust so your PATH refreshes.
  • A blank window. The dev server URL in tauri.conf.json does not match your frontend's port. See Configuration files.
  • Very slow first build. Normal. Later builds are incremental.
  • Linker errors on Windows. The C++ build tools are missing or the wrong Rust toolchain (GNU instead of MSVC) is selected.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why does the first npm run tauri dev take so long?

    Rust compiles from source. Later builds only recompile what changed.
  2. 2. What is the app identifier used for?

    An identifier like com.example.hello-tauri names the app for bundles, data folders and updates.
  3. 3. Which command prints your tool versions and common setup problems?

    tauri info reports the Rust, Node, webview and CLI versions it finds.
  4. 4. How do you add Tauri to an existing web project?

    Because the frontend is plain web code, init just adds the src-tauri folder next to it.

Summary

  • You need a native toolchain, the system webview, Rust and Node.js.
  • npm create tauri-app@latest scaffolds a project; npm run tauri dev runs it.
  • The first build is slow; later ones are incremental.
  • tauri init adds Tauri to an existing frontend.
  • tauri info is the first thing to run when setup fails.

Next: Project structure tour