There are multiple fine tutorials on how to install Node.js and npm on the Pi3, but these are a bit out dated to use on the Raspberry 4 with.
For a few years I have had a RaspberryPi 3 running with php 5.6, 7.1, apache, webmin and virtualmin. On it some scanning software, websites and a package repository. This is all working well ( for light use ). But there are a few issues: no support for the latest versions of php and .. […]