Install the Astra CLI
Install the Astra CLI to create and manage Astra DB databases and Astra Streaming tenants from the command line.
Supported platforms
The Astra CLI supports the following operating systems:
| Operating System | Architecture |
|---|---|
Linux |
|
macOS |
|
Microsoft Windows |
|
Install the Astra CLI on macOS or Linux
To install the Astra CLI on macOS and Linux, you can use a scripted installation, binary installation, or a package manager.
Scripted installation on macOS and Linux (recommended)
-
Run the following command to install the latest version of the Astra CLI to the default location:
curl -sSL https://ibm.biz/astra-cli | shTo install the Astra CLI to a custom location, export the
ASTRA_HOMEenvironment variable before running the installation command, replacingINSTALLATION_DIRECTORYwith the full path to your preferred installation directory:export ASTRA_HOME=INSTALLATION_DIRECTORY -
Add the
astraexecutable to yourPATHby running the command supplied after installation:echo 'eval "$(~/.astra/cli/astra shellenv)"' >> ~/.zprofile -
Reload your shell profile or open a new terminal window.
-
Run the
astracommand from any directory to verify successful installation:astraThe response includes available commands and options for the Astra CLI.
Binary installation on macOS and Linux
-
Download the appropriate binary archive for your OS and CPU architecture from GitHub.
-
Extract the archive into the directory where you want to install the Astra CLI. For example:
sudo tar -xzvf astra-OS-ARCHITECTURE.tar.gz -C INSTALLATION_DIRECTORYReplace the following:
-
OS: Your operating system (macosorlinux). -
ARCHITECTURE: Your CPU architecture (x86_64orarm64). -
INSTALLATION_DIRECTORY: The full path to your preferred installation directory.
-
-
Add the following lines to your shell profile (for example,
~/.zprofileor~/.bash_profile) to make theastracommand executable from any directory:# Astra CLI shell configuration eval "$(PATH_TO_BINARY shellenv)"Replace
PATH_TO_BINARYwith the full path to theastraexecutable in the installation directory. -
On macOS: Delete the
com.apple.quarantineattribute from theastrabinary to remove macOS Gatekeeper restrictions:xattr -d com.apple.quarantine $(which astra)Alternatively, you can remove these restrictions in your macOS System Settings.
If you don’t remove the restrictions, you will receive a security alert stating
"astra" Not Openedwhen you run theastracommand. -
Reload your shell profile or open a new terminal window.
-
Run the
astracommand from any directory to verify successful installation:astraThe response includes available commands and options for the Astra CLI.
Install with Homebrew
-
Install the latest version of the Astra CLI using Homebrew:
brew install datastax/astra-cli/astra -
Run the
astracommand from any directory to verify successful installation:astraThe response includes available commands and options for the Astra CLI.
Install the Astra CLI on Windows
To install the Astra CLI on Windows, you can use a scripted installation or binary installation.
Scripted installation on Windows (recommended)
-
Run the following command to install the latest version of the Astra CLI to the default location:
powershell -c "irm https://ibm.biz/astra-cli-win | iex"To install the Astra CLI to a custom location, export the
ASTRA_HOMEenvironment variable before running the installation command, replacingINSTALLATION_DIRECTORYwith the full path to your preferred installation directory:$env:ASTRA_HOME = "INSTALLATION_DIRECTORY" -
Open a new terminal window.
-
Run the
astracommand from any directory to verify successful installation:astraThe response includes available commands and options for the Astra CLI.
Binary installation on Windows
-
Download the
windowszip file from GitHub. -
Extract the zip file into the directory where you want to install the Astra CLI:
powershell -C "Expand-Archive -Path astra-windows-x86_64.zip -DestinationPath INSTALLATION_DIRECTORY -Force"Replace
INSTALLATION_DIRECTORYwith the full path to your preferred installation directory. -
Add the path to the unzipped
astra.exefile to yourPATHenvironment variable. For more information, see the Microsoft PowerShell documentation. -
Start a new PowerShell session by opening a new terminal window.
-
Run the
astracommand from any directory to verify successful installation:astraThe response includes available commands and options for the Astra CLI.
Next steps
To connect to Astra and run your first commands, see Connect and manage the Astra CLI.