Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Deploy NestJS on an Ubuntu VPS by running the compiled application on a private local port, supervising it with PM2 or systemd, and putting Nginx on the public ports as a reverse proxy. Point DNS to the server, configure TLS for HTTPS, then verify health checks, logs, and reboot recovery.

This guide covers the complete path from a new Ubuntu host to a repeatable production service. Commands assume an application directory such as /var/www/nest-app, a deploy user named deploy, and an internal NestJS port of 3000; change those values to match your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the finished deployment looks like

A browser or API client connects to your domain on TCP ports 80 or 443. Nginx terminates TLS, accepts the public request, and forwards it to NestJS on 127.0.0.1:3000. The Node.js process is not exposed directly to the Internet. PM2 or systemd starts it after boot, restarts it after a crash, and keeps it running after your SSH session ends.

The request path is therefore:

  1. DNS resolves your domain to the Ubuntu server’s public IPv4 or IPv6 address.
  2. Nginx receives HTTP or HTTPS traffic on ports 80 and 443.
  3. Nginx forwards the request to the local NestJS listener.
  4. NestJS reads its production environment and services the request.

When more than one application instance is required, Nginx can distribute traffic among several Node.js servers. A single VPS normally needs only one supervised NestJS process.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Prerequisites and supported versions

Application requirements

  • A working NestJS application that can be built with npm run build.
  • Production environment variables and access to every required database, cache, queue, or other service.
  • A known entry file after compilation. The usual output is dist/main.js; custom source layouts can produce dist/src/main.js.
  • An application port selected by app.listen() or the PORT environment variable. NestJS commonly uses port 3000 when no other value is supplied.

Ubuntu host requirements

  • A reachable Ubuntu server with a public address and an administrative account that is not root.
  • Node.js 20.19 or later, or 22.12 or later on the 22.x line. Use an active-LTS release rather than an end-of-life version.
  • A DNS A record for IPv4 and, if you use IPv6, an AAAA record pointing to the server.
  • Firewall access limited to the ports you actually need. Public HTTP and HTTPS require ports 80 and 443; SSH requires your administration port.
  • A certificate from a trusted certificate authority for the hostname that clients will use.

Version check

Check the runtime before building. The versions shown by these commands must satisfy the NestJS deployment requirement above.

node --version
npm --version

If the distribution package is older than the supported Node.js line, install an active-LTS release using your organisation’s approved Node.js repository or version manager, then open a new shell and verify the version again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare Ubuntu securely

1. Create and use a non-root administrator

Log in with the provider’s initial account, create a normal user, grant administrative rights, and configure SSH keys. Use sudo for system changes; do not run the application as root.

sudo adduser deploy
sudo usermod -aG sudo deploy

Copy your SSH key to the new account, test a separate login, and only then consider disabling password authentication or the original provider account. Keep one tested recovery path before changing SSH settings.

2. Apply updates and install the edge software

sudo apt update
sudo apt upgrade -y
sudo apt install -y nginx

Install Node.js and npm at the supported version, then check that the node executable is available to the account that will run NestJS. If you later create a systemd unit, record the absolute path returned by command -v node; version managers often place Node outside /usr/bin.

3. Configure the firewall

Allow SSH and the two public web ports. Do not open the NestJS port to the Internet because Nginx is the public edge.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status

If your provider has a separate network firewall or security group, apply the same policy there. Restrict SSH to a trusted source range when your operating model permits it.

4. Point DNS at the server

Create an A record for the IPv4 address and an AAAA record only when IPv6 is correctly configured on the host. Use the exact hostname that will appear in the Nginx server_name and certificate. Check from a workstation with dig or another DNS utility; propagation time depends on the record’s previous TTL.

Put the NestJS application on the server

1. Create an application directory

sudo mkdir -p /var/www/nest-app
sudo chown -R deploy:deploy /var/www/nest-app
sudo -iu deploy
cd /var/www/nest-app

