MongoDB
MongoDB is a document-oriented noSQL database program.
In our example, we use the SSH access and consider the following information:
- Account name:
foo - MongoDB directory:
$HOME/mongodb/
Note
[foo] must be replaced by your account name.
Installation
Downloading
Choose the package tgz and the platform Debian of the last version of the tarball.
Service launch
Create a service with following details:
- Command:
./bin/mongod --dbpath ./data/ --logpath ./log/mongo.log --ipv6 --bind_ip_all --port=27017 - Working directory:
/home/[foo]/mongodb
Public Cloud users will need to point the service to a port between 8300 and 8499 instead of the default MongoDB port.
The address to connect to the MongoDB instance will be services-[foo].alwaysdata.net:[port].
Note
Replace [port] by the chosen port in the command.
Firewall rule creation
Private Cloud users will need to open the port by creating a firewall rule if they want to access it from the external network:
| Title | Value |
|---|---|
| Protocol | UDP/TCP |
| Type | ACCEPT |
| Direction | Input |
| Hosts | <specify nothing> |
| Ports | 27017 |
| IP version | IPv4/IPv6 |
Downloading and installing utilities
- mongosh - choose the package tgz and the platform Linux x64 of the last version.
- cli - choose the package tgz and the platform Debian 12.0 x86-64 of the last version.
All executables will then be located in $HOME/mongodb/bin.
Authentication
Here, we will create the admin user following their documentation.
Note
Replace mysuperpassword by the password of your choice.
You can then add the --auth option to the command for the service.