# Install

## Requirements

- [Node.js](https://nodejs.org) 22 or later.
- [Docker Desktop](https://www.docker.com/products/docker-desktop/), if Fakebase should run PostgreSQL for you. You don't need Docker when you [use a database you already have](https://fakebase.studio/docs/cli-database.md#use-your-own-database).

## Install with npm

```bash
npm install -g @fakebase/cli
```

Check that it works:

```bash
fakebase --version
```

## Run with npx

To use the CLI without installing it, put `npx @fakebase/cli` in front of any command instead of `fakebase`:

```bash
npx @fakebase/cli init --start
```

## Update

```bash
npm install -g @fakebase/cli@latest
```

If you use Fakebase with a coding agent, run `fakebase agent install` afterwards and commit the changes, so your agent's instructions match the new version.

## Check your setup

```bash
fakebase doctor
```

Checks your config, migrations folder, `.gitignore`, Docker, the database connection, and your migrations, and tells you how to fix anything that's wrong. It doesn't change anything.

Add `--help` to any command for its flags.

---

## Next steps

- [Database](https://fakebase.studio/docs/cli-database.md): Set up a project, run its local PostgreSQL database, and connect your app with the Fakebase CLI.
- [Migrations](https://fakebase.studio/docs/cli-migrations.md): Create, check, and apply plain-SQL migrations with the Fakebase CLI.
