Install the Astro CLI
This is where you'll find information about installing, upgrading, and uninstalling the Astro CLI.
Install the Astro CLI
- Mac
- Windows
- Windows with winget
- Linux
Install the Astro CLI on a Mac operating system with a single command.
Prerequisites
- Homebrew
- Docker Desktop (v18.09 or higher).
Installation
To install the latest version of the Astro CLI, run the following command:
brew install astro
To install a specific version of the Astro CLI, specify the version you want to install at the end of the command:
brew install astro@<major.minor.patch-version>
If you specify only a major version, this command installs the latest minor or patch version available for the major version. For a list of all available versions, see the CLI release notes. If you specify only a major version, this command installs the latest minor or patch version available for the major version. For a list of all available versions, see the CLI release notes.
This is where you'll find information about installing the Astro CLI on a Windows operating system. Starting with Astro CLI version 1.6, you can use the Windows Package Manager winget command-line tool to install the Astro CLI. See Windows with winget.
Prerequisites
- Docker Desktop for Windows.
- Docker Engine (v1.13.1 or later).
- WSL enabled on your local machine.
- Windows 10 or Windows 11.
Installation
Go to the Releases page of the Astro CLI GitHub repository, scroll to a CLI version, and then download the
.exe
file that matches the CPU architecture of your machine.For example, to install v1.0.0 of the Astro CLI on a Windows machine with an AMD 64 architecture, download
astro_1.0.0-converged_windows_amd64.exe
.Rename the file to
astro.exe
.Add the filepath for the directory containing the new
astro.exe
as a PATH environment variable. For example, ifastro.exe
is stored inC:\Users\username\astro.exe
, you addC:\Users\username
as your PATH environment variable. To learn more about configuring the PATH environment variable, see How do I set or change the PATH system variable?.Restart your machine.
Starting with Astro CLI version 1.6, you can use the Windows Package Manager winget command-line tool to install the Astro CLI. To install an older version of the Astro CLI, you'll need to follow the alternate Windows installation process.
The winget command line tool is supported on Windows 10 1709 (build 16299) or later, and is bundled with Windows 11 and modern versions of Windows 10 by default as the App Installer. If you're running an earlier version of Windows 10 and you don't have the App Installer installed, you can download it from the Microsoft Store. If you've installed the App Installer previously, make sure you're using the latest version before running commands.
Prerequisites
- Docker Desktop for Windows.
- Docker Engine (v1.13.1 or later).
- WSL enabled on your local machine.
- Astro CLI version 1.6 or later.
- The latest version of the Windows App Installer.
- Windows 10 1709 (build 16299) or later or Windows 11.
Installation
Open Windows PowerShell as an administrator and then run the following command:
winget install -e --id Astronomer.Astro
To install a specific version of the Astro CLI, specify the version you want to install at the end of the command. For example, running the following command installs Astro CLI version 1.6:
winget install -e --id Astronomer.Astro -v 1.6.0
This is where you'll find information about installing the Astro CLI on Linux.
Prerequisites
- Docker Engine (v1.13.1 or higher).
Installation
Run the following command to install the latest version of the Astro CLI directly to PATH
:
curl -sSL install.astronomer.io | sudo bash -s
To install a specific version of the CLI, specify the version number as a flag at the end of the command. For example, to install v1.1.0 of the CLI, you would run:
curl -sSL install.astronomer.io | sudo bash -s -- v1.1.0
If you specify only a major version, this command installs the latest minor or patch version available for the major version. If you specify only a major version, this command installs the latest minor or patch version available for the major version. For a list of all available versions, see the CLI release notes.
Upgrade the CLI
- Mac
- Windows
- Windows with winget
- Linux
To upgrade the Astro CLI to the latest version, run the following command:
brew install astro
Delete the existing
astro.exe
file on your machine.Go to the Releases page of the Astro CLI GitHub repository, scroll to a CLI version, and then download the
.exe
file that matches the CPU architecture of your machine.For example, to upgrade to v1.0.0 of the Astro CLI on a Windows machine with an AMD 64 architecture, you download
astro_1.0.0-converged_windows_amd64.exe
.Rename the file to
astro.exe
.Add the filepath for the directory containing the new
astro.exe
as a PATH environment variable. For example, ifastro.exe
was stored inC:\Users\username\astro.exe
, you would addC:\Users\username
as your PATH environment variable. To learn more about configuring the PATH environment variable, see Java documentation.Restart your machine.
Starting with Astro CLI version 1.6, you can use the winget command line tool to upgrade the Astro CLI. If you're upgrading from Astro CLI version 1.5.1 o earlier to a later Astro CLI version, you'll need to follow the alternate Windows upgrade process.
To upgrade the Astro CLI to the latest version, open Windows PowerShell as an administrator and run the following command:
winget install -e --id Astronomer.Astro
To upgrade the Astro CLI to the latest version, run the following command:
curl -sSL install.astronomer.io | sudo bash -s
Uninstall the CLI
- Mac
- Windows
- Windows with winget
- Linux
To uninstall the Astro CLI on Mac, run:
brew uninstall astro
To uninstall the Astro CLI on Windows:
- Delete the filepath for
astro.exe
from your Windows PATH environment variable. - Delete
astro.exe
.
Starting with Astro CLI version 1.6, you can use the winget command line tool to uninstall the Astro CLI. To uninstall an older version of the Astro CLI, you'll need to follow the alternate Windows uninstall process.
To uninstall the Astro CLI, open Windows PowerShell as an administrator and run the following command:
winget uninstall -e --id Astronomer.Astro
To uninstall the Astro CLI on Linux, run the following command:
sudo rm /usr/local/bin/astro
Migrate from astrocloud
to astro
The astrocloud
executable is no longer maintained by Astronomer. Complete this migration if all of the following are true:
- You are an Astro user.
- You're currently using the
astrocloud
CLI executable.
For more information on Astro CLI version 1.0.0, see Astro CLI Release Notes.
Step 1: Uninstall astrocloud
- Mac
- Windows
- Windows with winget
- Linux
To uninstall astrocloud
on Mac, run:
brew uninstall astronomer/cloud/astrocloud
To uninstall astrocloud
on Windows:
- Delete the filepath for
astrocloud.exe
from your Windows PATH environment variable. - Delete
astrocloud.exe
from your machine.
Starting with Astro CLI version 1.6, you can use the winget command line tool to uninstall the Astro CLI.
To uninstall the Astro CLI, open Windows PowerShell as an administrator and run the following command:
winget uninstall -e --id Astronomer.Astro
To uninstall astrocloud
on Linux:
- Delete the filepath for
astrocloud.exe
from your Linux PATH environment variable. - Delete
astrocloud.exe
from your machine.
Step 2: Install Astro CLI v1.0+
Install the latest version of astro
on your machine. See Install the CLI.
Step 3: Migrate existing Astro projects
To run and deploy your existing Astro projects using the astro
executable, you need to populate these projects with a new .astro
directory.
In your terminal, go to the location of your Astro project.
Run
astro dev init
to generate a new.astro
directory in your project. This subdirectory might be hidden in graphical file browsers. You can show hidden files using⌘ + Shift + .
on Mac or by selecting View > Hidden items in Windows file explorer.If a prompt appears asking you about whether you want to create a project in a directory that isn't empty, enter
Yes
. The CLI only creates files that aren't in your directory. In this case, the only files that it creates are./astro/test_dag_integrity_default.py
and.astro/config.yaml
.
Step 4: Migrate project configurations (Optional)
If you manually updated the .astrocloud/config.yaml
file of an existing Astro project:
- In your terminal, go to the location of your Astro project.
- Copy the contents from
.astrocloud/config.yaml
into.astro/config.yaml
. - Delete
.astrocloud/config.yaml
from your project.
Step 5: Update CI/CD pipelines (Optional)
If you have an existing CI/CD pipeline that uses the astrocloud
executable, update it to use astro
. For example, in a GitHub Actions CI/CD pipeline you would update the following:
# Before:
- name: Deploy to Astro
run: |
brew install astronomer/cloud/astrocloud
astrocloud deploy ${{ secrets.DEPLOYMENT_ID }}
# After:
- name: Deploy to Astro
run: |
curl -sSL install.astronomer.io | sudo bash -s
astro deploy ${{ secrets.DEPLOYMENT_ID }}