Request-Response

The Full-Stack Blog

How to Install the Heroku CLI

November 15, 2023
Disponible en español

Heroku is a cloud application platform that enables developers to build, run, and operate applications entirely in the cloud. Unlike GitHub pages, which only allows you to deploy static sites with HTML pages, Heroku allows you to deploy a server.js file that will run the Node.js process. You’ll use the Heroku CLI to deploy apps to Heroku without leaving the command line.

Important You should have received an email providing access to the GitHub Student Developer Pack. This will give you $13 in free Heroku credits per month. Please ensure that you've accepted that invitation before you sign up for Heroku and install the CLI. Once you have access to the GitHub Student Developer Pack, follow the instructions below to do the following:

  1. Sign up for a Heroku account.

  2. Install the Heroku CLI.

  3. Connect your Heroku account to your GitHub account so that you receive the benefits of the GitHub Student Developer Pack.

To install the Heroku CLI on your machine, follow the instructions for your operating system below. Some of the images and versions mentioned below may slightly different from the Heroku site, but the general instruction is the same.

Before you begin, sign up for a free Heroku account.

Install the Heroku CLI on Windows

To install the Heroku CLI on Windows, download the 64-bit installer for Windows.

Heroku CLI installer links for Windows with two purple buttons: one for the 64-bit installer and another for the 32-bit installer.

Open the installer on your machine and follow the prompts to complete the installation. Once the installation is complete, open Git Bash.

To verify that the Heroku CLI was installed, type heroku --version into the command line. You should get a message that looks like the following, but note that the number may be different depending on your version of the CLI:

heroku/7.42.6 win32-x64 node-v12.16.2

After you confirm that the Heroku CLI was installed correctly, type heroku login into the command line. You'll be prompted to enter any key to go to the web browser to complete login. The CLI will then log you in automatically.

Install the Heroku CLI on macOS

To install the Heroku CLI on macOS, first ensure that you have Homebrew installed on your machine.

Once you've confirmed that you have Homebrew installed, open your Terminal and enter the following command:

brew tap heroku/brew && brew install heroku

To verify that the Heroku CLI was installed, type heroku --version into the command line. You should get a message that looks like the following, but note that the number may be different depending on your version of the CLI:

heroku/7.42.5 darwin-x64 node-v12.16.2

After you confirm that the Heroku CLI was installed correctly, type heroku login into the command line. You'll be prompted to enter any key to go to the web browser to complete login. The CLI will then log you in automatically.

Connect your Heroku Account to GitHub

One of the benefits you receive in this boot camp is 12 months of access to the GitHub Student Developer Pack. By now, you should have received an email with a link providing access to the Student Developer Pack. This benefit includes $13 in free Heroku credits per month, which will allow you to deploy server-side applications over the rest of the course.

Important Ensure that you've accepted the GitHub Student Developer Pack invitation before proceeding.

After you've accepted the GitHub Student Developer Pack invitation, make sure that you're signed in to your GitHub account.

Next, connect your GitHub account on Heroku.

This will take you to a page called "Heroku for GitHub Students." Scroll down and click on the button with the text "Get the student offer," as shown in the following image:

Description of what Heroku is as a platform with a button with the text "Get the student offer.".

You'll then need to log into your Heroku account, which will take you to a page called "3 Easy Steps to Request Your Free Hobby Dyno." To complete step one, simply click on the button with the text "Verify with GitHub," as shown in the following image:

Heroku's 3 easy steps to request your free hobby dyno page.

You'll be redirected to GitHub with the prompt "Authorize Heroku for GitHub Students." Click the green "Authorize heroku" button to connect your GitHub account with Heroku:

GitHub page with a prompt where the user can either authorize Heroku for GitHub students by clicking a green Authorize heroku button or reject authorizing Heroku for GitHub students by clicking a gray Cancel button.

With Step 1 complete, you can move on to Step 2: "Verify your Heroku billing information." You will need to provide a credit card in the billing section of your account. Rest assured that you won't be charged anything as long as you properly manage your deployed applications. We will go over how to spin down deployed applications in subsequent blogs to both help avoid incurring charges as well as preserve your application code.

Don't click the purple "Verify my billing information" button yet! Click the link "Add a credit or debit card to your account now..." and a new tab will open that will display account's billing page:

Step 2 of 3, asking the user to verify their Heroku billing information.

Within the "Manage Account" page on Heroku, click "Add a credit card" and enter your full payment information:

Heroku's Manage Account page with the billing tab selected, with a purple Add credit card button.

Once you have saved your payment information, you can close the current tab and click the purple "Verify my billing information" button of Step 2:

Step 2 of 3 asking the user to verify their Heroku billing information.

If your payment information is correct, you'll be taken to Step 3, titled "Apply for the Heroku for GitHub Students Offer". Enter your first name, last name, and university.

Note Be sure to enter "EdX Boot Camps" as your University.

Click on the "I'm not a robot" checkbox to be presented with the captcha verification and follow the instructions to complete it; then, click the "Send" button:

Step 3 of 3, with a form that has 3 input fields for first name, last name, and school name.

Finally, you will be presented with a page with the title "Terms: Heroku for GitHub Students Offer." Simply click the "Agree" button:

Heroku's Terms and agreement pop-up with Cancel and Agree buttons.

You'll then be taken back to the "3 Easy Steps to Request Your Free Hobby Dyno" with all three steps checked. Now, just wait up to 24 hours for an email from Heroku confirming that your platform credits have been applied to your Heroku account:

Email from Heroku confirming platform credits have been applied to the Heroku account.

As a last step, within the "Manage Account" page on Heroku, select "Billing." There, you will see an option to "Subscribe to the Eco Dynos Plan."

The Eco Dynos Plan subsection, "Subscribe to Eco" button on the right.

This plan will provide you with 1,000 dyno hours for $5 per month, which should keep you well within your GitHub Student Developer Pack $13 credit amount. Additionally, these dynos will automatically spin down when idle.

Confirm your subscription, then proceed to code and deploy!

"Subscribe to Eco" modal with "Subscribe" button and Eco Dynos description: 1,000 Hours / Month, $5 / Month.

This page was updated 4 months ago
© 2022 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.

Category: heroku

Tagged under: heroku, heroku cli, installation, guide,

All Posts