Docs Menu
Docs Home
/ /
Atlas CLI

Install or Update the Atlas CLI

On this page

  • Install the Atlas CLI
  • Update the Atlas CLI
  • Take the Next Steps

Install the Atlas CLI to quickly provision and manage Atlas database deployments from the terminal.

To verify packages before installation, see Verify the Integrity of Atlas CLI Packages.

Select one of the following installation methods and follow the steps to install the Atlas CLI.

To check whether your operating system is compatible with the Atlas CLI, see Check Compatibility.

To install the Atlas CLI using Homebrew, you must:

  1. Use a MacOS or Linux operating system.

  2. Install Homebrew.

To install the Atlas CLI using Apt, you must install gnupg:

sudo apt-get install gnupg

To install the Atlas CLI using Chocolatey, you must do the following:

  1. Ensure that your system meets the requirements for installing Chocolatey.

  2. Install Chocolatey using cmd.exe or PowerShell.exe. To learn more, see Installing Chocolatey.

To install the Atlas CLI using Docker, install the Docker engine or Docker desktop.

1

Invoke the following brew command to install both the Atlas CLI and mongosh:

brew install mongodb-atlas

Note

You can also use the brew install mongodb-atlas-cli command to install both the Atlas CLI and mongosh. You can't install the Atlas CLI alone on Homebrew.

2

Run the atlas command from any directory:

atlas

The response includes available commands and options for the Atlas CLI.

1

Create a /etc/yum.repos.d/mongodb-org-7.0.repo file so that you can install Atlas CLI directly using yum. Replace 7.0 with your edition of MongoDB.

[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2023/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc

Create a /etc/yum.repos.d/mongodb-enterprise-7.0.repo file so that you can install Atlas CLI directly using yum. Replace 7.0 with your edition of MongoDB.

[mongodb-enterprise-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/7.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
[mongodb-enterprise-7.0]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/amazon/2/mongodb-enterprise/7.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
[mongodb-enterprise-7.0]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/amazon/2023/mongodb-enterprise/7.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
2

Invoke the following yum command to install both the Atlas CLI and mongosh:

sudo yum install -y mongodb-atlas

If you don't want to install mongosh, invoke the following yum command instead to install the Atlas CLI only:

sudo yum install -y mongodb-atlas-cli
3

Run the atlas command from any directory:

atlas

The response includes available commands and options for the Atlas CLI.

1

From a terminal, issue the following command to import the MongoDB public GPG Key from https://pgp.mongodb.com/server-7.0.asc. Replace 7.0 with your edition of MongoDB.

wget -qO - https://pgp.mongodb.com/server-7.0.asc | sudo apt-key add -

A successful command returns an OK.

2

Select Ubuntu or Debian, then select your version.

Create the list file /etc/apt/sources.list.d/mongodb-org-7.0.list for your version of Ubuntu. Replace 7.0 with your edition of MongoDB.

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
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

Create the list file /etc/apt/sources.list.d/mongodb-org-7.0.list for your version of Debian. Replace 7.0 with your edition of MongoDB.

echo "deb http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
echo "deb http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

Select Ubuntu or Debian, then select your version.

Create a /etc/apt/sources.list.d/mongodb-enterprise.list file for your version of Ubuntu. Replace 7.0 with your edition of MongoDB.

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.com/apt/ubuntu jammy/mongodb-enterprise/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.com/apt/ubuntu focal/mongodb-enterprise/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list

Create a /etc/apt/sources.list.d/mongodb-enterprise.list file for your version of Debian. Replace 7.0 with your edition of MongoDB.

echo "deb http://repo.mongodb.com/apt/debian bullseye/mongodb-enterprise/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
echo "deb http://repo.mongodb.com/apt/debian buster/mongodb-enterprise/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
3

Invoke the following apt command:

sudo apt-get update
4

Invoke the following apt command to install both the Atlas CLI and mongosh:

sudo apt-get install -y mongodb-atlas

If you don't want to install mongosh, invoke the following apt command instead to install the Atlas CLI only:

sudo apt-get install -y mongodb-atlas-cli
5

Run the atlas command from any directory:

atlas

The response includes available commands and options for the Atlas CLI.

1
choco install mongodb-atlas
2
3
4

Run the atlas command from any directory:

atlas

The response includes available commands and options for the Atlas CLI.

To pull the latest Atlas CLI Docker image, run the following command:

docker pull mongodb/atlas

If you run docker pull mongodb/atlas without specifying a version tag, Docker automatically pulls the latest version of the Docker image (mongodb/atlas:latest).

To pull a specific version of the Docker image, run the following command, replacing <tag> with the version tag:

docker pull mongodb/atlas:<tag>

To learn how to run Atlas CLI commands with Docker after you pull the Docker image, see Run Atlas CLI Commands with Docker.

1
  1. Download and extract the correct binary for your operating system:

    Operating System
    Download
    Windows
    MacOS
    Ubuntu/Debian
    RHEL/CentOS/SLES/AMZ
    Linux

    Note

    Replace or remove any existing MongoDB CLI binaries to prevent conflicts between versions.

  2. Run the executable file.

2

Run the atlas command from any directory:

atlas

The response includes available commands and options for the Atlas CLI.

To update the Atlas CLI, follow the procedure that corresponds with the method you used to install the Atlas CLI:

1

If you installed the Atlas CLI and mongosh together using the mongodb-atlas package, invoke the following brew command:

brew update
brew upgrade mongodb-atlas

If you installed the Atlas CLI and mongosh together using the mongodb-atlas-cli package, invoke the following brew command:

brew update
brew upgrade mongodb-atlas-cli
2

Run the --version command:

atlas --version

The response returns your Atlas CLI version.

1

If you installed the Atlas CLI and mongosh together using the mongodb-atlas package, invoke the following yum command:

yum update mongodb-atlas

If you installed the Atlas CLI only using the mongodb-atlas-cli package, invoke the following yum command:

yum update mongodb-atlas-cli
2

Run the --version command:

atlas --version

The response returns your Atlas CLI version.

1

If you installed the Atlas CLI and mongosh together using the mongodb-atlas package, invoke the following apt command:

sudo apt-get install --only-upgrade mongodb-atlas

If you installed the Atlas CLI only using the mongodb-atlas-cli package, invoke the following apt command:

sudo apt-get install --only-upgrade mongodb-atlas-cli
2

Run the --version command:

atlas --version

The response returns your Atlas CLI version.

1
choco upgrade mongodb-atlas
2

Run the --version command:

atlas --version

The response returns your Atlas CLI version.

1
  1. Remove any existing Atlas CLI binaries to prevent version conflicts.

  2. Download and extract the correct binary for your operating system:

    Operating System
    Download
    Windows
    MacOS
    Ubuntu/Debian
    RHEL/CentOS/SLES/AMZ
    Linux
  3. Run the executable file.

2

Run the --version command:

atlas --version

The response returns your Atlas CLI version.

Connect from the Atlas CLI to start using the Atlas CLI commands.

Back

Overview

Next

Check Compatibility