Installation on Arch
Because of its SSPL license, MongoDB is not in Arch's official
repositories. So we go through the AUR with a helper like yay. The
mongodb-bin package provides precompiled binaries (the alternative mongodb
compiles from source and is very slow).
Always inspect the PKGBUILD of an AUR package before installing it. The service
is named mongodb (not mongod).
Security
By default, MongoDB starts without authentication and only listens on
127.0.0.1. Before any networking, enable authentication
(security.authorization: enabled in /etc/mongodb.conf) and create an
administrator user. Never bind the server to a public IP address without a
firewall and authentication: an open instance is quickly discovered and
compromised.
Linux kernels >= 6.19: crash loop
On Linux kernels >= 6.19 (February 2026), mongodb-bin may crash in a loop at
startup (SIGSEGV related to the rseq/tcmalloc interaction). The problem is
made worse by the GLIBC_TUNABLES=glibc.pthread.rseq=0 variable set in the
package's systemd unit.
Workaround, pending an upstream fix:
sudo systemctl edit mongodbAdd the following to the override file:
[Service]
Environment="GLIBC_TUNABLES=glibc.pthread.rseq=1"(you can also simply clear the variable). Then reload and restart:
sudo systemctl daemon-reload
sudo systemctl restart mongodbAlternative: stay on a kernel <= 6.18. The issue is tracked upstream.