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...

API Trace View

Struggling with slow API calls? 🕒

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay