Docs

Quickstart

Go from an empty folder to a local app with working sign-in, using the Zitadel CLI and a Zitadel runtime on your machine.

This Quickstart takes you from an empty folder to a local app where a user can register, sign out and sign in. You use the @zitadel/cli package and a Zitadel runtime on your machine, with no source checkout. For an app you already have, see Add Zitadel to an existing app.

Run these in a new, empty folder:

npx @zitadel/cli@latest doctor
npx @zitadel/cli@latest start
npx @zitadel/cli@latest setup --server local
npm run dev

doctor checks your machine, start runs Zitadel locally, setup scaffolds an app with login, registration and profile pages, and npm run dev serves it. The sections below add what each step prints.

Prerequisites

  • Node.js 24 or newer. Check it with node --version. The framework you pick may need a narrower range (Node versions).
  • A package manager supported by your app. Setup detects it and installs dependencies with it. Check npm with npm --version.
  • A web browser, to register a user in the app you create.
  • Docker only if you intentionally choose the Docker runtime backend. Check it with docker --version.

Node versions

When setup creates a new app, it checks your Node against the range the framework's CLI publishes. For the frameworks other than Angular, setup warns if your Node is outside that range and carries on.

To create an Angular app, use a Node version the Angular CLI accepts: 22.22.3 or newer 22.x, 24.15.0 or newer 24.x, or 26.x. The Angular CLI publishes ^22.22.3 || ^24.15.0 || >=26.0.0, but it checks each major on its own, so Node 27 and later are refused. Node 23 and 25 run with a warning. Setup refuses any other Node and names the range.

Create an app directory

mkdir myapp
cd myapp

Check your machine

npx @zitadel/cli@latest doctor

Before setup, doctor checks local runtime prerequisites. After setup, it also verifies generated app files and local config. It prints each check, then All checks passed or Checks passed with warnings. When a check fails, it prints Error: Zitadel doctor found issues (<CODE>) and a hint with the fix, and exits non-zero. doctor --json names the failed check. Apply the fix and run doctor again.

Start Zitadel locally

npx @zitadel/cli@latest start

This runs the @zitadel/server npm binary that matches the CLI's version, on the first free port from 8080, usually http://localhost:8080. It also creates a local admin, admin@zitadel.localhost.

start prints Local Zitadel server is ready and names setup as the next step. start --json lists the API and console URLs. It prints no console sign-in link: you get one after setup (Open the console). When 8080 is taken, start takes the next free port, and the footer names it. A port you pass with --port <port> must be free, or start fails with E_PORT_IN_USE. Run Zitadel locally covers the runtime's state and ports.

Scaffold the app with sign-in

npx @zitadel/cli@latest setup --server local

Setup creates your Zitadel project, the container for your app's users and configuration, and scaffolds a new app into the empty directory. It asks which framework to scaffold. Setup has no default: pick the framework you know. In a script, pass --framework with one of next, nuxt, sveltekit, solid-start, qwik-router, tanstack-start, react, vue, angular, solid, svelte, or qwik. Agent setup uses next.

Setup asks which sign-in method users should see first (--preset):

  • password-first (the default) shows email and password first; passkeys are enabled but not shown at sign-in.
  • passkey-first shows a passkey first, with email and password as the alternative.

Both presets enable password and passkey in the schema, but each user still registers a password or a passkey themselves. Setup writes the schema and login flow to .zitadel/schemas/ and .zitadel/flows/; each folder has a README on what you can change.

Run setup in the directory start ran in, or one inside it. Setup looks there for the local admin and attaches the project to the admin's team. A team groups users and can own projects, and attaching the project is what claiming one means (Claim). Setup prints Project owned by admin@zitadel.localhost (team <team-id>), and there is nothing left to claim. Without the admin, the project has no team and the console does not list it. Rerunning setup does not fix this, because setup skips a directory that has zitadel.json. Run npx @zitadel/cli@latest claim in the app's directory instead.

