Skip to main content

Setting Up


Atlas CLI is an open-source tool designed to help software engineers, DBAs and DevOps practitioners to manage their database schemas. Atlas users can use the Atlas DDL (Data-definition language), to describe the desired database schema and use the command-line tool to plan and apply the migrations to their systems.

In this guide, we will install the latest version of Atlas, and use it to manage the schema of a local database that we will run inside a Docker container.

Install the CLI

Get the latest release with Homebrew:

brew install ariga/tap/atlas

Latest release is updated twice a day and is based on the most recent tagged release.

The binaries distributed in official releases are released under the Ariga End User License. If you would like to build Atlas from source follow the instructions here.

To verify that the CLI is installed correctly run:


You should see the help text describing the different Atlas sub-commands:

A database toolkit.

atlas [command]

Available Commands:
completion generate the autocompletion script for the specified shell
env Print atlas env params
help Help about any command
schema Work with atlas schemas
version Show atlas CLI version

-h, --help help for atlas

Use "atlas [command] --help" for more information about a command.

Start a Local Database Container

For the purpose of this guide, we will start a local Docker container running MySQL.

docker run --name atlas-db -p 3306:3306 -e MYSQL_ROOT_PASSWORD=pass -e MYSQL_DATABASE=example mysql

To verify the local database is running, run the MySQL command-line interface from within the container:

docker exec -it atlas-db mysql --password='pass' example

Run show tables; to verify that the database is empty:

mysql> show tables;
Empty set (0.00 sec)

In the next section, we will learn how to use the Atlas CLI to inspect the schema of our running database.