> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enabling Node.JS (Linux Cloud/Shared plans)

Our Mocha, and WordPress Premium + Advanced packages offer support for NodeJS (Any accounts purchased since January of 2018).

## Integrate NodeJS application

Its easy to integrate NodeJS application to a web server via **.htaccess**. You should replace **PORT** with the port on which your NodeJS application listens.

1. Login to the Cpanel.

![](https://tutorials.my-virtual-panel.com/cpanel_nodejs/1_Cpanel_Nodejs.png)

2. Choose the **File Manager**.

![](https://tutorials.my-virtual-panel.com/cpanel_nodejs/2_Cpanel_Nodejs.png)

3. Edit your **.htaccess** file.

![](https://tutorials.my-virtual-panel.com/cpanel_nodejs/3_Cpanel_Nodejs.png)

4. Add the following lines and click **Save**:

`RewriteEngine On 
 RewriteRule ^$ https://127.0.0.1:PORT/ [P,L] 
 RewriteCond %{REQUEST\_FILENAME} !-f 
 RewriteCond %{REQUEST\_FILENAME} !-d 
 RewriteRule ^(.*)$ https://127.0.0.1:PORT/$1 [P,L]`

![](https://tutorials.my-virtual-panel.com/cpanel_nodejs/4_Cpanel_Nodejs.png)

* Unused port should be selected for NodeJS application **(Recommended RANGE: 40000 - 65535)**
* The .htaccess files can be created under every domain/sub-domain or folder
* If the NodeJS application fails to start, select a new port from the above range
* Each NodeJS application listens on its own port which is configured in the code

PS: Currently this functionality is available for our Mocha + WP Premium/Advanced plans purchased since January of 2018.
