> For the complete documentation index, see [llms.txt](https://docs.lidistat67.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lidistat67.eu/setting-up-mongodb.md).

# Setting Up MongoDB

To be able to store data such as logs, you will need to use your own database. A database is required, as the database also stores configuration data for your bot.

Upon creating an account, you will be greeted with this page. Make sure you select Starter Cluster. <br>

<figure><img src="/files/xhAc00cWZREMdYW5Y2Oi" alt=""><figcaption></figcaption></figure>

After this, you will be taken to the below screen: <br>

<figure><img src="/files/odnxGaiFja9KgZEj8Z0d" alt=""><figcaption></figcaption></figure>

Select one of the servers marked with `FREE TIER AVAILABLE` and click on `Create Cluster`. It will only take a couple of minutes to configure everything for you.

Follow the "Getting Started" tutorial on the bottom left.<br>

Go to the `Database Access` section in the `security` tab. Click on `+ Add New User` to create a new user, whereupon a new screen will pop up. `Select Read and write to any database`, so the bot can properly store the data. Choose a username and password, but make sure they both **don't contain any special character like** `!`, `-`, `?`. Copy the password into your notepad.

Finally, click `Add User` to finish the creation.<br>

<figure><img src="/files/AWLnokl19TX4hg9RtlVU" alt=""><figcaption></figcaption></figure>

Go to the `Network Access` section in the `security` tab. Click on `+ Add IP Address` to add an IP address, whereupon a new screen will pop up. Click the `Allow Access From Everywhere` button and `0.0.0.0/0` should appear in the `Whitelist Entry`. Otherwise, make sure to put input that manually. Finally, click `Confirm` to confirm your changes.<br>

<figure><img src="/files/bEI3QzPDAu79AYgng6s7" alt=""><figcaption></figcaption></figure>

The last part is to generate a Mongo URI. Go to the `Clusters` section in the `Atlas` tab. Click on `Connect` on the left side of your Cluster dashboard. This will open up a new screen where you have three options. For our purposes, select the middle option `Connect Your Application.` <br>

<figure><img src="/files/itEmwCtJTZJN2GCAB4EZ" alt=""><figcaption></figcaption></figure>

You need to copy the connection string, which can be easily done by clicking the `Copy` button. Remove everything past `<dbname>` but keeping the `/`. Then replace `<password>` with the password for your user and `<username>` with your database-username, which you set earlier. Paste the URI in your notepad.

The final URI looks similar to this:&#x20;

`mongodb+srv://Username:MyPassword@modmail-kjvn21.mongodb.net/.`<br>

<figure><img src="/files/C5vChrgT0gIkFthDceDx" alt=""><figcaption></figcaption></figure>
