Deploy NestJS App on Seenode | NestJS Hosting & Deployment Guide
This guide explains how to deploy your existing NestJS application to seenode.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- A seenode account at cloud.seenode.com
- Git configured on your machine
- Existing NestJS project ready to deploy
Configure for seenode Deployment
Section titled “Configure for seenode Deployment”Port Configuration
Section titled “Port Configuration”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.
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();Package Scripts
Section titled “Package Scripts”Ensure your package.json includes the following scripts:
{ "scripts": { "build": "nest build", "start:prod": "node dist/main" }}Deploy on seenode
Section titled “Deploy on seenode”-
Push to Git
Commit your project and push it to GitHub or GitLab.
-
Create a Web Service
From the seenode Dashboard, create a new Web Service and connect your NestJS project’s Git repository.
-
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
- Build Command:
-
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 aPORTenvironment variable. Then configure any additional environment variables your application needs in the Environment section. -
Choose Pricing Tier
Select your preferred instance size and create your service.
-
Deploy
Click Create Web Service and watch logs until your web service is live.
-
Success
Once complete, your NestJS application will be accessible via your service’s URL.
Starting from Scratch?
Section titled “Starting from Scratch?”If you don’t have a NestJS project yet:
Option 1: Use our Template (Recommended)
NestJS Template
Deploy a NestJS project pre-configured for production.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:
- Install NestJS CLI:
npm i -g @nestjs/cli - Create project:
nest new your-project-name - Configure port from environment variable
- Set up production build scripts
Next Steps
Section titled “Next Steps”Now that your NestJS application is deployed, here are some things you might want to do next:
Set up a Custom Domain (Coming Soon)
Configure a custom domain to point to your new web service.Connect to a Database
Instantly scaffold and connect PostgreSQL and MySQL databases