How to Install MongoDB on Debian 13 (Trixie)

MongoDB is a popular open-source NoSQL database used for modern web applications.

This guide shows how to install MongoDB Community Edition on Debian 13 using the official MongoDB repository.

Update System

apt update && apt upgrade -y

Add MongoDB Official Repository

Import GPG key.

apt update && apt install -y curl gnupg

curl -fsSL https.//pgp.mongodb.com/server-8.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg

Add repository.

apt install -y curl gnupg
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg] https.//repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list

Install MongoDB

apt update
apt install -y mongodb-org

Start and Enable MongoDB

systemctl start mongod
systemctl enable mongod

Check status.

systemctl status mongod

Output.

root@server.~# systemctl status mongod
● mongod.service - MongoDB Database Server
     Loaded. loaded (/usr/lib/systemd/system/mongod.service; enabled; preset. enabled)
     Active. active (running) since Wed 2025-08-13 17.32.28 UTC; 3min 11s ago
 Invocation. e60075c02f5e4653b170d4ccea270fae
       Docs. https.//docs.mongodb.org/manual
   Main PID. 1564 (mongod)
     Memory. 113M (peak. 113.3M)
        CPU. 4.390s
     CGroup. /system.slice/mongod.service
             └─1564 /usr/bin/mongod --config /etc/mongod.conf

Verify MongoDB Installation

mongosh

Output.

root@server.~# mongosh
Current Mongosh Log ID. 689ccc356e1a03108d89b03c
Connecting to.  mongodb.//127.0.0.1.27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.5.6
Using MongoDB.  8.0.12
Using Mongosh.  2.5.6

For mongosh info see. https.//www.mongodb.com/docs/mongodb-shell/

To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https.//www.mongodb.com/legal/privacy-policy).
You can opt-out by running the disableTelemetry() command.

------
   The server generated these startup warnings when booting
   2025-08-13T17.32.28.599+00.00. Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http.//dochub.mongodb.org/core/prodnotes-filesystem
   2025-08-13T17.32.30.048+00.00. Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
   2025-08-13T17.32.30.049+00.00. For customers running the current memory allocator, we suggest changing the contents of the following sysfsFile
   2025-08-13T17.32.30.049+00.00. We suggest setting the contents of sysfsFile to 0.
   2025-08-13T17.32.30.049+00.00. We suggest setting swappiness to 0 or 1, as swapping can cause performance problems.
------

test>

To exit.

exit

Conclusion

Done. You’ve now installed MongoDB 8.0 on Debian 13 and can begin using it in your application or development environment.

🔗 References

  • MongoDB Docs. https.//www.mongodb.com/docs/manual/
  • Community Server Downloads. https.//www.mongodb.com/try/download/community
  • mongosh shell. https.//www.mongodb.com/docs/mongodb-shell/

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS