Web Niraj
  • Facebook
  • Flickr
  • Github
  • Instagram
  • Linkedin
  • Twitter
  • YouTube
Online portfolio, code examples and developer blog
  • About
  • Contact
  • Portfolio
  • WordPress
  • Apps
    • Gemini Quota App for macOS
Search the site...
  • Home
  • Blog
  • AWS: Install MongoDB 3.x on Ubuntu 14

AWS: Install MongoDB 3.x on Ubuntu 14

4

If you’re running the default Ubuntu 14 LTS server on AWS, you’ll find that the package manage will only install MongoDB v2.x. However, you can install the latest version by updating apt-get using this tutorial, allowing you to use install the Parse API Server.

Installing MongoDB

To install the latest version of MongoDB on your Ubuntu instance, run the following script as root / sudo. This will update the apt-get package manager to access the official MongoDB repository and install the latest version of the software.

# Import the Public Key for Official MongoDB Repo
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
# Update apt-get to get latest MongoDB packages
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
# Update apt-get package list with new repo details
sudo apt-get update
# Install the latest version of MongoDB
sudo apt-get install -y mongodb-org
view raw install_mongo.sh hosted with ❤ by GitHub

Once MongoDB is installed, the service will automatically be started. You can verify this by running the following command:

service mongod status

The command line will output something similar to the following it was successfully started:

MongoDB-Status

Using MongoDB

To start using MongoDB, you can issue commands like the below examples:

# Start MongoDB Shell
mongo
# Get MongoDB version
mongo --version
# Show Mongo Databases (from MongoDB Shell)
show dbs
# Create DB `parse` and Insert Data to `users` collection
use parse
db.users.insert({"name":"Niraj Shah"})
view raw using_mongo.sh hosted with ❤ by GitHub

Which will result in the following output:

MongoDB-Commands

Amazon Web Services, MongoDB, Tutorial, Ubuntu

4 comments on “AWS: Install MongoDB 3.x on Ubuntu 14”

  1. Parse.com: Setting up the Open Source Parse API Server | Web Niraj says:
    February 2, 2016 at 9:39 AM

    […] MongoDB version v2.6.x or v3.0.x (tested with v3.0.9) […]

    Reply
  2. Angel Sosa says:
    February 3, 2016 at 1:08 PM

    Thanks for this tutorial, its very clear. One question: If I import db from Parse to Mongodb, does this action will remove my parse db from host or it will stay there?

    Reply
    • Niraj Shah says:
      February 3, 2016 at 1:13 PM

      If you Import or Migrate your data away from Parse, it will still be available on Parse until you manually delete it (or until the service closes down in Jan 2017).

      Reply
  3. Angel Sosa says:
    February 3, 2016 at 1:28 PM

    Thanks.

    Reply

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StackExchange / StackOverflow

profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

Subscribe for updates

Support Me

Buy Me a Coffee

PSN Profile

Tags

ACL Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache Backup Bug Command Line Cordova cPanel / WHM Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Flash Flat File Geolocation Google Nexus 5 Hacking HTML5 iOS JavaScript jQuery Laravel 5 Linux Mac OS MongoDB NodeJS Parse PDF PHP Plugin Portfolio PS4 Review Security Server SSH SSL Sysadmin Tutorial WordPress WordPress Plugins

© 2011-2026 Niraj Shah
  • Blog
  • Portfolio
  • WordPress
  • About Me
  • Contact Me
  • Privacy Policy