Using create-tauri-app
How to create a new Tauri 2 project with create-tauri-app, including supported frontend templates, interactive scaffolding, non-interactive options, and manual setup using the Tauri CLI
create-tauri-app is the official scaffolding tool for Tauri 2. It generates a complete project with a Rust backend and a frontend configured to use your chosen framework. The tool asks a few questions and produces a folder you can open, install, and run.
You should complete the System Dependencies Overview for Tauri 2 before running this tool. The scaffolding process will detect any missing system dependencies and tell you how to install them, but having Rust and Node.js (or another supported runtime) ready first prevents unnecessary errors.
Supported Frontend Templates
create-tauri-app ships with officially maintained templates for three frontend language ecosystems (for a full list of UI frameworks and flavors, see Supported Frontend Templates). The tool asks you to pick a language first, then shows the frameworks available for that ecosystem.
| Frontend Language | Template Options | Flavor |
|---|---|---|
| TypeScript / JavaScript | Vanilla, Vue, Svelte, React, Solid, Angular, Preact | TypeScript or JavaScript |
| Rust (cargo) | Vanilla, Yew, Leptos, Sycamore | — |
| .NET (dotnet) | Blazor | — |
Rust frontend templates are compiled to WebAssembly with Trunk. Vanilla in this context is a minimal HTML/CSS/JS setup managed through Cargo, while Yew, Leptos, and Sycamore are Rust web frameworks. The .NET option uses Blazor, which also compiles to WebAssembly.
Community Templates:
More templates from the community are listed in the Awesome Tauri repository. Some of these target frameworks like Next.js, Nuxt, or SvelteKit with pre‑configured Tauri integration.
Running create-tauri-app
You start create-tauri-app with a single command (explore interactive vs non-interactive CLI flags in Running create-tauri-app). Choose the method that matches your shell or package manager.
npm create tauri-app@latest
Run this in a new or empty folder:
The interactive wizard creates a new subfolder for the project name you provide. If you use non‑interactive mode and specify . as the project name, the tool will place files directly into the current directory. Make sure you intend that — existing files may be overwritten.
Interactive Scaffolding
After you execute the command, the tool walks through a series of prompts. Here is a typical session:
? Project name (tauri-app) › my-app
? Identifier (com.my-app.app) ›
? Choose which language to use for your frontend ›
Rust (cargo)
❯ TypeScript / JavaScript (pnpm, yarn, npm, bun)
.NET (dotnet)
? Choose your package manager ›
pnpm
❯ npm
yarn
bun
? Choose your UI template ›
Vanilla
Vue
Svelte
❯ React
Solid
Angular
Preact
? Choose your UI flavor ›
❯ TypeScript
JavaScript
The project name becomes the folder name and the default window title. The identifier is a reverse‑domain string (like com.mycompany.myapp) that uniquely identifies your application on the system — the default is usually fine for development.
After you select the language, package manager, and template, create-tauri-app generates the project and prints the next commands you need to run.
Non‑Interactive Scaffolding
You can skip the prompts by passing the project name and desired template directly on the command line. This is useful in scripts or CI pipelines.
# npm (v7 and later needs an extra double dash)
npm create tauri-app@latest my-app -- --template react-ts
# Bash (curl)
sh <(curl https://create.tauri.app/sh) my-app --template react-ts
# PowerShell
$env:CTA_ARGS="--template react-ts"; irm https://create.tauri.app/ps | iex
# Cargo
cargo create-tauri-app my-app --template react-ts
Supported template shortcuts mirror the interactive choices: vanilla, vanilla-ts, vue, vue-ts, svelte, svelte-ts, react, react-ts, preact, preact-ts, solid, solid-ts, angular, yew, leptos, sycamore, blazor. The package manager is inferred from the command you used to invoke the tool.
Starting the Development Server
Once the project is generated, open the folder, install dependencies, and launch the Tauri development server. The generated output prints the exact commands, but the pattern is always the same.
cd my-app
npm install
npm run tauri dev
A native window opens with your frontend content. The development server supports hot‑reload: changes to your frontend code appear immediately, and changes to Rust code trigger an automatic recompile and restart.
Everything is working:
If you see your app’s window appear and it displays the starter page for your chosen template, the Tauri project is set up correctly. You can begin building on top of it.
create-tauri-app may report missing system packages after generating the project. It prints the exact terminal commands for your platform. Install those dependencies and rerun tauri dev.
Manual Setup Using the Tauri CLI
If you already have an existing frontend or you want full control over the project structure, you can add Tauri to your project manually (read step-by-step instructions in Manual Setup Using the Tauri CLI). This path uses the Tauri CLI to initialize the Rust backend next to your frontend code.
The steps below use Vite as an example frontend, but any tool that serves an HTTP development server works — Create React App, Next.js, Nuxt, SvelteKit, or even a bare HTML file served with npx serve.
Step 1: Create a frontend project
Start with a new directory and initialize a Vite project inside it. Vite asks a few prompts; pick your framework and variant as you prefer.
mkdir my-app
cd my-app
npm create vite@latest .
You now have a working frontend project. Start its dev server once (npm run dev) and verify it’s accessible at http://localhost:5173 before moving on.
Step 2: Install the Tauri CLI
Add @tauri-apps/cli as a development dependency in your frontend project.
npm install -D @tauri-apps/cli@latest
Step 3: Initialize Tauri configuration
Run tauri init and answer the prompts. Tauri will create a src-tauri directory containing the Rust backend and a configuration file.
npx tauri init
Provide the information requested by the prompts:
✔ What is your app name? · my-app
✔ What should the window title be? · my-app
✔ Where are your web assets located? · ../dist
✔ What is the URL of your dev server? · http://localhost:5173
✔ What is your frontend dev command? · npm run dev
✔ What is your frontend build command? · npm run build
The web assets location points to the folder your frontend build tool outputs (dist for Vite, build for Create React App). The dev server URL must match the URL your dev tool prints when you start it. The dev and build commands are what you normally run for your frontend alone — Tauri wraps them during tauri dev and tauri build.
Match your actual frontend configuration:
If you use a different port (e.g., Next.js defaults to 3000) or a different output folder (e.g., build for CRA), adjust these values accordingly. An incorrect dev server URL causes a blank window when running tauri dev.
Step 4: Prevent Vite from watching the Tauri folder
Vite’s file watcher can get stuck in a loop when it sees changes inside src-tauri (generated by the Rust compilation). Add an ignore rule to your Vite configuration.
import { defineConfig } from "vite";
export default defineConfig({
server: {
watch: {
ignored: ["**/src-tauri/**"],
},
},
});
If you are not using Vite, consult your dev server’s documentation for an equivalent “ignore” or “watch” exclusion option. Skipping this step often causes the dev server to restart constantly.
Step 5: Launch the Tauri development server
Run tauri dev from the project root. This command compiles the Rust backend, starts your frontend dev server, and opens the native window.
npx tauri dev
Manual setup verified:
A native window displaying your frontend page means the Tauri backend is correctly wired to your dev server. You can now develop the app exactly like you would a normal web project, while Tauri provides the desktop shell.
Supported Frontend Templates
A complete reference of all official frontend templates available through create-tauri-app for Tauri v2, covering JavaScript, TypeScript, Rust, and .NET ecosystems plus community contributions.
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.
Manual Setup Using the Tauri CLI
Set up a Tauri v2 project from scratch by initializing your frontend first, installing the Tauri CLI manually, and using tauri init to generate the Rust backend.