---
title: "Installation and Setup"
description: "Hono is a web framework built on Web Standards, designed to be fast, lightweight, and compatible with a wide range of JavaScript runtime environments including Node.js, Bun, Deno, Cloudflare Worker..."
last_updated: "2026-07-02T09:15:05.242786+00:00"
canonical_url: "https://www.doc0.app/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/guide"
---

Hono is a web framework built on Web Standards, designed to be fast, lightweight, and compatible with a wide range of JavaScript runtime environments including Node.js, Bun, Deno, Cloudflare Workers, and more.

Getting started with Hono is straightforward because it is designed to work out-of-the-box with modern JavaScript project structures.

## Installation

You can install Hono using your preferred package manager. Hono is available as the `hono` package on npm.

1.  **Initialize your project** (if you haven't already):
    ```bash
    npm init -y
    ```

2.  **Install the package**:
    ```bash
    npm install hono
    ```

> [!TIP]
> If you are using Bun, you can simply run `bun add hono` to install the dependency.

## Basic Usage

Once installed, you can import Hono directly into your application code. Since Hono is built on Web Standards, it uses the standard `Request` and `Response` objects.

```typescript
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => c.text('Hello Hono!'))

export default app
```

## Key Concepts

*   **Adapter:** Hono includes built-in adapters (found under the `./adapter` export) that allow it to run on specific platforms like `Cloudflare Workers`, `Deno`, `Bun`, `AWS Lambda`, and `Vercel`. These adapters translate platform-specific events into the Web Standard objects Hono expects.
*   **Presets:** Hono provides "tiny" and "quick" presets for different optimization needs, accessible via imports like `import { Hono } from 'hono/tiny'`.
*   **Middleware:** Hono features a modular design where functionality like `Basic Auth`, `CORS`, `Logger`, and `JWT` are available as optional imports, keeping the core library small.

## Supported Environments

Hono is designed to be environment-agnostic. You can deploy it to any of the following:

| Environment | Supported |
| :--- | :--- |
| Node.js | Yes |
| Cloudflare Workers | Yes |
| Deno | Yes |
| Bun | Yes |
| AWS Lambda | Yes |
| Vercel | Yes |
| Netlify | Yes |

> [!NOTE]
> When running on Node.js, ensure your project is configured as an ES Module (set `"type": "module"` in your `package.json`) to fully support the modern import syntax.

## Troubleshooting

> [!WARNING]
> If you encounter issues with TypeScript resolution, ensure your `tsconfig.json` includes the necessary library definitions (such as `dom` and `dom.iterable`) to support the Web Standards APIs that Hono relies on.

> [!IMPORTANT]
> Always prefer using the official exported sub-paths (e.g., `hono/cors`, `hono/jwt`) rather than reaching into the library's internal `src` directory. This ensures compatibility and type safety across updates.

## Related

- [Runtime Adapters](https://www.doc0.app/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/guide/advanced-features/runtime-adapters)


## Sitemap

See the full [sitemap](https://www.doc0.app/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/llms.txt) for all pages in this wiki.
