# How to Install MongoDB on Arch Linux

Use MongoDB's pre-built binary. Use AUR package `mongodb-bin` and possibly `mongodb-tools-bin`. This skips the entire compilation stage, downloading a pre-built binary from mongodb.org, and packaging it with the necessary configuration files.

```
yay -S mongodb-bin
```

If during the installation you get `==> Error: Problem importing keys` like this:

```
==> PGP keys need importing:
 -> 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2, required by: libcurl-openssl-1.0
==> Import? [Y/n] y
:: Importing keys with gpg......
gpg: keyserver receive failed: General error
==> Error: Problem importing keys
```

{% hint style="info" %}
`-> 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2`
{% endhint %}

You can solve it by running the following code:

```
gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 --recv 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2
```

```
sudo pacman -Syy
```

```
yay -S mongodb-bin
```

After installing the package. [Start](https://wiki.archlinux.org/index.php/Start)/[Enable](https://wiki.archlinux.org/index.php/Enable) the `mongodb.service` daemon.

```
systemctl enable --now mongodb
```

```
systemctl start --now mongodb
```

## Test Connetions

```bash
mongo
```

To quit:

```bash
exit
```

## References:

{% embed url="<https://wiki.archlinux.org/index.php/MongoDB>" %}

{% embed url="<https://www.vultr.com/docs/how-to-install-mongodb-4-0-on-arch-linux>" %}

{% embed url="<https://unix.stackexchange.com/questions/361213/unable-to-add-gpg-key-with-apt-key-behind-a-proxy>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ivansaul.gitbook.io/blog/how-to-install-mongodb-on-arch-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
