In preparation for an upcoming project (stay tuned for more details), I needed to set up a MongoDB database server. In this post, we’ll walk through how to install and configure MongoDB on Debian 12. At the time of writing, Debian 13 is the most up to date stable version of Debian, though MongoDB is not yet supported on Debian 13. Whilst I was previously an avid Ubuntu fan, these days I try to use Debian for server builds due to its notorious stability.
Server Spec
The first thing to do is build the virtual machine. The intention of this article is not to be a how-to on creating VMs, so I will keep it brief, however, I will have some specific posts on that topic coming up. I use Proxmox as my hypervisor and below is the spec of the VM I created:
- 4 core, single socket CPU
- 16GB RAM
- 150GB Hard Disk
I created the VM and installed Debian 12 from the ISO, then SSH’ed into the server to do the installation and configuration of MongoDB.
MongoDB Installation
Let’s follow the official guide: Install MongoDB Community Edition on Debian; the installation is fairly straightforward.
Firstly, we install some dependencies and import the public key:
sudo apt install gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor

Next, we add the MongoDB repo to our apt sources, using the newer list file method:
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list

Now we’ll update the system packages:
sudo apt update

We can see it has pulled the newly added repositories (Get:4 and Get:5).
Now we’re ready to install the MongoDB Server, which we do with:
sudo apt install mongodb-org

That’s it: it’s installed.
Let’s check the status of the service:
sudo systemctl status mongod

Interestingly, the preset is enabled, meaning the service should be enabled on install but the current state is disabled. Let’s enable and start it, then check the status again:
sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl status mongod

Ugh, we were doing so well.
Maybe the journal has more information:
sudo journalctl -u mongod

Not particularly.
Anything in the log files?
ls /var/log/mongodb

Nothing there either.
I did some Googling of that final line mongod.service: Failed with result 'signal'. and everything pointed at a processor incompatibility.
The default CPU type when creating a VM in Proxmox is x86-64-v2-AES:

Looking at the CPU requirements in the MongoDB documentation, they state (at the time of writing):
- For Intel
x86_64, MongoDB requires one of:
- a Sandy Bridge or later Core processor, or
- a Tiger Lake or later Celeron or Pentium processor.
- For AMD
x86_64, MongoDB requires:
- a Bulldozer or later processor.
So let’s power down the VM and change the processor configuration, choosing Sandybridge:

Then, when we start the machine back up and check the service status:
sudo systemctl status mongod

All is now working.
Allowing Remote Connections
At this point, if we try to log in using MongoDB Compass on a different machine, we get an error:

The reason is that we need to change some config to allow remote connections.
Let’s edit the config file:
sudo nano /etc/mongod.conf
We need to change bindIp in the # network interfaces section from 127.0.0.1

to 0.0.0.0:

Note that this change opens the MongoDB service on all IPs. This is a homelab environment, so I am happy to do this but in a production environment, this may need narrowing down to a more granular range.
Now to restart the service:
sudo systemctl restart mongod

With that, we are connected:

We can now see our nice new server:

Conclusion
We’ve installed a MongoDB server on a Debian 12 VM and configured it so we can connect remotely. Our server is now ready for use.
References / Further Reading
Reddit – HELP mongod.service: Failed with result ‘signal
StackOverflow – mongoDB (result= signal , code = killed , signal = ill

Leave a Reply