Topics Map > Communication and Collaboration > cPanel Web Hosting

cPanel, How to Host a NodeJS Application

If you have a custom NodeJS application for your website, here's how to get it working on web.illinois.edu.

Putting your application on the server

Before you can configure your NodeJS application, you need to get the files to the server. After logging into your cPanel dashboard at https://web.illinois.edu, you can transfer the files by:

Application Configuration

Once your files are in place on the server, you can configure it to launch. From your cPanel dashboard:

  1. Under the Software section, select Setup Node.js App.
  2. Under Create Application, choose Development or Production.
    (Development has less caching and more logging. Production has more caching and less logging.) 
  3. Enter the Application root (the directory where you put the application).
  4. Enter the Application startup file.
  5. You can add environment variables using the Add Variable button.
  6. Once you've saved your application, resolve its package dependencies. You can do this automatically or manually.
    • The NPM package manager does this automatically based on the package.json file packaged with the application, so all that you’ll need to do is click on the NPM Install button. 
    • If you are familiar with the command line, you can follow the instructions at the top of the page to gain access to the npm and node commands to make additional changes manually, allowing for a great deal of customization.

Application Deployment

Once you have the application configured and the modules installed you can launch it by clicking the Run JS Script on the same page where you configured the application. This executes the application startup file that you defined during setup. 

As Node.js applications have several different options, this can bring up another menu with different options to select depending on the application that you’re running. In general, you’ll want to select the “Start” option next. 

Finally, you can select the “Open” option to visit your page, and see your application!




Keywords:cPanel, web hosting, NodeJS   Doc ID:91468
Owner:Web H.Group:University of Illinois Technology Services
Created:2019-05-01 13:27 CDTUpdated:2019-05-01 14:12 CDT
Sites:University of Illinois Technology Services
Feedback:  0   0