Ubuntu

How to Install MongoDB on Ubuntu 16.04

In this tutorial we will learn how to install and configure MongoDB, which is the most popular NoSql Database Server.

How to Install MongoDB on Ubuntu 16.04

It is very easy to Install MongoDB on Ubuntu 16.04 with apt repository provides by the MongoDB.

First, we install the Public Key for the apt repository:

sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 0C49F3730359A14518585931BC711F9BA15703C6

Then, we create the apt source file:

echo “deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Next, install MongoDB on Ubuntu 16.04 with apt-get command:

sudo apt-get update
sudo apt-get install mongodb-org

To start MongoDB on Ubuntu Type:

sudo systemctl start mongod.service

To enable MongoDB to start when system restart, Type:

systemctl enable mongod.service

Restart MongoDB Server:

sudo systemctl restart mongod.service

The MongoDB Shell is the command line interface to manage MongoDB Server. To open MongoDB shell, Type:

mongo

Ubuntu Server Admin

Recent Posts

🚀 Deploy Elastic Stack on Ubuntu VPS (5 Minute Quick-Start Guide)

Here’s the guide to deploy Elastic Stack on Ubuntu VPS, with secure access, HTTPS proxying,…

24 hours ago

🚀 Deploy Nagios on Ubuntu VPS

This guide walks through deploying Nagios Core on an Ubuntu VPS, from system prep to…

1 day ago

Shoryuken Has a New Maintainer, and v7.0.0 Is Almost There

After a decade under Pablo Cantero's stewardship, Shoryuken has a new maintainer - me. I'm…

5 days ago

A better way to provision NVIDIA BlueField DPUs at scale with MAAS

MAAS 3.7 has been officially released and it includes a bunch of cool new features.…

2 weeks ago

Ruby Floats: When 2.6x Faster Is Actually Slower (and Then Faster Again)

Update: This article originally concluded that Eisel-Lemire wasn't worth it for Ruby. I was wrong.…

2 weeks ago

MicroCeph: why it’s the superior MinIO alternative (and how to use it)

Recently, the team at MinIO moved the open source project into maintenance mode and will…

2 weeks ago