![]() ![]() ![]() ![]() ![]() You need to add the MongoDB server password to the bindIp line: sudo nano /etc/nf # network interfacesĪfter you’ve added the IP, restart the service: sudo systemctl restart mongodĪnd if you’re using a firewall, allow access for port 27017. More specifically, the “network interfaces” section. To enable remote access to your MongoDB database, you need to edit the configuration file again. Restart the MongoDB service for the changes to take effect: sudo systemctl restart mongod Enable remote access To enable password authentication (which means users will have to log in with a username and password to make read or edit the database), open the configuration file: sudo nano /etc/nfįind the line that says #security and uncomment it (remove the #) and add “authorization: enabled”: security: You can do various configurations and edits via that file. Next, start the MongoDB service: sudo systemctl start mongodĬheck the status and verify that it’s running: sudo systemctl status mongodĪnd enable it to start on boot: sudo systemctl enable mongod Step 7: Configure MongoDBīy default, the configuration file for MongoDB is located at “/etc/nf”. Step 6: Start MongoDB and enable it at boot Run the following command to install MongoDB Community Edition 5.0 on Ubuntu 20.04: sudo apt-get install mongodb-org Update the packages again: sudo apt-get updateĪnd now, you’re finally ready to install MongoDB. To create a list file for MongoDB, run the following command: echo "deb focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt//mongodb-org-5.0.list Step 4: Update packages list Run the following command to add the GPG key: wget -qO - | sudo apt-key add - Step 3: Create MongoDB a list file Sudo apt-get upgrade Step 2: Add the MongoDB public GPG key So, connect to your server and follow the steps: Step 1: Update Ubuntuįirst, update your server with the following commands: sudo apt-get update We’ll use the mongodb-org package that’s maintained by MongoDB themselves, instead of the default one that’s already included in Ubuntu’s repositories, which is usually an older version. As of writing, the latest stable MongoDB release is 5.0 This tutorial is for the community edition of MongoDB. You can also use SolaDrive, in which case they will manage the server for you and install MongoDB for you for free. Beginner-friendly, detailed, step-by-step instructions. In this tutorial, we’re going to show you how to install MongoDB on an Ubuntu 20.04 server. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |