I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Node.js on CentOS 7
Step 1. First, ensure your system is fully up-to-date by running the following:
yum -y update
Step 2. Installing Node.js.
Run the commands below to install NPM and NodeJS on your CentOS Server:
curl -sL https://rpm.nodesource.com/setup_7.x | bash -
Then install Node.js and npm packages using yum:
yum -y install nodejs npm
Step 3. Verify Node.js Installation.
To verify the installed version you can do:
To output shall be:
[firstname.lastname@example.org ~]# node --version v6.3.1
Install Node.js from source package
Step 1. First, install the development packages required for compiling Node.js source.
yum install gcc gcc-c++ make
Step 2. Download latest version of Node.js is available for download on https://nodejs.org/download/:
wget https://nodejs.org/dist/v5.3.0/node-v5.3.0.tar.gz tar xzf node-v5.3.0.tar.gz cd node-v5.3.0 ./configure make make install
Check the version of Node.js using the following command:
Congratulation’s! You have successfully install and configured Node.js on your CentOS 7 server.