Skip to content

Deploy NestJS App on Seenode | NestJS Hosting & Deployment Guide

This guide explains how to deploy your existing NestJS application to seenode.

Before you begin, ensure you have:

  • A seenode account at cloud.seenode.com
  • Git configured on your machine
  • Existing NestJS project ready to deploy

By default, a new NestJS application listens on port 3000. To deploy on seenode, modify src/main.ts to listen on the port defined in an environment variable, defaulting to 80 when PORT is not set. You can then set this PORT variable in your service’s environment settings on seenode.

src/main.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 || 80);
}
bootstrap();

Ensure your package.json includes the following scripts:

package.json
{
"scripts": {
"build": "nest build",
"start:prod": "node dist/main"
}
}
  1. Push to Git

    Commit your project and push it to GitHub or GitLab.

  2. Create a Web Service

    From the seenode Dashboard, create a new Web Service and connect your NestJS project’s Git repository.

  3. Configure Build & Start

    seenode will attempt to detect these automatically for a NestJS project. Configure:

    • Build Command:
      npm i && npm run build
    • Start Command:
      npm run start:prod
    Configure Build & Start: Port field
  4. Configure Port and Environment Variables

    In the Configure Build & Start screen, set the Port field (above Environment Variables) to your desired value (e.g., 8080). You do not need to add a PORT environment variable. Then configure any additional environment variables your application needs in the Environment section.

  5. Choose Pricing Tier

    Select your preferred instance size and create your service.

  6. Deploy

    Click Create Web Service and watch logs until your web service is live.

  7. Success

    Once complete, your NestJS application will be accessible via your service’s URL.

If you don’t have a NestJS project yet:

Option 1: Use our Template (Recommended)

Option 2: Create from NestJS Docs + seenode Setup

Follow the official NestJS documentation to create a new project, then return here for seenode-specific deployment steps.

seenode-Specific Setup Steps:

  1. Install NestJS CLI: npm i -g @nestjs/cli
  2. Create project: nest new your-project-name
  3. Configure port from environment variable
  4. Set up production build scripts

Now that your NestJS application is deployed, here are some things you might want to do next: