First, ssh into your Pod as root. In this example, the Pod’s hostname is nodepod. Once logged in, Node.js can easily be installed with the apt-get package manager:
root@nodepod:~# sudo apt-get update root@nodepod:~# sudo apt-get install python-software-properties python g++ make root@nodepod:~# sudo add-apt-repository ppa:chris-lea/node.js root@nodepod:~# sudo apt-get update root@nodepod:~# sudo apt-get install nodejs
That’s it. You can now test that the install worked correctly by writing your first Node.js program, and running it.
Create a file called hello.js, containing the below:
You can run this as bellow, and should see “Hello, world” as the output.
root@nodepod:~# node hello.js
Enjoy! And by the way, we love Node.js. We recommend looking into npm to install different packages, and the excellent Express framework, next.