Small Corner Labs

How to Move a Node.js App and Nginx to a New VPS

By Small Corner Labs ·

Move a Node.js app in layers: recreate the runtime, restore application data, start the service locally, then validate Nginx and HTTPS with the production hostname. Keeping those checks separate makes it easier to locate a failure.

Recreate the runtime and service layout

Record the Node version, lockfile, working directory, service user, environment-file location, and internal port. Reinstall dependencies for the destination OS and architecture. Copy only the persistent state and required configuration, keeping a backup that can be restored independently.

Watch for absolute paths in credential settings, backup destinations, and systemd options. A path copied from a Windows deployment may not point to anything on Linux. Check ownership and file permissions under the account that will actually run the service.

Verify the application and reverse proxy separately

Start the app on its intended loopback address and check a simple response and a data-backed response. Then validate the Nginx configuration and test the upstream through the proper virtual host. Test a nested static page as well; a homepage can work even when the route rules for exported HTML are wrong.

When HTTPS is involved, connect to the destination using the intended hostname and SNI. Check the certificate names, trust path for your deployment, and redirect behavior. A request to a bare IP may reach a different Nginx virtual host.

Check the background behavior

Confirm scheduled jobs are active only where intended, logs are going to the expected place, and the destination service can recover after a stop or reboot. Once the public route is cut over, repeat the data-backed checks through the actual domain.

Quick checklist

  • Match the Node runtime and service configuration.
  • Verify Linux paths and permissions.
  • Check loopback, proxy, and hostname TLS in order.
  • Verify background jobs and external routing after cutover.