These last days I've been with no time to practice coding, and one thing stopping me was that I didn't have my dev environment as I would like to.
So this week I decided to write this article on how I did to install MongoDB (latest) on my WSL setup.
Head to root folder
cd /
Install GNUPG
sudo apt-get install gnupg
Issue following command to import GPG keys
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
Create List file
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
Reload Packages
sudo apt-get update
Install Mongo db Packages
sudo apt-get install -y mongodb-org
Create DB Folder
mkdir -p data/db
Apply permissions
sudo chown -R `id -un` data/db
Run MongoD
mongod
Verify
You should be able to see something like Waiting for connections","attr":{"port":27017,"ssl":"off"
on the terminal.
Hope it helps"
Top comments (8)
Hello great post!
Don't hesitate to put colors on your
codeblock
like this example for have to have a better understanding of your code 😎Thanks Thomas! :D
awesome thank you this is very helpful. I'm so happy that I would kiss you... would you let me? WUW
On debian based Pengwin distro, made for WSL I got:
Any idea how to proceed?
Solution: via
pengwin-setup
you may easily installsystemd
.What is your WSL Ubuntu Version?
It was Pengwin paid distro. I've solved it with built in setup app.
For now I've switched to Ubuntu fresh installation as it has fixed most reasons why the paid distro was made.
I find this now less troublesome to go through the instructions for Ubuntu.
Glad that it helps. I forgot to mentions that I did this on Ubuntu 22.04