DEV Community

Cover image for MongoDB: Effortless Installation and Setup on Arch based Linux
Sujit Kumar
Sujit Kumar

Posted on

MongoDB: Effortless Installation and Setup on Arch based Linux

Installing and Setting Up MongoDB on Arch Linux

MongoDB is a popular NoSQL database, and setting it up on Arch Linux is a straightforward process. This guide will walk you through the installation steps, including the necessary dependencies and configurations.

Step 1: Install OpenSSL

Begin by installing OpenSSL, a prerequisite for MongoDB:

sudo pacman -S openssl
Enter fullscreen mode Exit fullscreen mode

Step 2: Install mongosh

Next, you'll need to install mongosh, the official MongoDB Shell. Clone the mongosh-bin repository from the Arch User Repository (AUR):

git clone https://aur.archlinux.org/mongosh-bin.git
Enter fullscreen mode Exit fullscreen mode

Navigate into the cloned directory and build and install mongosh:

cd mongosh-bin
makepkg -si
Enter fullscreen mode Exit fullscreen mode

Step 3: Install MongoDB

Now, you can proceed to install MongoDB itself. Clone the mongodb-bin repository from the AUR:

git clone https://aur.archlinux.org/mongodb-bin.git
Enter fullscreen mode Exit fullscreen mode

Navigate into the cloned directory and build and install MongoDB:

cd mongodb-bin
makepkg -si
Enter fullscreen mode Exit fullscreen mode

This step may take a few minutes.

Step 4: Start MongoDB Service

After successfully installing MongoDB, start the MongoDB service:

sudo systemctl start mongodb
Enter fullscreen mode Exit fullscreen mode

Step 5: Access MongoDB Shell

To access the MongoDB shell, simply type:

mongosh
Enter fullscreen mode Exit fullscreen mode

Congratulations! You've successfully installed and set up MongoDB on your Arch Linux system. You can now begin working with MongoDB databases using the powerful mongosh shell.


Good Luck See you next time...

Top comments (0)