sudo apt install gnupg curl
I have bash script installers for debian and ubuntu.
Free to download or keep following the howto.
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ --dearmor
Visit the link for newer versions or for the next debian dist upgrade.
Available debian repos.
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
Visit the link for newer versions or for the next ubuntu dist upgrade.
Available ubuntu repos.
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] \ https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod
sudo systemctl status mongod
sudo systemctl enable mongod
sudo systemctl restart mongod
mongosh
Current Mongosh Log ID: 680a168202926ce180d861df Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.5.0 Using MongoDB: 8.0.8 Using Mongosh: 2.5.0 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-04-24T12:41:52.783+02:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem 2025-04-24T12:41:52.900+02:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted 2025-04-24T12:41:52.900+02:00: For customers running the current memory allocator, we suggest changing the contents of the following sysfsFile 2025-04-24T12:41:52.900+02:00: We suggest setting the contents of sysfsFile to 0. 2025-04-24T12:41:52.900+02:00: vm.max_map_count is too low 2025-04-24T12:41:52.901+02:00: We suggest setting swappiness to 0 or 1, as swapping can cause performance problems. ------ test>