Docs
Website β†—Sign-in β†—
  • Edge Product Docs
  • Getting Started
    • πŸ’»Edge Website
    • πŸ”Account Sign Up
    • 🌐Network Introduction
    • 🌳The Green Cloud
    • πŸ“–Use Cases
    • πŸ“ˆCustomer Success
    • ✍️Write for Edge
  • Account Management
    • Setting Up an Account
    • Accessing Your Account
    • Setting Up 2FA
    • Account Recovery
    • Account Deletion
    • Billing
  • Edge Servers
    • Introduction
    • Tutorials
      • Connect to Edge Servers with SSH
      • Ubuntu
        • Base Configuration for Ubuntu 22.04
        • How To Install the Apache Web Server on Ubuntu 22.04
        • How To Install the mongoDB Database on Ubuntu 22.04
        • Installation and Basic Usage of Docker on Ubuntu 22.04
        • Installation of Wordpress on Ubuntu 22.04
    • Q&A
  • Content Delivery
    • Introduction
    • Tutorials
    • Q&A
  • Edge DNS
    • Introduction
    • Tutorials
    • Q&A
  • Object Storage
    • Introduction
  • Blockchain
    • Introduction
  • Support
    • Basic Support
    • Priority Support
    • Professional Solutions
    • Get in Touch
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Tutorial
  • 1. Import the Public Key Used by the Package Management System
  • 2. Create a List File for MongoDB
  • 3. Reload Local Package Database
  • 4. Install the MongoDB Packages
  • 5. Start Your MongoDB Server
  • Conclusion
  1. Edge Servers
  2. Tutorials
  3. Ubuntu

How To Install the mongoDB Database on Ubuntu 22.04

This guide will teach you how to install a mongoDB database on your Ubuntu 22.04 Edge Server.

PreviousHow To Install the Apache Web Server on Ubuntu 22.04NextInstallation and Basic Usage of Docker on Ubuntu 22.04

Last updated 2 years ago

Introduction

This guide will teach you how to install MongoDB on Ubuntu 22.04 Edge Server. MongoDB is a popular NoSQL database that is widely used in web development and big data applications. It is designed to handle unstructured data and offers high performance, scalability, and flexibility.

Prerequisites

Before you start, you will need an Ubuntu 22.04 Edge Server with a non-root user with sudo privileges and a firewall enabled to block non-essential ports.

You can learn how to do this by following our base configuration tutorial for Ubuntu 22.04:

Once you’re done setting this up, log in as your non-root user and proceed to step 1.

Tutorial

1. Import the Public Key Used by the Package Management System

Import the MongoDB GPG key to ensure the authenticity of the package by running the following command:

wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -

The operation should respond with an OK.

2. Create a List File for MongoDB

Create a MongoDB source list file in the /etc/apt/sources.list.d/ directory with this command:

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

3. Reload Local Package Database

Issue the following command to reload the local package database:

sudo apt-get update

4. Install the MongoDB Packages

Install MongoDB by running:

sudo apt-get install -y mongodb-org

5. Start Your MongoDB Server

After the installation is complete, start the MongoDB service by running:

sudo systemctl start mongod

You can also enable MongoDB to start automatically at boot time by running:

sudo systemctl enable mongod

Conclusion

That's it! You now have MongoDB installed on your Ubuntu 22.04 LTS Edge Server. Now that MongoDB is installed, you can start using it to store and retrieve data for your applications.

Base Configuration for Ubuntu 22.04