Open Terminal on your Mac.
Install Homebrew, a package manager for macOS, by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once Homebrew is installed, use it to install the Heroku CLI by running:
brew tap heroku/brew && brew install heroku
After the installation is complete, verify that the Heroku CLI is installed correctly by running:
heroku --version
You are now set up with the Heroku CLI. We can start using Heroku commands to manage our applications.