<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft" -->

---
title: Deploying Hono on Cloudflare Workers | daily.dev
description: A practical guide to deploying a Hono API on Cloudflare Workers, covering project scaffolding with the official template, local development via wrangler dev,...
canonical: https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Deploying Hono on Cloudflare Workers | daily.dev
og:description: A practical guide to deploying a Hono API on Cloudflare Workers, covering project scaffolding with the official template, local development via wrangler dev,...
og:url: https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft
og:image: https://api.daily.dev/og/posts/JkEDdlEFT.png
og:image:alt: Deploying Hono on Cloudflare Workers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying Hono on Cloudflare Workers

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 4 min read · 1 upvotes · 0 comments

## Summary

A practical guide to deploying a Hono API on Cloudflare Workers, covering project scaffolding with the official template, local development via wrangler dev, typed D1 database bindings using Hono generics, and building a minimal REST API with GET and POST routes. Also touches on KV and R2 bindings and how middleware carries over unchanged from other environments.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/hono-cloudflare-workers>

## Questions this post answers

### How do I type Cloudflare D1 bindings when using Hono?

Define a Bindings type with the binding name mapped to D1Database, then pass it to Hono as a generic like `new Hono<{ Bindings: Bindings }>()`. This makes `c.env.DB` fully typed inside route handlers. Running `npm run cf-typegen` can also generate these types automatically from the wrangler config.

_daily.dev surfaces practical Cloudflare Workers and Hono guides for developers wiring up typed bindings._

### How do I scaffold a new Hono project for Cloudflare Workers?

Run `npm create hono@latest my-api` and choose the cloudflare-workers template when prompted, or pass `--template cloudflare-workers` to skip the prompt. This generates a project with an entry point at src/index.ts exporting a Hono app and a wrangler.jsonc config file where bindings for D1, KV, or R2 are declared.

_developers setting up edge APIs can track Hono and Cloudflare Workers tutorials on daily.dev._

### How do I run and deploy a Hono app locally on Cloudflare Workers?

Use `npm run dev`, which runs wrangler dev and serves the app at http://localhost:8787 with live reload on save. To ship it, run `npm run deploy`, which bundles the code, uploads it via Wrangler, and returns a *.workers.dev URL within seconds, prompting a browser login to Cloudflare on first use.

_daily.dev helps developers stay current on Wrangler and Cloudflare Workers deployment workflows._

## Similar posts on daily.dev

- [The Rise of Micro-Backends: Why Frontend Devs Love Hono](https://daily.dev/posts/the-rise-of-micro-backends-why-frontend-devs-love-hono-a9wal9hdp) · SitePoint · 0 upvotes · 0 comments
- [Adding Auth0 to Hono on Cloudflare Workers: A Practical Guide](https://daily.dev/posts/adding-auth0-to-hono-on-cloudflare-workers-a-practical-guide-noshswtx5) · Auth0 · 20 upvotes · 2 comments
- [Cloudflare Workers: your first serverless function](https://daily.dev/posts/cloudflare-workers-your-first-serverless-function-zkqoxjdgf) · Flavio Copes · 0 upvotes · 0 comments
- [How To Build a Serverless API With Bun and Hono](https://daily.dev/posts/how-to-build-a-serverless-api-with-bun-and-hono-gppc14in4) · The New Stack · 1 upvotes · 0 comments
- [Pre‑Signed URL Upload Architecture \(Cloudflare R2 \+ Hono Workers\)](https://daily.dev/posts/pre-signed-url-upload-architecture-cloudflare-r2-hono-workers--58kd2mkem) · Liran Tal · 1 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#cloudflare](https://daily.dev/tags/cloudflare)

[View this post on daily.dev](https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Deploying Hono on Cloudflare Workers","url":"https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft"},"datePublished":"2026-08-10T06:50:16.650Z","dateModified":"2026-09-14T08:56:07.825Z","description":"A practical guide to deploying a Hono API on Cloudflare Workers, covering project scaffolding with the official template, local development via wrangler dev,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,cloudflare","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"Deploying Hono on Cloudflare Workers"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/deploying-hono-on-cloudflare-workers-jkeddleft#faq","mainEntity":[{"@type":"Question","name":"How do I type Cloudflare D1 bindings when using Hono?","acceptedAnswer":{"@type":"Answer","text":"Define a Bindings type with the binding name mapped to D1Database, then pass it to Hono as a generic like `new Hono<{ Bindings: Bindings }>()`. This makes `c.env.DB` fully typed inside route handlers. Running `npm run cf-typegen` can also generate these types automatically from the wrangler config. daily.dev surfaces practical Cloudflare Workers and Hono guides for developers wiring up typed bindings."}},{"@type":"Question","name":"How do I scaffold a new Hono project for Cloudflare Workers?","acceptedAnswer":{"@type":"Answer","text":"Run `npm create hono@latest my-api` and choose the cloudflare-workers template when prompted, or pass `--template cloudflare-workers` to skip the prompt. This generates a project with an entry point at src/index.ts exporting a Hono app and a wrangler.jsonc config file where bindings for D1, KV, or R2 are declared. developers setting up edge APIs can track Hono and Cloudflare Workers tutorials on daily.dev."}},{"@type":"Question","name":"How do I run and deploy a Hono app locally on Cloudflare Workers?","acceptedAnswer":{"@type":"Answer","text":"Use `npm run dev`, which runs wrangler dev and serves the app at http://localhost:8787 with live reload on save. To ship it, run `npm run deploy`, which bundles the code, uploads it via Wrangler, and returns a *.workers.dev URL within seconds, prompting a browser login to Cloudflare on first use. daily.dev helps developers stay current on Wrangler and Cloudflare Workers deployment workflows."}}]}
```

