Install NodeJS

Below are the instructions to install nodejs from source which can be executed on any linux system.

4.x LTS

The relevant docs can be found here.

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

6.x Latest

The relevant docs can be found here.

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

Running the webserver

Add the bin folder to your path, then simply execute:

node [serverFile.js]  

This will run node on a single thread. If you have multiple vCPUs then you may wish to run Nginx or Apache as the HTTP handler which calls node.

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus