> For AI agents: the complete documentation index is available at https://dotpress.dev/llms.txt, the full documentation bundle is available at https://dotpress.dev/llms-full.txt.

# Installation

## Requirements

- **Node.js 22.12 or later.** We recommend the current [LTS release](https://nodejs.org/en/about/previous-releases). Dotpress is tested on Node.js 22, 24 and 26. With Node.js 22.18 or later, Node.js runs TypeScript files directly, without a build step: the examples of this documentation use it.
- **TypeScript**, with `strict` enabled. The packages are tested with TypeScript 6.
- **Zod 4**, for the schemas.

The packages are ES modules. A CommonJS project can still load them with `require()`, which Node.js 22.12 supports for ES modules.

## Install the core and an adapter

Dotpress runs on the HTTP server of your choice: install the core, the adapter of your server, the server itself and Zod.

### Express


```sh [npm]
npm install @dotpress/core @dotpress/adapter-express express zod
```

```sh [yarn]
yarn add @dotpress/core @dotpress/adapter-express express zod
```

```sh [pnpm]
pnpm add @dotpress/core @dotpress/adapter-express express zod
```

```sh [bun]
bun add @dotpress/core @dotpress/adapter-express express zod
```

```sh [deno]
deno add npm:@dotpress/core npm:@dotpress/adapter-express npm:express npm:zod
```

### Fastify


```sh [npm]
npm install @dotpress/core @dotpress/adapter-fastify fastify zod
```

```sh [yarn]
yarn add @dotpress/core @dotpress/adapter-fastify fastify zod
```

```sh [pnpm]
pnpm add @dotpress/core @dotpress/adapter-fastify fastify zod
```

```sh [bun]
bun add @dotpress/core @dotpress/adapter-fastify fastify zod
```

```sh [deno]
deno add npm:@dotpress/core npm:@dotpress/adapter-fastify npm:fastify npm:zod
```

### Hono


```sh [npm]
npm install @dotpress/core @dotpress/adapter-hono hono @hono/node-server zod
```

```sh [yarn]
yarn add @dotpress/core @dotpress/adapter-hono hono @hono/node-server zod
```

```sh [pnpm]
pnpm add @dotpress/core @dotpress/adapter-hono hono @hono/node-server zod
```

```sh [bun]
bun add @dotpress/core @dotpress/adapter-hono hono @hono/node-server zod
```

```sh [deno]
deno add npm:@dotpress/core npm:@dotpress/adapter-hono npm:hono npm:@hono/node-server npm:zod
```

Not sure which one to pick? Your routes do not depend on it, and you can switch later: see [Choosing an adapter](https://dotpress.dev/adapters/index.md). For AWS Lambda, see [the Lambda adapter](https://dotpress.dev/adapters/aws-lambda.md).

## Configure TypeScript

A configuration for Node.js 22.18 or later, which runs the `.ts` files directly:

```json title="tsconfig.json"
{
  "compilerOptions": {
    "target": "ES2023",
    "lib": ["ES2023"],
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "types": ["node"],
    "strict": true,
    "noEmit": true,
    "allowImportingTsExtensions": true,
    "erasableSyntaxOnly": true,
    "verbatimModuleSyntax": true,
    "skipLibCheck": true
  },
  "include": ["src", "test"]
}
```

Node.js only strips the types: `erasableSyntaxOnly` rejects the TypeScript syntax it cannot strip (enums, parameter properties), and relative imports end with `.ts`. Set `"type": "module"` in `package.json`.

If you compile your code with `tsc` or a bundler instead, keep `strict: true` and use your usual settings.

## Add packages

Each package is optional. Install it when you need it:

| Need                               | Package                                    |
| ---------------------------------- | ------------------------------------------ |
| Authentication                     | `@dotpress/auth@alpha`, see the note below |
| OpenAPI document and API reference | `@dotpress/openapi`                        |
| Emails                             | `@dotpress/mailer`                         |
| Events and workers                 | `@dotpress/events`                         |
| Cache and memoization              | `@dotpress/cache`                          |
| Tests                              | `@dotpress/testing` (dev dependency)       |

:::warning @dotpress/auth during the alpha
Install `@dotpress/auth` with the `alpha` tag. Without a tag, npm installs `@dotpress/auth` 1.x, the plugin of Dotpress 1.
:::

## Start from an example

Each [example](https://dotpress.dev/examples/index.md) is a complete project, with its tests, that you can copy:

```sh
npx degit dotpressjs/dotpress/examples/express my-api
cd my-api
npm install
npm run dev
```
