Discuss

NodeJS FTP deploy on shared hosting with Plesk and cPanel

On this page

NodeJS requires a specific setup on your hosting, which is different than the standard Linux or Windows server where you most likely upload everything in the public_html or www folder.

Set Up Site in your Hosting Panel

In this tutorial we will show you how to setup your hosting through the Plesk panel, but it's quite similar in cPanel.

Create your site in the hosting panel and add NodeJS to it:

unknown|690x297

FTP account

Then setup your FTP account:

unknown (1)|641x301

It should be pointing to this website root folder.

unknown (2)|592x393

Node files folder

In your site root create a new folder, called /app NOTE: Do not create this folder in the public_html folder.

Screenshot_11|661x278

this folder will be used for your NodeJS project files.

Setup Wappler Remote Target

The next step is to setup your Wappler target, pointing to the remote hosting. Create a new target and enter your ftp details. Important - the remote folder should be set to /app - the folder which we created in the previous step:

Screenshot_12|680x500

Click Save.

Switch to the remote target (1) and click publish (2):

Screenshot_13|665x500

Your files will be uploaded to the remote target.

Configuring NodeJS options on your hosting

Now, let's go back to the Plesk panel, we need to configure NodeJS settings. There are 3 things you need to setup:

  1. Set document root - to the /public folder
  2. Set application root - to the /app folder
  3. Change app.js file to index.js

Screenshot_14|596x376

Then click the Enable NodeJS button:

Screenshot_4|535x355

You will see a notification that NodeJS has been enabled for your site:

Screenshot_5|585x398

Next step is to install the required packages. Click NPM install:

Screenshot_6|585x398

Wait for the packages to be installed and click the Restart App after that:

Screenshot_10|551x402

And you are done. You have your hosting set up properly for your NodeJS project.