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 CLI
-
macOS and Linux
-
Windows
-
Homebrew
Select one of the following installation methods to install the Astra CLI on macOS and Linux. If you prefer to use a package manager, follow the Homebrew instructions instead.
-
Scripted installation (recommended)
-
Binary installation
-
Run the following command to install the latest version of the Astra CLI to the default location:
curl -sSL https://ibm.biz/astra-cli | shInstall to a custom location
To install the Astra CLI to a custom location, export the
ASTRA_HOMEenvironment variable before running the installation command:export ASTRA_HOME=INSTALLATION_DIRECTORYReplace
INSTALLATION_DIRECTORYwith the full path to your preferred 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.
-
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.
Select one of the following installation methods to install the Astra CLI on Windows:
-
Scripted installation (recommended)
-
Binary installation
-
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"Install to a custom location
To install the Astra CLI to a custom location, export the
ASTRA_HOMEenvironment variable before running the installation command:$env:ASTRA_HOME = "INSTALLATION_DIRECTORY"Replace
INSTALLATION_DIRECTORYwith the full path to your preferred 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.
-
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.
-
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.
Next steps
To connect to Astra and run your first commands, see Connect and manage the Astra CLI.