Now we will show you how to get started with NodeJS on an Ubuntu 18.04 server. You can install Nodejs in several ways. We will show you how to install using apt package manager.
First, open terminal and type the following command:
Secondly, update the apt and then install NodeJS from the repository. To do this type following command:
Then, install NodeJS. We can also install Nodejs Package Manager, it is called npm. Npm Package Manager can allow you to install modules and package to use with NodeJS. You can do this by typing the following command:
Now run our basic web server using the following command and type “http://127.0.0.1:3000“ in any browser, the output will be as follow: