Development / Guide

Choosing and Deploying a Node.js Server

Choosing a Node.js server starts with how the application works. Static output, server-side rendering, API, and queue worker do not have the same deployment needs.

Determine how the application works

If the project produces only static HTML/CSS/JavaScript, output files can be published to static hosting. If there is an API or rendering process running on the server side, the Node.js process must run continuously. This distinction directly changes the need for infrastructure.

Also list WebSocket, scheduled task, and background workers. Don't assume standard PHP hosting supports these. Obtain clear runtime and process policy from the provider.

Runtime and dependencies

Select a Node.js version that is still in support and test the compatibility of your dependencies. Separate Active LTS, Maintenance LTS, and end of support statuses in the official release calendar. Do not make the version written in an old sample a permanent choice.

Use repeatable installation with lock file. Native modules may depend on the operating system and processor architecture; Do not assume that files prepared in another environment will work on the target server without testing them.

Build, process management and reverse proxy

Measure memory demands incurred during compilation separately from normal operating consumption. Separating the intensive build process from the live application can be useful on small servers. Preserve the old working output so that the released version can be rolled back.

Define how the application process starts at server startup and restarts on failure. Manage HTTPS and external connections via reverse proxy. Test connection promotion and timeout behavior in project using WebSocket.

Production checklist

  • Does the health check show that the app is actually working?
  • Aren't passwords and API keys included in the client package?
  • Do the logs contain personal data or secrets?
  • Are database and queue connections managed on error?
  • Is there a tried and tested method to undo the broadcast?

Node.js hosting options Consider your application type, database and continuous process needs together. Add operating system maintenance to the VDS cost.

Resources and further reading

Compare the appropriate service for your project.

Open Hosting Selection Tool