Running create-tauri-app

Scaffold a new Tauri v2 project using create-tauri-app with npm, Yarn, pnpm, Bun, Cargo, or shell scripts. Then navigate and launch the development server.

create-tauri-app is the official project scaffolder for Tauri v2. It generates a complete project skeleton — frontend, Rust backend, configuration, and all — in one interactive command. There is no separate installation step; the command you choose below fetches and runs the latest version of the tool automatically.

Choosing the Right Command

You run create-tauri-app once per project. The exact invocation depends on your preferred package manager or shell. Every variant does the same thing under the hood: it downloads the scaffolding tool, starts an interactive questionnaire, and writes out the project files.

npm create tauri-app@latest

npm create is an alias for npm init that works with create-* packages. The @latest ensures you always get the most recent stable release, which is important because Tauri v2 and v1 use different templates.
If you have previously installed an older version globally, @latest overrides any cached copy for this run.

No need to install create-tauri-app globally:

When you use a package manager command like npm create tauri-app@latest, the package is fetched and executed on the fly — no permanent global installation occurs. Only the Cargo path leaves a globally installed binary. The shell and PowerShell scripts download a temporary binary and run it without installation.

The Interactive Prompt Flow

After you issue the command, create-tauri-app walks you through a series of choices. Each choice determines a piece of the generated project. The order is fixed, and the options presented depend on earlier selections.

Project name and identifier

The first prompt asks for the project directory name and a unique bundle identifier. The bundle identifier follows reverse-domain notation (for example com.mycompany.tauriapp) and is used by the operating system to distinguish your app from others.

? Project name (tauri-app) › my-tauri-app
? Identifier (com.my-company.app) ›

The default identifier is derived from the project name if you leave it empty. You can change this later in tauri.conf.json, but setting it now avoids configuration drift.

Frontend language

You then choose which ecosystem your frontend code will use. This choice determines not just the language but also the package manager and the available UI templates.

? Choose which language to use for your frontend ›
TypeScript / JavaScript  (pnpm, yarn, npm, bun)
Rust  (cargo)
.NET  (dotnet)
  • TypeScript / JavaScript — the most common path. The tool will later ask which JavaScript framework (React, Vue, Svelte, etc.) and which flavor (TypeScript or JavaScript) you want.
  • Rust — for Rust-based frontend frameworks like Yew, Leptos, or Sycamore. You will not need Node.js for the frontend; all dependencies are managed with Cargo.
  • .NET — currently supports Blazor as the UI template.

Rust and .NET paths still require a system webview:

Even when the frontend is written in Rust or .NET, the app still renders inside the operating system's native webview (WebKit on macOS/Linux, WebView2 on Windows). You are not building a native GUI — you are embedding a web renderer that runs your compiled frontend.

Package manager (TypeScript/JavaScript only)

If you chose TypeScript / JavaScript, the tool asks which package manager to use for installing dependencies and running scripts:

? Choose your package manager ›
pnpm
yarn
npm
bun

Your choice is written into the scaffolded project’s package.json scripts and lock files. The Tauri CLI invocations (like pnpm tauri dev or npm run tauri dev) work correctly regardless of which one you pick.

UI template and flavor

This is where you pick the frontend framework.

For TypeScript / JavaScript:

? Choose your UI template ›
Vanilla
Vue
Svelte
React
Solid
Angular
Preact
? Choose your UI flavor ›
TypeScript
JavaScript

For Rust:

? Choose your UI template ›
Vanilla
Yew
Leptos
Sycamore

For .NET:

? Choose your UI template ›
Blazor

The "Vanilla" template provides plain HTML, CSS, and JavaScript (or TypeScript) without any framework. It is a good starting point if you want to understand how Tauri wires the frontend to the backend without any abstraction layers in between.

All templates are production-quality:

Every official template includes a complete Vite setup (for JavaScript frameworks) or a proper Cargo project (for Rust frontends), plus sensible defaults for tauri.conf.json, capabilities, and platform icons. You can ship from these templates directly.

Non‑Interactive Scaffolding with Command‑Line Flags

If you want to skip the prompts — useful in CI scripts, tutorials, or when you already know exactly what you need — you can pass the project name and a template preset directly as arguments.

The format varies by package manager because of how argument forwarding works.

# npm 7+ requires an extra double‑dash before the flags
npm create tauri-app@latest my-tauri-app -- --template react-ts

The --template flag accepts any of the supported presets:

vanilla, vanilla-ts, vue, vue-ts, svelte, svelte-ts, react, react-ts, preact, preact-ts, solid, solid-ts, angular, yew, leptos, sycamore, blazor

You can also use . as the project name to scaffold into the current directory instead of creating a new folder:

npm create tauri-app@latest . -- --template react-ts

When you use non‑interactive mode, the tool uses sensible defaults for everything not specified (identifier derived from the name, TypeScript if the template supports both flavors, and the package manager you used to invoke the command). If you need more control, use the interactive prompt.

After the Scaffold Completes

The tool prints a success message and the exact commands you need to run next. It looks similar to this:

Template created! To get started run:
  cd my-tauri-app
  npm install
  npm run tauri dev

If the tool detects missing system dependencies — such as Rust, the WebView2 runtime on Windows, or build essentials on Linux — it prints a list of what is missing and the install commands for your OS. Do not skip this; Tauri’s Rust backend will not compile without them.

