# Deploy a MongoDB Database on Clouddley

With [Clouddley](https://clouddley.com/triggr), you can easily deploy and manage a [MongoDB](https://www.mongodb.com/) database, a flexible and scalable NoSQL database designed for handling large volumes of data. This guide walks you through the steps to set up a MongoDB database on Clouddley. Whether you are a beginner or an experienced developer,  your database will be up and running quickly.

## Prerequisites

* A [Clouddley](https://clouddley.com/) account
* A virtual machine on a Cloud platform or bare metal server.

## Step-by-step deployment

{% stepper %}
{% step %}

### Accessing Databases

* Log in to your [Clouddley](https://clouddley.com/) account.
* Navigate to [**Databases**](https://app.clouddley.com/services) and Click on **Deploy Database**

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FtlRPvmaVyzDFS1T11G8o%2FDbs-dashboard.png?alt=media&#x26;token=68180a8b-c163-4d5d-962e-fe7b862f4e9a" alt="Image of Databases dashboard on Clouddley"><figcaption><p>Accessing Databases</p></figcaption></figure>
{% endstep %}

{% step %}

### Configure your Virtual Machine (VM)

In the Choose or add server dropdown, select your virtual machine (VM) if it’s already listed. If not, select **+ Add Virtual Machine**.

Enter the required details:

<table><thead><tr><th width="127"></th><th></th></tr></thead><tbody><tr><td><strong>VM Host</strong></td><td><em>Provide the host address of your virtual machine</em></td></tr><tr><td><strong>VM User</strong></td><td><em>Input the username required to access the virtual machine</em></td></tr><tr><td><strong>Port</strong></td><td><em>Specify the port number for the connection</em></td></tr></tbody></table>

* Use the **Clouddley CLI** (recommended) or connect via **SSH** to verify.

{% tabs %}
{% tab title="Clouddley CLI" %}
The Clouddley CLI is a command-line tool that allows you to interact with the Clouddley Platform from your terminal.

* Open the command line of the remote VM you want to configure to Clouddley and install Clouddley CLI by running the command:

```bash
curl -L https://raw.githubusercontent.com/clouddley/cli/main/install.sh | sh
```

* To add the SSH public key, run the command:

```bash
clouddley add key
```

Using the CLI, you can deploy resources, manage configurations, and automate tasks efficiently.
{% endtab %}

{% tab title="SSH" %}

* Download the public key to your local machine.
* Run the provided command on your local machine, allowing Clouddley to connect to your virtual machine.

```
ssh-copy-id -f -i ~/path/to/downloaded/Publickey username@ipaddress
```

{% hint style="info" %}
Replace `~/path/to/downloaded/Publickey` ,`username` and `ipaddress`  with your actual values.
{% endhint %}
{% endtab %}
{% endtabs %}

* Click on **Verify** to validate the details and confirm the connection.
* Click on **Next** to continue the setup process.

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FAp7SFQG9SID9WIIdLs1k%2FDbs-configure-vm.png?alt=media&#x26;token=cdaf77cf-c40a-4fe3-8707-28bcf62fb7f5" alt="Configuring the virtual machine during database deployment on Clouddley."><figcaption><p>Configuring the virtual machine to host your database</p></figcaption></figure>
{% endstep %}

{% step %}

### Database Name

* Please enter a unique **name** for your database to distinguish it within the virtual machine (VM).
* Click on **Next**

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FmoM3LcXd20KAtPsBsGa6%2FDbs-mongo-name.png?alt=media&#x26;token=8375127f-c213-4ad1-b46a-6aafd8f54922" alt="Configuring database name on Clouddley."><figcaption><p>Defining a unique name for the MongoDB database</p></figcaption></figure>
{% endstep %}

{% step %}

### Select the Database type and version

* Choose **MongoDB** database
* Choose the desired **version** from the dropdown menu to ensure compatibility with your application.
* (Optional) Enable the **Delete Protection** option to safeguard your MongoDB database from accidental deletion.

{% hint style="info" %}
This feature prevents the database from being destroyed unless explicitly disabled.
{% endhint %}

* Click on **Deploy DB**

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FiiOulDZyclnhTZFQDBR0%2FDbs-mongo.png?alt=media&#x26;token=7c8b9e73-3b36-4f90-8f90-1eb57d91aed5" alt="User selecting the MongoDB database type and version."><figcaption><p>Selecting the MongoDB database type and specifying the version for deployment</p></figcaption></figure>
{% endstep %}

{% step %}

### Confirm Deployment

* Once the deployment process is complete, your **MongoDB database** is ready.&#x20;
* Click <mark style="color:blue;">**Go to Dashboard**</mark> to access and manage your database.

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FxvhqK2CRhloyPtDkGTLd%2FTD-successDeploy.png?alt=media&#x26;token=e37f5b70-e33d-465b-bf92-5eec3b490771" alt="Image of MongoDB database deployed successfully on Clouddley."><figcaption><p>MongoDB database successfully deployed</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## Database Dashboard

You can access and manage your database through the user-friendly dashboard.

{% tabs %}
{% tab title="Overview" %}
View details about your database, VM, and settings (e.g., Delete Protection), and use the option to delete the database if it is no longer needed.&#x20;

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FUI1tIDMli1tGd3U1gpGQ%2FDbs-mongodb-overview.png?alt=media&#x26;token=77c897d3-5850-4b45-9cd5-f7bbed70a1fd" alt="An image of the overview section of the MongoDB database deployed on Clouddley."><figcaption><p>The dashboard overview with a high-level summary of database performance and status</p></figcaption></figure>
{% endtab %}

{% tab title="Connections" %}
Access public and private network details, including **username**, **password**, **host**, **port**, and **database** type.

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FLclYSSEhSJyM0F6MD8TH%2FDbs-mongodb-conn.png?alt=media&#x26;token=c7880a34-8b88-438c-934b-cd7f02522517" alt="An image of the connections section of the MongoDB database deployed on Clouddley."><figcaption><p>View the public and private network connections to the MongoDB database</p></figcaption></figure>
{% endtab %}

{% tab title="Logs" %}
Monitor real-time log streams for troubleshooting and download logs for further analysis.

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FpJqqmsLyRUubC82W8Ky1%2FDbs-mongodb-logs.png?alt=media&#x26;token=d3e11028-ce6b-45b8-bce0-a0c11aa2a0a8" alt="An image of the logs section of the MongoDB database deployed on Clouddley."><figcaption><p>Real-time logs for insights into database activity</p></figcaption></figure>
{% endtab %}

{% tab title="Users" %}
Manage a list of database users and securely reset passwords as needed.

<figure><img src="https://3695617198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yp2SdNQtlQTJArGRUVU%2Fuploads%2FFfB5sVfLcgw4X6ZAbWRG%2FDbs-monogdb-users.png?alt=media&#x26;token=0388715c-07ae-41ac-84b8-ccc13acdd454" alt="An image of the users section of the MongoDB database deployed on Clouddley."><figcaption><p>Manage database users through the dashboard's users section</p></figcaption></figure>
{% endtab %}
{% endtabs %}

## Conclusion

Clouddley makes database hosting effortless with its scalable, reliable, and user-friendly platform. It simplifies database management so you can focus on your applications. Check out our other articles to learn [how to deploy and manage different databases](https://docs.clouddley.com/databases/how-to-guides) on the Clouddley.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clouddley.com/databases/how-to-guides/deploy-a-mongodb-database-on-clouddley.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
