Menu

Koa on Vercel

Last updated January 29, 2026

Koa is an expressive HTTP middleware framework for building web applications and APIs with zero configuration.​​​​ You can deploy a Koa app to Vercel with zero configuration using Vercel Functions.

Koa applications on Vercel benefit from:

  • Fluid compute: Pay for the CPU you use, automatic cold start reduction, optimized concurrency, background processing, and more
  • Preview deployments: Test your changes in a copy of your production infrastructure
  • Instant Rollback: Recover from breaking changes or bugs in milliseconds
  • Vercel Firewall: Protect your applications from a wide range of threats with a robust, multi-layered security system
  • Secure Compute: Create private links between your Vercel-hosted backend and other clouds

To allow Vercel to deploy your Koa application and process web requests, your server entrypoint file should be named one of the following:

  • src/app.{js,mjs,cjs,ts,cts,mts}
  • src/index.{js,mjs,cjs,ts,cts,mts}
  • src/server.{js,mjs,cjs,ts,cts,mts}
  • app.{js,mjs,cjs,ts,cts,mts}
  • index.{js,mjs,cjs,ts,cts,mts}
  • server.{js,mjs,cjs,ts,cts,mts}

For example, use the following code as an entrypoint:

src/index.ts
import Koa from 'koa'
import { Router } from '@koa/router'
 
const app = new Koa()
const router = new Router()
 
router.get('/', (ctx) => {
  ctx.body = { message: 'Hello from Koa!' }
})
 
app.use(router.routes())
app.use(router.allowedMethods())
 
app.listen(3000)

Use vercel dev to run your application locally.

terminal
vercel dev
Minimum CLI version required: 50.4.8

To deploy, connect your Git repository or use Vercel CLI:

terminal
vc deploy
Minimum CLI version required: 50.4.8

When you deploy a Koa app to Vercel, your Koa application becomes a single Vercel Function and uses Fluid compute by default. Vercel automatically scales your Koa app up and down based on traffic.

All Vercel Functions limitations apply to the Koa application, including the size of the application being limited to 250MB.

Learn more about deploying Koa projects on Vercel with the following resources:


Was this helpful?

supported.