Skip to content

Instantly share code, notes, and snippets.

@litanur
Last active April 12, 2024 15:25
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save litanur/eec8ff295ff7d616626cd8a6c0d2659e to your computer and use it in GitHub Desktop.
Save litanur/eec8ff295ff7d616626cd8a6c0d2659e to your computer and use it in GitHub Desktop.
Install MongoDB on Manjaro

How to install mongoDB on Manjaro 21 Ornara

  1. Enable AUR
  2. Make sure system is up to date sudo pacman -Syu
  3. To install, use the following command:
pamac build mongodb-bin
pamac build mongodb-tools-bin
pamac build mongodb-compass
  1. Enable service and start on boot:
sudo systemctl start mongodb
sudo systemctl enable mongodb
  1. Run command mongo as console MongoDB

If you find the error like this:

MongoDB shell version v4.4.6
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
  1. Please change the port using command sudo nano /etc/mongodb.conf
  2. Change line 23 port: 27017
  3. To port 27018
  4. Re-run command with mongo 127.0.0.1:27018

Note: Don't forget use port 27018 when login using Compass

@OsirisAnubis
Copy link

Thank you very much!

@rasolofonirina
Copy link

Thanks for this tutorial.

@romanchechyotkin
Copy link

Hello, for what we need to change port from default value?

@winiarekk
Copy link

Hello, for what we need to change port from default value?

I guess you should do it only "If you find the error like this: ..."

@sinbadBahri
Copy link

Thanks mate

@LucaIgnatescu
Copy link

I used your fix and it worked, but what is different between port 27017 and port 27018 so that it runs on one but not the other?

@IceGreb
Copy link

IceGreb commented Oct 24, 2023

Thank you! So helpful!

@AceBazzz
Copy link

AceBazzz commented Nov 6, 2023

you are so beautiful

@abellmanuell
Copy link

Thank you! It help me.

@amirhossin-shahsavan
Copy link

Thank you! It so helpful.

@devisopen
Copy link

`open-dev@archlinux ~]$ sudo pacman -Syuu`
[sudo] password for open-dev: 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
:: Starting full system upgrade...
 there is nothing to do
[open-dev@archlinux ~]$ pamac build mongodb-bin
** Message: 12:11:07.557: aur_plugin.vala:317: downloading AUR data
https://aur.manjaro.org/packages-meta-ext-v1.json.gz: Socket I/O timed out
Failed to read AUR data from /var/tmp/pamac/packages-meta-ext-v1.json.gz : Error opening file /var/tmp/pamac/packages-meta-ext-v1.json.gz: No such file or directory
** Message: 12:11:16.328: aur_plugin.vala:317: downloading AUR data
https://aur.manjaro.org/packages-meta-ext-v1.json.gz: Socket I/O timed out
Failed to read AUR data from /var/tmp/pamac/packages-meta-ext-v1.json.gz : Error opening file /var/tmp/pamac/packages-meta-ext-v1.json.gz: No such file or directory
Error: target not found: mongodb-bin

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment