Start here: complete step-by-step guides

NestJS API: from nest new to live, step by step

Create a NestJS project, make it listen on our port, push to GitHub and deploy with the NestJS preset.

  1. Create the project
  2. Listen on PORT
  3. Push to GitHub
  4. Launch and configure
  5. Deploy from GitHub
  6. Test the API
  7. Go live on your domain
  8. Database

1. Create the project

npx @nestjs/cli new my-api
cd my-api
npm run start:dev      # http://localhost:3000

2. Listen on PORT

Open src/main.ts and change the listen line:

await app.listen(process.env.PORT ?? 3000, '127.0.0.1');

3. Push to GitHub

git add .
git commit -m "Listen on PORT"
git branch -M main
git remote add origin https://github.com/you/my-api.git
git push -u origin main

4. Launch and configure

Launch an app → Node.js → version → plan → domain → pay. Then App settings → Framework NestJS (install npm ci || npm install, build npm run build, start node dist/main.js). Add database and API settings under Environment variables with + Add variable → Save all.

5. Deploy from GitHub

Git deployments → connect the repository → Deploy now → add the webhook so every push deploys.

6. Test the API

curl https://yourdomain.com/

Go live on your domain

Point the domain's @ and www A records to the IP shown in Domains, wait for Points here, then Issue free SSL → Always use HTTPS → Save changes.

Database

Create a MariaDB/MySQL or PostgreSQL database under Databases (host localhost), or attach MongoDB Atlas under Databases → External databases, and read the connection string from process.env in your TypeORM, Prisma or Mongoose config.

Stuck? Our engineers answer support tickets around the clock. Contact us, or create an account and open a ticket from the dashboard — the same guides are there too.

Next step

Move your site, or your whole cloud estate

Shared hosting you can buy in two minutes. Infrastructure and managed services quoted by an engineer within one business day.