Documentation menu

Deploy NestJS on Light Cloud - built and run as a Node.js container on port 3000, with configuration from environment variables.

Deploy NestJS

NestJS is detected from your package.json and runs as a Node.js container on port 3000. The generated image runs your build script (Nest's TypeScript compile) and starts the compiled app on Node 22.

Serve it#

Listen on the routed port, all interfaces:

const app = await NestFactory.create(AppModule);
await app.listen(process.env.PORT ?? 3000, '0.0.0.0');

Configuration and database#

@nestjs/config reads process.env - which is where environment variables arrive at runtime, per environment. Set DATABASE_URL from the Credentials tab for TypeORM, Prisma, or Mikro-ORM.

Run migrations at startup or from your laptop against the same endpoint - see Connect from your laptop.

Scaling#

Nest apps often carry DI-heavy startup - keep providers lazy where possible so cold starts stay short, or set min instances to 1 on production.