Enabling Passenger for Node.js

Overview

Node.js is a JavaScript runtime environment used to develop server tools and applications. It uses JavaScript, traditionally a front-end programming language on the server side.

This article describes enabling Node.js to work with Passenger using the DreamHost panel.

What servers can Node.js be installed onto?

Node.js can be installed onto Shared, VPS, and Dedicated Servers.

The version of Passenger running on DreamHost servers does not currently function with Node.js versions 14+.

Can Node.js be used without enabling it in the panel?

Yes. You can create a Node.js app and deploy it manually. However, this can be a lot of work, depending on the complexity of your application. Deploying your Node.js app with Passenger is much easier and recommended.

If you choose not to use Passenger, you must find a way to deploy your application manually.

What does enabling Node.js in the panel do?

When you enable Node.js in the panel, Passenger knows your website is set up to run a Node.js app and automatically deploys it using Passenger on ports 80 and 443. However, this will only function under these two circumstances:

Passenger then loads the app.js file automatically when visiting your URL. In this case, you do not have to bind a port # to the URL or manually start the server. Your configuration would look like this:

app directory: example.com/app.js
web directory: example.com/public

Passenger is only able to run the file named app.js. If you have a server.js file that is normally used with your Node.js app, it must be renamed for Passenger to run it.

Enabling Passenger for Node.js in the panel

To enable Passenger for Node.js:

  1. Navigate to the Manage Websites page.
  2. Click the Manage button to open the Domain Settings page, which allows you to adjust various settings for your site.
    • If in Grid view, click the Manage button at the bottom of the website box.
    • If in List view, click the Manage button at the far right of your domain name.
  3. Scroll down to the Additional Settings section and click the Modify button on the Web Options row.
  4. Enable Passenger by clicking the radio button on the right. The panel adds a /public subdirectory, and the Node JS row appears.

    If you already have a /public directory in the current Web directory, clicking OK will only switch the 'Web directory' to this new /public folder. Nothing in it is removed.

    If you do not already have a /public directory, the panel creates it for you with a coming soon page. The files in your current Web directory remain untouched.

  5. Click the radio button on the Node JS row. When finished, click the Save Changes button to save your changes.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?