MongoDB Connection Guide
Service Management
After creating the database, you will be redirected to the App Management page.
On this page, you can:
- Enable or disable your service
- View how to connect to the database service
- Customize the database configuration
Connection Information
Click on the Connection Method option in the Basic Settings tab.
On this page, you will see the following information:
- Internal Endpoint: The internal address of your database
- Port: The internal port of the database, which is
27017
by default - User: The database username that has been automatically assigned
- Password: The database password that has been set automatically or manually
info
If you want to connect to the database from platforms other than the container (like your personal computer), click on the Create External Port option. Then use the External Endpoint as the hostname and the External Port instead of 27017
.
Connection Methods
Using MongoDB Compass
- First, download and install MongoDB Compass.
- Run the application and click on Add new connection.
- Click on the Advanced Connection Options at the bottom of the page.
- In the General tab:
- Host: External database host with external port
- In the Authentication tab:
- User Name: Database username
- Password: Database password
- Click on the Save & Connect option.
on Different Operating Systems
- Windows
- macOS
- Linux (Ubuntu/Debian)
Install and Connect Using mongosh
- Install the mongosh package:
choco install mongodb
- Connect to the database:
mongosh kubarcloud.net:port
- Install the mongosh package:
brew update
brew install mongosh
- Connect to the database:
mongosh kubarcloud.net:port
- Install the mongosh package:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gnupg curl
sudo apt-get install -y mongodb-mongosh
- Connect to the database:
mongosh kubarcloud.net:port
tip
- MongoDB uses the TCP protocol for connection.
- Before connecting, ensure that your system's firewalls allow connections to the specified port.