NodeJS FTP deploy on shared hosting with Plesk and cPanel

Instructions specific to cPanel.

If you already have this application available in your cPanel, then you can continue with this doc.

Open File Manager

Create a new directory at root level called nodejsapp, you could call it something different if you like, I hade issues with just calling it app
Screenshot 2020-06-03 at 12.34.39

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 /nodejsapp - the folder which we created in the previous step: Or whatever name you may have chosen.


Click Save

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


Your files will be uploaded to the remote target. Once fully published I would suggest going into the cPanel File Manager and renaming the Wappler uploaded index.js to app.js

Open the Application Manager
Click Register Application

Here are my settings, if in the file manager step you named your directory something other than nodejsapp then adjust the Application Path parameter accordingly.

Click deploy once complete and then back at the main Application Manager screen you should see a button saying Ensure dependencies


Click it.
*If your Application Manager never shows the Ensure dependencies button then your App Settings are incorrect and you need to edit until you get that right, or it will never show itself.

If you get a green done message, great, if you get a red error, you may have to add a file, look here for details Nodejs on cpanel problems and how to fix them

You have to restart the node side to check if this is working however there is no restart button, I just did another publish in Wappler which sent the restart command.

Lastly you need to go back to File Manager and change the name of /nodejsapp/index.js to /nodejsapp/app.js or the passenger module will not over ride the mod_userdir module from Apache, if you had not already done that from earlier.

Browse to your website and it should display fine, if not do a last Wappler publish to send the restart again.

If you do not have the Application Manager in your cPanel you may have to ask your Hosting company to enable it for you site or if you have access to WHM you can provision the Ruby via mod_passenger in EasyApache 4


After this it should be available in cPanel.

10 Likes