Docs Menu
Docs Home
/ /
Atlas CLI
/ /

Create a Local Atlas Deployment

On this page

  • Supported OS for Local Atlas Deployments
  • Complete the Prerequisites
  • Create a Local Atlas Deployment
  • Manage a Local Atlas Deployment
  • Use Atlas Search with a Local Atlas Deployment
  • Use Atlas Vector Search with a Local Atlas Deployment
  • Supported Actions
  • Troubleshoot Errors

This tutorial shows you how to use the atlas deployments command to create a local Atlas deployment. In this tutorial, we will deploy a single-node replica set on your local computer. You can then manage your deployment, and use Atlas Search and Atlas Vector Search.

You should use local deployments for testing and development only.

Important

Public Preview

The atlas deployments command and subsequent related commands are available as a Public Preview. The feature and corresponding documentation may change at any time in the Public Preview stage. To ask questions and provide feedback, see the Atlas CLI Local Development Community Forum.

Operating System
Operating System Version
Architecture
Minimum CPU Cores
Minimum Free RAM (GB)
MacOS
13.2 and later
x86-64, ARM
2
2
Red Hat Enterprise Linux / CentOS
8, 9
x86-64, ARM
2
2

Note

Windows and Ubuntu are not fully supported for local Atlas deployments during the Public Preview stage.

Before you begin, complete the following prerequisites:

Important

For compatibility information for each prerequisite product, see the related installation pages.

  • Install the Atlas CLI.

    Example (MacOS):

    brew install mongodb-atlas-cli

    To learn about the Atlas CLI install instructions for other operating systems, see Install or Update the Atlas CLI.

  • Install mongosh version 2.0 or later.

    Example (MacOS):

    brew install mongosh

    To learn about the mongosh install instructions for other operating systems, see Install mongosh.

  • (Optional) Install Compass version 1.39.4 or later.

    Example (MacOS):

    brew install mongodb-compass

    To learn about the Compass install instructions for other operating systems, see Download and Install Compass.

  • Install MongoDB Database Tools.

    Example (MacOS):

    brew tap mongodb/brew && brew install mongodb-database-tools

    To learn about the MongoDB Database Tools install instructions for other operating systems, see Installing the Database Tools.

  • Install Podman version 4.4 and later.

    Example (MacOS):

    brew install podman

    Note

    Podman requires a network connection for pulling and caching MongoDB images.

Use the atlas deployments command to create a local Atlas deployment.

You can run this command in the following ways:

  • Interactive Mode (Default): the command prompts you for the deployment settings and provides default values.

  • Interactive Mode (Custom): the command prompts you for the deployment settings and lets you provide custom values.

  • Non-Interactive Mode: you run the command with the specified options. The command does not prompt you to provide further values. To learn all of the actions that atlas deployments supports, see atlas deployments.

Click one of the following tabs to see the command for your preferred mode.

Use the atlas deployments command to manage a local Atlas deployment. You can use the following commands for both local and cloud Atlas deployments. You can use --type local or --type atlas to run the command for local or cloud atlas deployments respectively.

1

Example:

atlas deployments list
NAME TYPE MDB VER STATE
local50 LOCAL 7.0.1 IDLE
local62 LOCAL 7.0.1 IDLE
myLocalRs LOCAL 7.0.1 IDLE
myLocalRs1 LOCAL 7.0.1 IDLE
2
  1. Run the following command to download the sample data:

    curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archive
  2. Copy and paste the following command into your terminal and replace {port-number} with the port for your deployment:

    mongorestore --archive=sampledata.archive --port={port-number}
3
  1. Run the following command to connect to a deployment:

    atlas deployments connect
  2. Specify the deployment to connect to and press Enter..

  3. Specify how you want to connect to the deployment and press Enter..

4
  1. Run the following command to pause a deployment:

    atlas deployments pause
  2. Specify the deployment to pause and press Enter..

5
  1. Run the following command to start a deployment:

    atlas deployments start
  2. Specify the deployment to start and press Enter..

6
  1. Run the following command to return the logs for a deployment:

    atlas deployments logs
  2. Specify the deployment to return logs for and press Enter..

7
  1. Run the following command to delete a deployment:

    atlas deployments delete
  2. Specify the deployment to delete and press Enter..

  3. Specify y and press Enter. to confirm.

Use the atlas deployments search indexes create command to create an Atlas Search search index. You can then run Atlas Search queries. To learn more, see Atlas Search.

You can run this command with local and cloud Atlas deployments. For detailed steps, see Create an Atlas Search Index and Run a Query.

Use the atlas deployments search indexes create command to work with Atlas Vector Search. To learn more, see How to Index Vector Embeddings for Vector Search.

You can run this command with local and cloud Atlas deployments. For detailed steps, see Use Atlas Vector Search with an Atlas Deployment.

Important

To use the Atlas CLI with Atlas Vector Search, you must create an Atlas deployment with MongoDB 7.0.5 or later. If you created a local Atlas deployment with an earlier MongoDB version, you don't get the latest MongoDB version automatically. You must delete the earlier images and deployments. Then you must create a new Atlas deployment.

To learn all of the actions that atlas deployments supports, see atlas deployments.

To learn more about troubleshooting local Atlas deployment issues, see Troubleshoot Local Atlas Deployment Issues.

← Local & Cloud Deployments