Use Git, a CI artifact, or another controlled deployment method to place the source in this directory. Keep the repository and build output owned by the service account rather than root.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

2. Install dependencies with the lockfile

Use the lockfile-aware command that matches the project. For npm projects, npm ci performs a clean installation from package-lock.json; use npm install only when the project intentionally updates its lockfile.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npm ci

Do not commit secrets. Create production environment variables through your deployment system or a protected file outside version control. Verify database URLs, credentials, signing keys, allowed origins, queue endpoints, and any service-specific settings before starting the app.

3. Confirm dependent services

From the server, test that every required database, broker, or external service is reachable with the credentials supplied to the application. A successful Node.js start does not prove that a later database connection, migration, or background job will work.

Build and smoke-test NestJS

1. Produce the production JavaScript

npm run build

List the output and identify the actual entry point:

find dist -maxdepth 3 -type f -name 'main.js' -print

The normal entry is dist/main.js. If your project emits dist/src/main.js or another path, use that path in the supervisor configuration. Production runs the compiled JavaScript, not the TypeScript source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Start it manually on the private port

Set the production environment and launch the compiled file. The command below assumes the usual entry point.

export NODE_ENV=production
node dist/main.js

Keep this shell open while testing. From a second SSH session on the server, call a health route or another known endpoint:

curl -i http://127.0.0.1:3000/health

Replace /health with a route that your application actually implements. A connection refusal usually means the process is not running or is listening on a different port. A response containing an application error points to NestJS configuration, dependencies, or environment variables rather than Nginx.

Stop the foreground process with Ctrl+C after the smoke test. Do not leave a manually started copy running when you create the supervised service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Keep NestJS running with PM2

PM2 is a practical choice for a single VPS. It owns the Node.js process, provides status and log commands, and can generate a systemd startup hook. Nginx remains responsible for public ports, TLS, and proxying.

1. Install PM2 and start the compiled entry point

sudo npm install --global pm2
cd /var/www/nest-app
NODE_ENV=production pm2 start dist/main.js --name nest-api

If the application uses a different port, set it at startup or in the PM2 environment configuration:

PORT=3000 NODE_ENV=production pm2 start dist/main.js --name nest-api

Use one source of truth for environment variables. For a larger set, create an ecosystem file that is readable only by the deploy account:

module.exports = {
  apps: [{
    name: 'nest-api',
    script: 'dist/main.js',
    cwd: '/var/www/nest-app',
    env_production: {
      NODE_ENV: 'production',
      PORT: 3000
    }
  }]
};

Start it with the production environment:

pm2 start ecosystem.config.cjs --env production

2. Inspect status and logs

pm2 status
pm2 logs nest-api --lines 100

Confirm that the process is online, the expected working directory is shown, and the logs contain a successful NestJS bootstrap without repeated crash loops. Test the local endpoint again while PM2 owns the process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Enable reboot recovery

Generate the startup integration:

pm2 startup

PM2 prints a command containing sudo and your user and home directory. Copy and run the exact command it prints; the generated command depends on the installed Node.js path and Ubuntu system. Then save the current process list:

pm2 save

The save step is essential. The startup hook can be present while the process list is empty, in which case nothing will be resurrected after a reboot.

4. Update the service safely

For a straightforward deployment, fetch the new revision, install dependencies, rebuild, and restart the named process:

cd /var/www/nest-app
git pull
npm ci
npm run build
pm2 restart nest-api
pm2 save

Run migrations in the order required by your application and check logs after the restart. If you operate PM2 in a multi-instance cluster, use its reload behaviour only after confirming that the application and migration strategy support it; a normal restart is clearer for a single process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use systemd instead of PM2 when you need native service control

Systemd is a valid alternative when you want unit files, resource controls, and logs in the system journal. Choose one supervisor for a given process; do not run the same NestJS entry point under both PM2 and systemd.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Example unit