Setup writes the app files, .env.example, .env.local (read by your app), .env.development.local (read by the CLI), zitadel.json and .zitadel/**. It adds the files that hold secrets to .gitignore (Configuration as code), then installs dependencies unless you pass --skip-install. If the directory holds other files, or setup fails or you cancel it, see When setup scaffolds a new app.

What setup prints

Setup closes on Set up Zitadel in this app and a box titled Summary. Its last section lists the project: Project id, Server (http://localhost:8080 for the first local runtime) and App will run, the URL to open in your browser. The box ends with the next steps, among them starting the dev server, then Explore all commands: with the command that lists them and, on a machine's first run, an offer to add the Agent Skills. Setup does not print the project secret.

Where the project ID and secret are

The project ID is the Project id row above. The files setup wrote hold it too:

ValueVariableFile
Project IDZITADEL_PROJECT_ID.env.local, .env.development.local
Project secretZITADEL_PROJECT_SECRET.env.local, .env.development.local, .zitadel/secret
Server URLZITADEL_URL.env.local, .env.development.local

The project secret is the credential your own server uses to call the API. Keep it out of source control and out of the browser. To check what the CLI resolved, run npx @zitadel/cli@latest env.

Prove the browser flow

Start the generated app:

npm run dev

The dev server prints its URL. Open its sign-up page, usually http://localhost:3000/register. Use exactly the origin setup registered (localhost, not 127.0.0.1). Setup registers the dev origin as a primary origin, a URL your project serves, and the origin allowlist and passkeys are bound to it. A passkey registered under one hostname can never be used under another. Complete this loop:

register a user -> log out -> log in with the same user -> profile shows signed in

A rendered login form is not proof: the loop must succeed in a real browser.

If the page does not load or the sign-in fails, check the runtime with npx @zitadel/cli@latest status, and that the address bar shows the App will run URL from setup.

To run this check as an automated test, use the test kit: Test your app's sign-in.

Open the console

The user you registered is an end user of your app. The management console is a separate sign-in, as the local admin. Use a second terminal in the same directory, since the dev server keeps the first busy:

npx @zitadel/cli@latest console

The command opens a one-time link in your browser that signs you in as the local admin and expires after about a minute. Run it again for a new link. Run Zitadel locally covers the details.

Make a first API request

This check confirms the project secret works. In the second terminal, in your app's directory, load ZITADEL_URL and ZITADEL_PROJECT_SECRET from .env.local:

set -a; . ./.env.local; set +a

Then list the project's users. The request sends the project secret as a Bearer token in the Authorization header:

curl -X POST "$ZITADEL_URL/api/v1/users/query" \
  -H "Authorization: Bearer $ZITADEL_PROJECT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{}'

A 200 response is a JSON page with a users array, which holds the user you registered, and a next_page_token while more users follow. A 401 means the server rejected the credentials: check that you loaded .env.local from your app's directory. The API reference covers authentication and paging.

The CLI makes the same call and reads the server and secret from the project's files:

npx @zitadel/cli@latest user list

Add Zitadel to an existing app

To patch an app you already have instead of scaffolding one, follow Add Zitadel to an existing app.

Customize the login

Edit the schema and login flow in .zitadel/schemas/ and .zitadel/flows/, then preview and publish:

npx @zitadel/cli@latest deploy --dry-run
npx @zitadel/cli@latest deploy

deploy publishes your files to the project as a release. Edit the login flow adds a company field to registration.

Explore every command

Run the CLI with no subcommand to see its commands, grouped by task:

npx @zitadel/cli@latest

With a global install, run zitadel. zitadel <command> --help lists a command's options; zitadel commands prints every command in a flat list.

Stop or reset

Run these in the directory start ran in (details). Stop local Zitadel while keeping runtime data:

npx @zitadel/cli@latest stop

Delete local runtime data:

npx @zitadel/cli@latest reset --force

Was this helpful?