Install the Astro CLI
Overview
The Astro CLI is the easiest way to run Apache Airflow on your machine.
From the CLI, you can run a local Apache Airflow environment with a dedicated Webserver, Scheduler and Postgres Database. Once you create an Astro project, you can easily customize it (e.g. add Python or OS-level packages, plugins etc.) and test it on your local machine.
You can also use the CLI to:
- Authenticate to Astro.
- List the Astro Workspace and Deployments you have access to.
- Deploy a project to Astro.
This guide provides instructions for how to install the Astro CLI.
Prerequisites
To install and use the Astro CLI on Mac, you must have:
- Homebrew
- Docker Desktop (v18.09 or higher).
To install and use the Astro CLI on Windows or Linux, you must have:
- Docker Engine (v0.13.1 or higher).
Install the Astro CLI
- Mac
- Windows
- Linux
Install the Astro CLI by running the following command:
brew install astronomer/cloud/astrocloud
In a PowerShell terminal, create a new directory for your Astro project and set it as your current directory:
mkdir my-project && cd my-project
Based on your CPU, run one of the following commands to download the Astro CLI executable into your project directory.
AMD64:
Invoke-WebRequest -Uri https://goreleaserdev.blob.core.windows.net/goreleaser-test-container/releases/v1.5.0/cloud-cli_1.5.0_Windows_x86_64.tar.gz -o astrocloudcli.tar.gz
ARM64:
Invoke-WebRequest -Uri https://goreleaserdev.blob.core.windows.net/goreleaser-test-container/releases/v1.5.0/cloud-cli_1.5.0_Windows_arm64.tar.gz -OutFile astrocloudcli.tar.gz
Run the following command to unzip the executable:
tar -xvzf .\astrocloudcli.tar.gz
To run the executable without specifying its file path, save
astrocloud.exe
in a secure location on your machine and add its filepath in the Windows PATH environment variable. For more information about configuring the PATH environment variable, read Java documentation.
In a Linux terminal, create a new directory for your Astro project and set it as your current directory:
mkdir my-project && cd my-project
Based on your CPU, run one of the following commands to download the Astro CLI executable into your project directory.
AMD64:
curl https://goreleaserdev.blob.core.windows.net/goreleaser-test-container/releases/v1.5.0/cloud-cli_1.5.0_Linux_x86_64.tar.gz -o astrocloudcli.tar.gz
ARM64:
curl https://goreleaserdev.blob.core.windows.net/goreleaser-test-container/releases/v1.5.0/cloud-cli_1.5.0_Linux_arm64.tar.gz -o astrocloudcli.tar.gz
Run the following command to unzip the executable:
tar xzf astrocloudcli.tar.gz
To run the executable without specifying its file path, save
astrocloud
in a secure location on your machine and add its filepath in the Linux$PATH
environment variable. For more information about configuring the PATH environment variable, read Java documentation.
Confirm the Install
To confirm the CLI was installed properly, run the following CLI command:
astrocloud version
If the installation was successful, you should see the following output:
% astrocloud version
Astro CLI Version: 1.5.0
Migrate from the ./astro
Executable to the Astro CLI
If you currently use the astro
executable file to run CLI commands, we strongly recommend that you upgrade to the Astro CLI. To do this:
- Delete the
./astro
executable file and any related system environment variables or symbolic links from your machine. - In any existing Astro project directories, delete the
.astro
subdirectory previously generated by the./astro
executable. 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. - Run
astrocloud dev init
in your project directories. This command will populate a directory with the appropriate.astrocloud
folder without touching or replacing your existing project files.
Next Steps
Now that you've installed the Astro CLI, you're ready to create an Astro project and start developing locally. For instructions, read Create an Astro project.