Installing the Heroku CLI on WSL
TJ Wright

TJ Wright @wrightdotclick

About: Software Implementation Manager // Udacity + Flatiron School

Location:
Dallas, TX
Joined:
Nov 18, 2019

Installing the Heroku CLI on WSL

Publish Date: May 1 '20
95 11

Wait, wait, let me guess...

You're running WSL.

You're trying to install Heroku on the command line.

It's not working.

First, you tried downloading the installer, and that didn't work.

Then, you tried tossing sudo apt-get heroku into your bash terminal, and that didn't work.

And then you ended up here. (Or, more likely, searching way too long on StackOverflow.)

Never fear: the answer is right here.

Pop open that bash terminal, and toss in this line:

curl https://cli-assets.heroku.com/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Then lean back and let the Heroku CLI install.

BOOM! Done... sort of.

You're not done quite yet, though. Once it's installed, give heroku apps or heroku open a whirl and you should be prompted with an opportunity to log in.

Enter those credientials, and all of the magic of the Heroku CLI is yours.

It's like navigating Legends of the Hidden Temple, forreal

One thing to note, you probably have to add an --app flag for whatever apps you're running a command against. While most of the Heroku documentation doesn't indicate that, you'll want to include -a your-app-name at the end of every command you run that's app-specific.

For example, the documentation for running migrations says to use heroku rake db:migrate. But you'll have to use heroku rake db:migrate -a your-app-name. Trying to see your error logs? Try heroku logs -a your-app-name instead of heroku logs. You can check out which commands require the -a or --app flag, and which don't on the giant list of Heroku CLI commands.

Way to go, Heroku bro!
Looks like you're off to the races, my WSL compadre.

Want to know more about why curl works? Check out the ultimate guide to everything curl!

Comments 11 total

  • Liz Laffitte
    Liz LaffitteMay 1, 2020

    Love it! Wish I would've found this sooner.

  • Bhanu Pratap Singh
    Bhanu Pratap SinghAug 10, 2020

    finally.....
    finding solution for 45 min and I thought now what am I going to do...

  • Kuldeep Singh
    Kuldeep SinghAug 12, 2020

    thanks buddy :)

  • Onlynfk
    OnlynfkNov 17, 2020

    Thanks a lot for this

  • Patrick Gule
    Patrick GuleNov 30, 2020

    You forgot this one:
    patrickg@DESKTOP-RC5I948:~$ sudo snap install --classic heroku
    Interacting with snapd is not yet supported on Windows Subsystem for Linux.
    This command has been left available for documentation purposes only.

  • Gustavo Suto
    Gustavo SutoMar 8, 2021

    Thanks a lot!

  • JamesZenos
    JamesZenosMay 21, 2021

    Thanks such a lot!!!!!!

  • Leon Van Dyk
    Leon Van DykOct 13, 2021

    Many thanks!

  • weuze
    weuzeNov 3, 2021

    thank you !

  • Matt Jamison
    Matt JamisonMay 18, 2022

    What comes next? The curl command is failing in ubuntu on WSL :(

Add comment