How to install MongoDB in GCE Ubuntu VM

Below are the steps for installing MongoDB in GCP VM, this post is for VMs having Ubuntu OS 18.04.

  • Login to Google Cloud Console and navigate to Compute Engine > VM instances
  • Click on "SSH" to connect to VM and commands with root privileges
  • Import the public key
  • Create a list file
  • Reload local package database
  • Install the MongoDB
  • Start MongoDB
  • Verify MongoDB Installation
  • Connect to MongoDB shell by typing
  • Categories: GCP