|
| 1 | +import Link from "@site/src/components/Link"; |
| 2 | +import Screenshot from "@site/src/components/Screenshot"; |
| 3 | + |
| 4 | +# 👐 Deploy a database cluster |
| 5 | + |
| 6 | +Now that you have a MongoDB Atlas account, you can create your first cluster for free. |
| 7 | + |
| 8 | +Once logged in, from the overview page, click on the green button that says **+ Create**. |
| 9 | + |
| 10 | +<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/10-mongodb-atlas/2-create-cluster/1-overview.png" alt="Overview screenshot" /> |
| 11 | + |
| 12 | +:::note |
| 13 | +If you just created your account, you will automatically be redirected to the cluster creation page and can skip this step. |
| 14 | +::: |
| 15 | + |
| 16 | +On the cluster creation page, choose the cloud provider and region where your data will be stored. You can also choose the type of cluster you want to create. For this lab, we will use the free tier. |
| 17 | + |
| 18 | +1. For the cluster tier, pick **M0**, which is the free tier. In the **Name** input box, assign a name (one word, no spaces) to your cluster. |
| 19 | +1. Uncheck the *Automate security setup* box. You will set up security manually in the next steps. |
| 20 | +1. Uncheck the *Preload sample dataset* box. You will import a dataset later in this lab. |
| 21 | +1. Select your favorite cloud provider and the region closest to you. |
| 22 | +1. Finally, click on the green button that says **Create Deployment**. |
| 23 | + |
| 24 | +<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/10-mongodb-atlas/2-create-cluster/2-deploy-database.png" alt="Create cluster screenshot" /> |
| 25 | + |
| 26 | +Once you're done with the hardest part of the process (the captcha), you will be redirected to the security quickstart. |
| 27 | + |
| 28 | +## Security quickstart |
| 29 | + |
| 30 | +By default, your MongoDB Atlas deployment is completely locked-down. You need to configure the network settings and create a user to access your database. |
| 31 | + |
| 32 | +While your deployment is being provisioned, you will see the security quickstart dialog. |
| 33 | + |
| 34 | +### Network access |
| 35 | + |
| 36 | +First, you should **Allow Access from Anywhere**. You will see a field prepolulated with the IP address `0.0.0.0/0`. This means that you can connect to your database from any IP address including the virtual environment you will use for this lab. Click **Add IP Address** to add this IP address to the network allowlist. |
| 37 | + |
| 38 | +:::caution |
| 39 | +It is dangerous to expose your database to the entire world. Never do this is a real production environment. |
| 40 | +::: |
| 41 | + |
| 42 | +### Database user |
| 43 | + |
| 44 | +Next, you need to create a database user. Pick any username and password you want. This will be used when you want to connect to your database. Click **Create Database User** to create the user. |
| 45 | + |
| 46 | +Atlas might create the user automatically for you if you have just created your account. In this case, the username and password will match your Atlas account credentials. |
| 47 | + |
| 48 | +:::tip |
| 49 | +Make sure to remember your username and password. You will need them later. For the sake of this workshop, it might be preferable to use a simple password that you'll remember over a more secure one. |
| 50 | +::: |
| 51 | + |
| 52 | +## Manual network access configuration |
| 53 | + |
| 54 | +If you don't see a button to **Allow Access from Anywhere**, you should close the dialog and go to the **Network Access** tab under the **Security** section in the left sidebar. Click on the **Add IP Address** button, add the IP address `0.0.0.0/0` and click **Confirm**. |
| 55 | + |
| 56 | +## That's all! |
| 57 | + |
| 58 | +That's all! You have a new database cluster. If everything goes well, you should see your newly created cluster in the database deployment screen. |
| 59 | + |
| 60 | +<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/10-mongodb-atlas/2-create-cluster/3-database-deployment.png" alt="Screenshot of the database deployment screen" /> |
0 commit comments