Skip to content

NodeJS

Cito has support for LTS node versions, enabling you to run node applications via Nginx + Passenger. NPM and Yarn are installed by default, too.

By default we run NodeJS 18.

Adding a NodeJS application

To add a nodejs site in Cito, run the psnew script and set the site type with the -t flag to nodejs.

The default startup file that Passenger will recognise (in public_html) should be named app.js.

Restarting a NodeJS application

Passenger has a couple of methods to do this:

restart.txt

One method to restart an application is by touching the file restart.txt in the application directory's tmp subdirectory. Once Passenger has noticed that the file's timestamp has changed, it will restart the application.

passenger-config restart-app

The preferred method for restarting an application, is through the passenger-config restart-app tool. This tool can run interactively or non-interactively. If you invoke passenger-config restart-app without arguments, it will ask you which application you want to restart.

passenger-config restart-app
Please select the application to restart.
Tip: re-run this command with --help to learn how to automate it.
If the menu doesn't display correctly, press '!'

 ‣   /Users/phusion/testapp/public (development)
     Cancel

For more information see the Passenger docs.

Advanced use

Passenger has a number of customisable runtime options. For more information about deploying NodeJS applications using Passenger, see the official documentation here:

https://www.phusionpassenger.com/library/deploy/nginx/deploy/nodejs/