Instalación Mongodb
Instalación
GNU/Linux
Debian
Debian 11 Bulleye
sudo apt-get install gnupg2 wget -y wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list sudo apt-get update -y sudo apt install mongodb-org
La versión de mongodb:
mongod --version
Sale por pantalla:
db version v5.0.14 Build Info: { "version": "5.0.14", "gitVersion": "1b3b0073a0b436a8a502b612f24fb2bd572772e5", "openSSLVersion": "OpenSSL 1.1.1n 15 Mar 2022", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "debian10", "distarch": "x86_64", "target_arch": "x86_64" } }
Hacer correr servicio:
sudo systemctl enable --now mongod sudo systemctl status mongod
Docker
Bajando imagen
docker run -dp 27017:27017 -v local-mongo:/data/db --name local-mongo --restart=always mongo
Run container
docker exec -it local-mongo sh