Nodejs - settings via Virtualmin per virtual server (NVM)

SYSTEM INFORMATION
OS type and version: Ubuntu 20.02
Webmin version: 1.981
Virtualmin version: 6.17

Beside installing nodeJS via apt globally , it’s possible to use nvm. The great benefit of this is, that you can choose the node version you like to use - by simply execute a command in the command-line.

As Javascript getting more and more general for Server side, it would be nice to have an webmin/virtualmin module to manage this, and make the user able to install node an choose version itself.

Install it: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Work with nvm is easy, as there are only a few commands: How To Install NVM on Ubuntu 20.04 – TecAdmin

Is something like that planed in VM7?
How hard will it be to create an Webmin-Plugin for that (I’m not yet familiar with perl)

General Information / Links

Hello,

We do support Node.js installation per virtual server from Install Scripts page but for Virtualmin Pro only.


Ok, but is that only the plain installation, or does there other webmin/ virtualmin plugins which make the webspace-owner able to adjust the settings.

As I’d think a bit deeper about this node-integration I also recognized, that it could become tricky with “ports” at the server.

For example, if you run nextjs, it will listen to port 3000 which also needs an proxy_pass to this port.
But if one user still use this Port, it couldn’t be established for another user.

And the other thing is: What If ports (open) available from outside (not only internally). Will this soften the server-security, because you now have many open nodejs server-endpoints listening at the internet?

So there will be need something like a dynamic port-range, and a way to configure this, right?
And maybe the nodeJS-Ports have to be setup on an internal-Network-Device with an non-routable IP (like 10.0.0.2)?!

How does this work at VM-Pro? Do you only have one node-server for the whole Virtualmin-Server, which listen on one port, or does they created and assigned (to proxy_pass) automatically per user?

When you’re installing Node.js, all you should do is to specify a version installed and a directory to where under virtual server it’s going to be installed, and from which later it will be accessible.

Port clashes are handled. We assign a free port for installed Node.js instance and create a proxy on webserver side. Ports are not exposed to the outside world, as there is no need for this, cause it runs under virtual server.

Do you only have one node-server

No, we create a daemon for each installed Node.js instance, which runs as a virtual server owner.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.