> For the complete documentation index, see [llms.txt](https://ivansaul.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ivansaul.gitbook.io/blog/how-to-install-mongodb-on-arch-linux.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
