Skip to main content

Requirements

  • Node.js 18+
  • 1GB+ RAM
  • Ubuntu 20.04+ (or similar)
  • Domain with DNS access

Deployment Steps

1

Build the project

On your local machine:
npm run build
This creates an optimized production build in .next/
2

Upload the files

Upload these files/folders to your server:
- .next/
- public/
- node_modules/
- package.json
- package-lock.json
- next.config.ts
3

Start the server

npm run start
Your site runs on port 3000 by default.To specify a different port:
PORT=8080 npm run start
4

Use PM2

Keep your site running with PM2:
# Install PM2
npm install -g pm2

# Start your site
pm2 start npm --name "latch" -- start

# Auto-restart on server reboot
pm2 startup
pm2 save

# View logs
pm2 logs latch

# Restart
pm2 restart latch