Skip to content
Docs

NestJS on Vercel

NestJS is a progressive Node.js framework for building efficient, reliable and scalable server-side applications. You can deploy a NestJS app to Vercel with zero configuration using Vercel Functions.

NestJS 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

You can quickly deploy a NestJS application to Vercel by creating a NestJS app or using an existing one:

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

  • src/main.{js,mjs,cjs,ts,cts,mts}
  • src/app.{js,mjs,cjs,ts,cts,mts}
  • src/index.{js,mjs,cjs,ts,cts,mts}
  • src/server.{js,mjs,cjs,ts,cts,mts}
  • main.{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/app.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
 
async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  await app.listen(process.env.PORT ?? 3000);
}
bootstrap();

Use vercel dev to run your application locally

terminal
vercel dev
Minimum CLI version required: 48.4.0

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

terminal
vc deploy
Minimum CLI version required: 48.4.0

To deploy your NestJS app without an account or login, run this command in the project root:

terminal
vercel deploy --temporary

The CLI builds the project, deploys it to production, and prints a claim URL. Claim the project to keep it live. See Deploying without logging in.

When you deploy a NestJS app to Vercel, your NestJS application becomes a single Vercel Function and uses Fluid compute by default. This means your NestJS app will automatically scale up and down based on traffic.

Use NestJS's @Sse() decorator with an Observable to send server-sent events from a controller. See the NestJS streaming example for a route running on Vercel.

Use Cron Jobs to call a NestJS route on a schedule. Configure the route and schedule, then check the request's Authorization header against your CRON_SECRET environment variable before running the task. See the NestJS cron job example.

Use Runtime Logs to inspect application output and errors, and Observability to investigate request duration and failures. See monitoring NestJS with Observability for details.

All Vercel Functions limitations apply to the NestJS application, including the standard bundle size limit of 250MB for Node.js applications. Large Functions support Node.js bundles up to 5GB on Fluid compute when enabled (public beta).

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

Last updated November 14, 2026

Was this helpful?

supported.