Skip to main content

Installation

TanStack Start is built on top of Vite, providing a fast and modern development experience. This guide will walk you through setting up a new TanStack Start project.

Requirements

Before you begin, make sure you have:
  • Node.js 22.12.0 or later - Start requires Node.js version 22.12.0+
  • npm, pnpm, yarn, or bun - Any package manager will work

Creating a New Project

The fastest way to get started is to use the TanStack Start CLI:
This will scaffold a new TanStack Start project with all the necessary dependencies and configuration. Alternatively, you can use your preferred package manager:

Manual Installation

If you prefer to set up a project manually or add Start to an existing project, follow these steps:

1. Install Dependencies

Install the required packages:
And the development dependencies:

2. Configure Vite

Create a vite.config.ts file in your project root:
The tanstackStart plugin handles:
  • Route generation from your file structure
  • Code splitting between client and server
  • Server entry point generation
  • TypeScript type generation

3. Configure TypeScript

Create or update your tsconfig.json:
And a tsconfig.node.json for Node.js/Vite config files:

4. Update package.json

Add the required scripts to your package.json:
Note the "type": "module" field—TanStack Start uses ES modules.

Project Structure

A typical TanStack Start project has the following structure:

The src/routes Directory

This is where you define your routes using file-based routing:
  • __root.tsx - The root layout for your entire app
  • index.tsx - The home page (/)
  • about.tsx - An about page (/about)
  • posts/$postId.tsx - A dynamic route (/posts/:postId)
The TanStack Start Vite plugin automatically generates the route tree from these files.

Configuration Options

The tanstackStart plugin accepts several options:

Additional Integrations

TanStack Start works great with other tools and libraries:

TanStack Router Devtools

Tailwind CSS

TanStack Query

TanStack Query works seamlessly with Start for advanced data fetching, caching, and synchronization.

Deployment

TanStack Start can be deployed to various platforms:

Node.js Servers

Build your app and run the server:

Vercel, Netlify, or Cloudflare

Most platforms support TanStack Start out of the box. Check the deployment guides for platform-specific instructions.

Using Nitro

For more advanced deployment options, you can use Nitro:
Nitro provides adapters for many platforms including AWS, Azure, Cloudflare Workers, and more.

Next Steps

Now that you have TanStack Start installed, head over to the Quickstart Guide to build your first full-stack application.