Windows: missing build tools cause linker errors:

On Windows, the Rust toolchain relies on the Microsoft C++ Build Tools. If you see linker errors like LINK : fatal error LNK1181: cannot open input file 'kernel32.lib', you need to install the "Desktop development with C++" workload from the Visual Studio Build Tools installer. The Tauri prerequisites guide covers this in detail; revisit the Environment Setup chapter if you encounter it.

Starting the Development Server

With the project scaffolded and dependencies installed, you can launch the app in development mode. This starts both your frontend dev server (with hot module replacement) and the Tauri process that renders the web content inside a native window.

1

Navigate into the project directory

cd my-tauri-app
2

Install dependencies

Use the package manager you chose during scaffolding.

npm install
3

Run the Tauri development command

npm run tauri dev

When you run tauri dev, several things happen in sequence:

  1. The Vite dev server starts (or the equivalent for your frontend). It serves your UI at a local URL — typically http://localhost:1420 for Vite‑based templates, but the exact port is configurable in tauri.conf.json.
  2. The Rust backend compiles. Cargo checks your src-tauri crate and builds it with debug optimizations. The first compilation takes longer because all dependencies must be fetched and built. Subsequent runs are faster due to incremental compilation.
  3. A native window opens. The Tauri runtime creates a platform‑native window and loads the web content from the dev server URL. You can inspect this window with the same developer tools you would use in a browser: right‑click and select "Inspect" (or use the Ctrl+Shift+I / Cmd+Option+I shortcut).
  4. Hot reload works in both directions. Changing any file in your src folder triggers an instant refresh in the window. Changing a Rust file in src-tauri causes a recompilation; the window reloads automatically once the new binary is ready.

You will see a default Tauri welcome screen:

The scaffolded template includes a simple starter page with links to documentation and common tasks. If a native window appears with that content, everything is wired correctly. From here you can replace the boilerplate with your own frontend code.

Handling Common First‑Run Issues

Scaffolding is designed to be frictionless, but the environment you run it in can cause failures. Here are the most frequent problems and their solutions.

  • The tool creates a folder named --template or --rc instead of a project. This means your package manager did not forward the flags correctly. For npm, add the extra -- before the flags. For pnpm, ensure you are on a recent version. As a workaround, rename the folder and continue, or just use the interactive prompt once.
  • cargo tauri dev complains about a missing Tauri CLI. If you used the Cargo scaffold command, you still need to install tauri-cli separately. Run cargo install tauri-cli --version "^2.0.0" --locked before trying cargo tauri dev.
  • Windows: The system cannot find the file specified during tauri dev. This often means the WebView2 runtime is not installed. Windows 10 and 11 usually have it, but if you are on an older build or a locked‑down enterprise machine, download the Evergreen WebView2 installer from Microsoft.
  • macOS: xcrun: error: unable to find utility "xcodebuild". You need the full Xcode Command Line Tools, not just the basic ones. Run xcode-select --install and make sure you accept the license with sudo xcodebuild -license.

If none of these apply and the scaffold still fails, check that your Node.js version is 18 or later and that you have Rust stable installed via rustup. The official Tauri v2 prerequisites page lists the exact minimum versions for every platform.

What the Scaffolded Project Contains

Before you start editing, it helps to know what you just created. Every template generates a consistent structure:

my-tauri-app/
├── src/                 # Frontend source (React, Vue, Svelte, etc.)
│   ├── App.tsx          # Main component
│   ├── main.tsx         # Entry point
│   └── styles.css       # Base styles
├── src-tauri/           # Rust backend
│   ├── Cargo.toml       # Rust dependencies
│   ├── tauri.conf.json  # App configuration (window size, identifier, etc.)
│   ├── capabilities/    # Permission declarations
│   ├── icons/           # App icons for all platforms
│   └── src/
│       ├── main.rs      # Entry point
│       └── lib.rs       # Tauri command definitions
├── index.html           # Vite entry HTML
├── package.json         # Frontend dependencies and scripts
├── tsconfig.json        # TypeScript configuration
└── vite.config.ts       # Vite bundler settings

The tauri.conf.json file (see tauri.conf.json) deserves immediate attention. It contains the frontend dev server URL (devPath), the production build output folder (distDir), and the window settings. Permission files live in the capabilities Directory. The template sets sensible defaults, so your tauri dev command works without any modifications. For a full walk-through of the generated directory layout, visit Key Files and Directories Explained.

src-tauri is a separate Rust crate:

The src-tauri directory is a fully self‑contained Rust project. You can open it in any Rust IDE, run cargo check inside it independently, and add any third‑party crate to Cargo.toml. Tauri’s build system respects this separation; the frontend never compiles into the Rust binary. Communication happens only over inter‑process calls (IPC).

Summary

create-tauri-app collapses what used to be a multi‑step manual process into a single command. It asks you a few straightforward questions and emits a project that compiles and runs on the first try — provided your system dependencies are in place. The tool supports every major package manager and frontend framework, and it can run non‑interactively when you need to script the creation. Once the scaffold finishes, tauri dev gives you a live desktop window with full hot reload, ready for you to start building. Explore alternative CLI manual setups in Manual Setup Using the Tauri CLI.