Search code examples
node.jsserverputty

Is there any way to manage node.js server from web interface?


I am in need to manage my node server without entering into server console. I have tried using forever, nodemon and pm2 npms. Whenever, I need to start or stop the node application, I need to connect the server via terminal. I want to avoid that and willing to see the possibility if that can be managed through any web interface or any browser plugin/extension.

Already tried forever, nodemon and pm2


Solution

  • I started looking for some GUI and Web interface of PM2. Tried several npms but "mc-pm2-web" worked really good for me.

    I am using Node via NVM and my node version was v10.15.3. Installed this https://www.npmjs.com/package/mc-pm2-web and it was straight forward what I was actually looking for.

    Here's are the step if anybody wants to install and configure "mc-pm2-web" in AWS EC2.

    1. I am using Amazon Linux
    2. I am using NVM and running v10.15.3
    3. Already had NGINX & PHP-FPM running on server using port 9000
    4. pm2 already installed

    Visit this link: https://www.npmjs.com/package/mc-pm2-web

    npm install -g pm2-web

    pm2-web

    If you encountered any error then you may check your config.json file. In my case the config file path was:

    /home/ec2-user/.nvm/versions/node/v10.15.3/bin/pm2-web/config.json

    I made following changes in config file to make it working:

    1. Port from 9000 to 9010 because 9000 was being used by PHP-FPM
    2. Changed the host name from "localhost" to "my-domain" which was already hosted in NGINX
    3. Enabled authentication and set the Username and Password for making it secure
    4. Allowed 9010 port from AWS EC2 firewall / security group of that instance
    5. Added pm2-web in pm2 by executing "pm2 start pm2-web" command