Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Dec 16, 2025, 03:24 AM

Title: How to run a simple node.js application in Plesk to test it working?
Post by: Suhitha on Dec 16, 2025, 03:24 AM
Applicable to:



Question

How to run a simple node.js application in Plesk to test it working?


Answer

1.Log into Plesk.

2.Go to Domains > example.com > File Manager.

3.Create a file app.js in httpdocs directory and remove index.html file:

(https://pix.cobrasoft.org/images/2025/12/16/Screenshot.png)

4.Click on the file app.js in File Manager to open it in built-in text editor and put the code below:

const http = require('http');

http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end("Hello, World!\n");
}).listen(process.env.PORT);

console.log('App is running...');
5.Go to Domains > example.com > Node.js and make sure that Document Root and Application Root point to httpdocs directory where app.js file stored

6.Enable Node.js:

(https://pix.cobrasoft.org/images/2025/12/16/Screenshot_1_.png)

7.Open in a browser the http://example.com page to see how is it working:

Hello, World!