Install Node.js, Nginx And MongoDB On Ubuntu 16.04
loader image
Web Development

Setup Node.js, Nginx And MongoDB On Ubuntu 16.04

This blog will show you how to install Node.js, nginx and mongodb on ubuntu 16.04 operating system including the configuration for production deployment.

Before setup, These following needs to be installed,
– Node.js
– MongoDB
– Nginx

Preparing Ubuntu Server

To start the setup process, we need to install software build tools on the server.



1. Install Node.js

You can install the latest version of Node.js using this link


Run the below command to install Node.js



Nodejs will have both nodejs and npm package, So we need not to install it separately. It will install both packages on the server.
And, check the versions of nodejs and npm to confirm the installation


So the output screen will show you the version of Nodejs installed on your server.

So the output screen will show you the version of Nodejs installed on your server.


Now the output will show you the version of NPM installed on your server.



2. Install MongoDB

Add apt repo to install mongodb on ubuntu.



Create the Package list file for MongoDB



Update the Ubuntu packages


Now Install MongoDB




To start the mongo service


To stop the mongo service



To check the status of mongo service

Related: How to setup MongoDB sharding environment


3. Install Nginx

By default nginx apt repository is available in Ubuntu. So run below command to install nginx service.

After the installation check nginx service using,

Configure Nodejs application into nginx

Now, Configure Nginx as a reverse proxy server for nodejs application.


Then, replace the below code in the nginx config file  to set up Nodejs application


After adding configuration restart the nginx service to apply the configuration changes


Finally, We can see your nodejs application on the Server URL which is configured in nginx.

Similarly, Want to explore more about Technologies? Join us on the excursion of exploring Technologies, Agira Technologies one of the fastest growing Web and Mobile Development Company in India. Precisely, extends its research on Blockchain, Chatbot, Artificial Intelligence, IoT and lot more on the queue. Explore more about us on

For more details reach us at

The following two tabs change content below.


An enthusiastic Tech Lead with 7 plus years of experience in Web development arena. Owns legitimate experience in Ruby, Ruby On Rails, AngularJs, DevOps. Golang, Another add on, This young tech freak never miss a chance to get his hands on planting and Gardening even in his busy weekends.

One thought on “Setup Node.js, Nginx And MongoDB On Ubuntu 16.04”

  1. Thanks for taking the time to share this article here about the Node.js, Nginx And MongoDB. Your article is very informative and useful for those who are interested to know more about the process of installing Node.js, Nginx and MongoDB on Ubuntu 16.04.

Leave a Reply

Your email address will not be published. Required fields are marked *

Join our 30,000+ subscribers, never miss out anything on our latest blogs, tips, tutorials, updates & more.