Create /etc/systemd/system/nest-api.service as root and adjust the Node.js path, user, directory, and environment file:

[Unit]
Description=NestJS API
After=network.target

[Service]
Type=simple
User=deploy
WorkingDirectory=/var/www/nest-app
Environment=NODE_ENV=production
EnvironmentFile=/etc/nest-api.env
ExecStart=/usr/bin/node /var/www/nest-app/dist/main.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

If command -v node returns a path other than /usr/bin/node, use that absolute path or install Node.js system-wide for the service. Protect the environment file:

sudo chown root:root /etc/nest-api.env
sudo chmod 600 /etc/nest-api.env

Enable and inspect it

sudo systemctl daemon-reload
sudo systemctl enable --now nest-api
sudo systemctl status nest-api
sudo journalctl -u nest-api -n 100 --no-pager

After changing the build or environment, run sudo systemctl restart nest-api and check the journal. Systemd supplies reboot recovery through enable; PM2’s pm2 save and startup hook are not needed for this unit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure Nginx as the reverse proxy

1. Create a server block

Create a site configuration such as /etc/nginx/sites-available/nest-api. This HTTP-only block is useful before obtaining a certificate and also provides the redirect target later.

server {
    listen 80;
    listen [::]:80;
    server_name api.example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;

        proxy_connect_timeout 10s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
    }
}

Replace api.example.com and 3000. The forwarded headers let NestJS and downstream libraries know the original host, client address, protocol, and port. Adjust timeout values for your API’s longest legitimate request; do not use a long timeout to hide slow database calls.

2. Enable and validate the site

sudo ln -s /etc/nginx/sites-available/nest-api /etc/nginx/sites-enabled/nest-api
sudo nginx -t
sudo systemctl reload nginx

nginx -t must report a successful syntax check before every reload. If the default site answers for your hostname, remove or disable that conflicting server block after confirming it is not needed.

3. Test the proxy before TLS

Resolve the hostname and request it over HTTP:

curl -i http://api.example.com/health

A 200 response confirms the basic path. A 502 from Nginx means it cannot connect to the upstream; check the NestJS process, listening address, port, and Nginx error log:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo tail -n 100 /var/log/nginx/error.log
sudo tail -n 100 /var/log/nginx/access.log
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Add HTTPS and redirect HTTP

1. Obtain a certificate

Your certificate authority must issue a certificate covering the exact hostname in server_name. The public validation path normally requires DNS to resolve correctly and inbound port 80 to be reachable; keep port 443 open for normal HTTPS traffic.

You can install the certificate manually by placing the certificate chain and private key in protected locations, then referencing them in Nginx. If your certificate authority supplies an Nginx integration tool, follow its documented issuance and renewal procedure rather than copying paths from another server.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

2. Add the TLS server block

After issuance, add a second server block. The certificate paths below are examples; use the paths created by your certificate process.

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name api.example.com;

    ssl_certificate     /etc/ssl/api.example.com/fullchain.pem;
    ssl_certificate_key /etc/ssl/api.example.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;

        proxy_connect_timeout 10s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name api.example.com;
    return 301 https://$host$request_uri;
}

On Nginx versions that support it, HTTP/2 can be enabled according to the version’s TLS configuration syntax. Keep certificate and private-key files readable only by the accounts that need them.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Validate renewal

sudo nginx -t
sudo systemctl reload nginx
curl -I http://api.example.com/health
curl -i https://api.example.com/health

The HTTP request should return a redirect, while HTTPS should reach NestJS and present a certificate valid for the requested hostname. Check your certificate tool’s renewal timer or scheduled job and perform its documented dry run. A certificate that works today but is never renewed is not a production HTTPS setup.

Production verification checklist

