Easy way Install and Setup MongoDB in Arch Linux

Feri Lukmansyah
3 min readMay 26, 2021

--

hello and welcome to another blog post, in this post I will discuss about how to install and setup Mongo Database (MongoDB) in Arch Linux, when I’m working on a personal project using TypeScript, and the project requires some dependencies, also a database, and the database I use is MongoDB, when I use Ubuntu I don’t find any errors, when I’ve migrated using Arch Linux I got an error

Fixing Import GPG key Error

I got this error because I use mongodb-bin from AUR that is a pre-build package from official ubuntu repository, after I try to install mongo DB from official ubuntu repo i can’t import the gpg key on my computer

problem import gpg key in arch linux

Know The Problem and Find the Solution

that is fundamental if you use linux, know the problem 😃from the error messages, for example “no key server available” the mean is key in your local computer needs update from key server,

in arch linux you can use this command to update key server in your local computer

sudo pacman-keys --refresh-keys

use sudo if you use user account, the output from theese command will shown bellow

renew all keys from server

after update the key clone mongo from AUR using git

git clone https://aur.archlinux.org/packages/mongodb-bin/
clone mongo db from AUR using git

after clone you don’t need import keys because you updated the key in previous step now the problem is solved you can build MongoDB database with makepkg

Installing MongoDB

in previous step you done clone mongodb-bin from AUR now install with makepkg

go to mongodb-bin directory and run this command

makepkg -si
installing process

after that input your password to complete the installation

input password

Installation Done you 😄 you can check with systemctl command

sudo systemctl status mongodb.service
status mongo db in local computer after installed

thank you for reading my little documentation I hope it helps your problem, hope it is useful,

Resources and Reference

--

--