Heroku is a cloud platform that lets us build, run, and scale applications quickly. The Heroku Command Line Interface (CLI) is an essential tool for managing applications on Heroku. It allows us to deploy code, monitor apps, and scale services directly from the terminal. If we're working with MuleSoft or other cloud-based tools, the Heroku CLI can simplify deployment and management.
In this post, we'll learn how to install the Heroku CLI on an Ubuntu server. Follow these steps to set up our system and start using Heroku seamlessly.
Prerequisites
Before installing the Heroku CLI, we need to ensure our system meets these requirements:- Ubuntu Server (20.04 or later recommended)
- A non-root user with sudo privileges
- curl installed on our system
Update System Packages
Before installing new software, we’ll update our system’s package list to ensure we get the latest versions:sudo apt update
sudo apt upgrade -y
Install Required Dependencies
If curl and wget are not installed, we can install them using the following command:sudo apt install curl wget -y
Download and Install the Heroku CLI
Run the command below to add the Heroku repository and install the CLI:curl -sSL https://cli-assets.heroku.com/install.sh | sudo bash
Verify Installation
To check if the Heroku CLI is installed correctly, run:heroku --version
heroku/10.4.0 linux-x64 node-v20.17.0
Login to Heroku
To start using Heroku, we need to log in using our Heroku account credentials:heroku login
heroku login -i
Install Git
If you plan to deploy applications to Heroku, install Git:sudo apt install git -y
Tags
Heroku