Deploy Bun + Hono API in Minutes
Deploy a Bun + Hono API with PostgreSQL to production in under 5 minutes. The fastest TypeScript backend stack of 2026 — now with free hosting and a managed database.
RaidFrame Team
January 3, 2026 · 4 min read
TL;DR — Bun + Hono is the fastest TypeScript backend stack in 2026. Deploy it to RaidFrame with a managed PostgreSQL database for free. Most platforms don't natively support Bun — RaidFrame runs any Docker container, so Bun works out of the box.
Why Bun + Hono?
Bun is a JavaScript runtime that's 3-4x faster than Node.js for HTTP serving. Hono is an ultralight web framework (14KB) that runs everywhere — Cloudflare Workers, Bun, Node, Deno.
Together they're becoming the default backend stack for TypeScript developers who care about performance. The 2026 SaaS stack recommendations consistently list Bun + Hono as the high-performance choice.
The problem: most hosting platforms don't support Bun natively. Heroku can't run it. PythonAnywhere obviously can't. Even Render requires workarounds.
RaidFrame runs Docker containers. If it runs in Docker, it runs on RaidFrame. Bun has an official Docker image. Done.
Try RaidFrame free
Deploy your first app in 60 seconds. No credit card required.
Prerequisites
- Bun installed (
curl -fsSL https://bun.sh/install | bash) - A GitHub account
- A RaidFrame account (sign up free)
Step 1: Create a Hono app
bun create hono@latest my-api
cd my-apiChoose the bun template when prompted.
Step 2: Add database access
bun add drizzle-orm postgres
bun add -d drizzle-kitCreate src/db.ts:
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
const client = postgres(process.env.DATABASE_URL!);
export const db = drizzle(client);Create src/schema.ts:
import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
export const users = pgTable("users", {
id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
email: text("email").notNull().unique(),
name: text("name"),
createdAt: timestamp("created_at").defaultNow(),
});Step 3: Create API routes
Update src/index.ts:
import { Hono } from "hono";
import { db } from "./db";
import { users } from "./schema";
const app = new Hono();
app.get("/", (c) => c.json({ status: "ok", runtime: "bun" }));
app.get("/users", async (c) => {
const result = await db.select().from(users);
return c.json(result);
});
app.post("/users", async (c) => {
const { email, name } = await c.req.json();
const [user] = await db.insert(users).values({ email, name }).returning();
return c.json(user, 201);
});
export default {
port: Number(process.env.PORT) || 3000,
fetch: app.fetch,
};Step 4: Add a Dockerfile
FROM oven/bun:1
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --production
COPY . .
EXPOSE 3000
CMD ["bun", "run", "src/index.ts"]Step 5: Deploy
rf login
rf init
rf deployRaidFrame builds the Docker image, provisions PostgreSQL, sets DATABASE_URL, and deploys. Run the migration:
rf run "bunx drizzle-kit push"Your Bun + Hono API is live. Try it:
curl https://my-api.raidframe.app/
# {"status":"ok","runtime":"bun"}
curl -X POST https://my-api.raidframe.app/users \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","name":"Dev"}'Try RaidFrame free
Deploy your first app in 60 seconds. No credit card required.
How fast is Bun + Hono?
Benchmarks on RaidFrame's free tier (shared CPU, 512MB RAM):
| Stack | Requests/sec | Avg Latency |
|---|---|---|
| Bun + Hono | ~45,000 | 0.8ms |
| Node + Express | ~12,000 | 3.2ms |
| Node + Fastify | ~22,000 | 1.8ms |
| Python + Flask | ~2,500 | 15ms |
Bun + Hono is roughly 3.5x faster than Express on identical hardware. For a free tier, that's more than enough for production.
Why not deploy to Cloudflare Workers?
Cloudflare Workers is great for edge functions but has limitations:
- No native PostgreSQL connections (need Neon or Hyperdrive)
- 10ms CPU time limit on free tier
- No file system access
- No long-running processes
RaidFrame gives you a full container — persistent connections, file system, background jobs, no CPU limits.
FAQ
Does RaidFrame support Bun natively?
RaidFrame runs Docker containers. The official oven/bun Docker image works perfectly. No special configuration needed.
Can I use Drizzle ORM with RaidFrame's PostgreSQL?
Yes. RaidFrame provides a standard PostgreSQL connection string via DATABASE_URL. Use Drizzle, Prisma, Kysely, or raw SQL — all work.
How do I add WebSocket support?
Hono supports WebSockets natively with Bun. RaidFrame supports persistent WebSocket connections — no 30-second serverless timeouts.
Is Bun production-ready in 2026?
Yes. Bun reached 1.0 stability in 2023 and has been production-ready since. Major companies use it in production. The Docker image is officially maintained.
Can I add a React/Vue frontend to the same project?
Yes. Add Vite as a dev dependency, build your frontend, and serve static files from Hono. Or deploy frontend and backend as separate services in a monorepo.
What's next?
- Add Redis caching to your API
- Set up WebSocket hosting for real-time features
- Deploy your Next.js frontend alongside this API
Deploy the fastest TypeScript backend stack for free — start now.
Ship faster with RaidFrame
Auto-scaling compute, managed databases, global CDN, and zero-config CI/CD. Free tier included.