Do these checks from outside the server as well as locally:

  • DNS A and AAAA records resolve to the intended addresses, and IPv6 works if an AAAA record exists.
  • Only intended public ports are open; the NestJS port is reachable on localhost but not from the Internet.
  • curl -i https://your-domain.example/health returns the expected status and body.
  • The TLS certificate matches the hostname, is not expired, and the HTTP endpoint redirects to HTTPS.
  • Application logs show normal startup and no repeated connection or migration errors.
  • Nginx access and error logs contain the expected request and no upstream failures.
  • The chosen supervisor reports the process as running.
  • Environment files, Nginx configuration, deployment scripts, and database data are included in your backup plan.

Deliberate reboot test

Schedule a maintenance window, record the current health response, and reboot:

sudo reboot

After SSH returns, check the supervisor, Nginx, and the public endpoint:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
pm2 status
sudo systemctl status nginx
curl -i https://your-domain.example/health

If you chose systemd, replace the PM2 check with sudo systemctl status nest-api. This test proves that the process list, environment, network ordering, certificate files, and Nginx configuration survive a real restart.

Troubleshooting by symptom

Symptom Likely cause What to check
npm run build fails Dependency, TypeScript, or environment configuration error Run the build as the deploy user, inspect the first compiler error, verify the lockfile and required build-time variables, then confirm the generated dist path.
Node exits immediately Wrong entry file, missing variable, failed database connection, or application exception Run node dist/main.js in the application directory and read the complete startup output; then inspect PM2 logs or the system journal.
Local curl returns connection refused Process is stopped, bound to another port, or listening only on a different address Check the supervisor status, the value of PORT, application app.listen(), and the listening sockets with your host’s standard socket utility.
Nginx returns 502 Nginx cannot reach the upstream Confirm NestJS is listening on 127.0.0.1:3000, verify proxy_pass, and read /var/log/nginx/error.log.
Correct app works by IP but not by hostname DNS or Nginx server_name mismatch Inspect A/AAAA answers, the requested hostname, enabled server blocks, and the certificate names.
HTTPS fails while HTTP works Certificate path, key permissions, firewall, or TLS server-block error Run sudo nginx -t, verify both certificate files, allow port 443, reload Nginx, and inspect its error log.
Service disappears after reboot PM2 process list was not saved, startup command was not installed, or systemd unit was not enabled For PM2, run pm2 startup and pm2 save as the service user. For systemd, run sudo systemctl enable --now nest-api.
Client IP or scheme is wrong in NestJS Forwarded headers are missing or the application is not configured to account for its proxy Confirm the Nginx proxy_set_header directives and use the framework’s documented proxy/trust settings for your version.

Deployment and operating practices

Keep releases repeatable

Record the Node.js version, build command, entry path, environment-variable names, migration order, supervisor configuration, and Nginx server block in versioned deployment documentation. Build the same way on every release and keep the previous build or revision available for rollback.

Protect secrets and configuration

Never place production secrets in Git. Restrict permissions on environment files, private keys, and deployment credentials. Back up the configuration needed to recreate the service, but encrypt backups that contain credentials or database data.

Separate application and edge responsibilities

Nginx should own public ports, TLS, request forwarding, and access/error logs. PM2 or systemd should own process lifetime and application logs. Keeping those responsibilities separate makes it easier to identify whether a failure is in DNS, TLS, Nginx, the supervisor, NestJS, or a dependent service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scale only when the workload requires it

When one process is no longer sufficient, run multiple NestJS instances on private ports or hosts and configure an Nginx upstream/load-balancing arrangement. Ensure the application can operate correctly with more than one instance and define how sessions, uploaded files, scheduled jobs, and database migrations are coordinated before adding replicas.

When is the deployment production-ready?

The deployment is ready when the compiled application starts under a supervisor, listens only on its intended private port, and remains healthy after an SSH disconnect and a full reboot. DNS must resolve to the server, Nginx must proxy the correct host and forwarding headers, HTTP must redirect to HTTPS, certificate renewal must be scheduled and tested, and logs and backups must be available to the operator. A successful one-time start command is only the beginning; these recovery and verification checks are what make the service dependable.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.