Files
talks-site/backend/docs/mongodb.md
T

1.4 KiB

How to get started with MongoDB on Liunx

How to get MongoDB up and running linux

Installation

  1. Import the public key
sudo apt-get 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
  1. Create the list file
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
  1. Reload
sudo apt-get update
  1. Install MongoDB Community Server
sudo apt-get install -y mongodb-org

Start Process

My system uses systemd to manage processes. However, if you are not aware which your system uses run ps --no-headers -o comm 1 and that should tell you which to use.

  1. Start MongoDB
sudo systemctl start mongod
  1. Verify Success
sudo systemctl status mongod
  1. a. If you want mongo to start after reboot: sudo systemctl enable mongod

Reference

If Mongo is failing to start with exit code 14

StackExchange