Getting flyctl: command not found error post install

Hi @greg I have the same problem. I’ve tried all way to fix that but i couldn’t succeed. can you please help me !

hi! If you’re getting a “flyctl: command not found error”, then you probably just need to configure your shell to add your fly install to your $PATH for all new shells you start with whichever terminal app you’re using.

How to do this will depend on what shell you’re using, since you’d use a different config file with each one.

What happens when you run the following?

cd ~ ; pwd
.fly/bin/flyctl version
1 Like

Hi @victor-barh : no need for me, @eli is on the case :slight_smile: Check :arrow_up:

1 Like

I’m getting thisflyctl v0.0.381 linux/amd64 Commit: ed6bc2a6 BuildDate: 2022-08-23T14:17:58Z. so how can i add it to my PATH

You’ll need to figure out what shell you’re using on your local machine. For most desktop Linux users, this will be bash by default:

That said, it may vary depending on your distro or setup. Running echo $SHELL will let you know what shell you’re running. If it’s not bash, check that project’s documentation website for specific instructions.

If you are running bash, then you can add flyctl to your path by running the following:

NOTE 1: make sure you replace "<your-user>" with the name of your actual user (to double-check this, make sure it matches the output of whoami )

export FLYCTL_INSTALL="/<your-username>/.fly"

Then you’ll want to open your ~/.bashrc file [see note 2] file your favorite text editor, append the above two lines to it and save. Finally, it’s convenient to tell your enviroment you want to make this the default for new shells:

source ~/.bashrc 

NOTE 2: there are other places where you can configure bash behavior. In this case we configured the current user’s bash to know where to find flyctl.

It’s not necessary knowledge to use fly, but knowing all the configuration options for your shell is worthwhile if you’re planning on spending much time there. Here’s a good overview of all the different ways bash can be configured

If you prefer more of a zine/blog-style resource, and want to learn bash specifically as a newer Linux user, I’ve yet to see a better resource than Bite Size Bash :smile:


Hi, I’m receiving the same error and I ran that command gives me this:

.fly/bin/flyctl version
flyctl v0.0.383 linux/amd64 Commit: 16a17b20 BuildDate: 2022-08-25T22:18:50Z

In that case, you’ll probably want to go through the above listed steps-- adding flyctl to your $PATH will let you use the flyctl command without having to specify where it is every time. Have you tried the steps outlined above yet? If so, what what the result?

Hi there, jumping in as I had the same error. In fact when I ran the script it actually gave me the following output which supports what you’ve been advising:

flyctl was installed successfully to /var/services/homes/[USERNAME]/.fly/bin/flyctl
Manually add the directory to your $HOME/.bash_profile (or similar)
  export FLYCTL_INSTALL="/var/services/homes/[USERNAME]/.fly"
Run '/var/services/homes/[USERNAME]/.fly/bin/flyctl --help' to get started

I ran both export lines and added both to my .bashrc file, can confirm this works, thanks for the advice.


In case anyone has this error on windows this is solution:

$env:Path += ';C:\Users\[USERNAME]\.fly\bin' 

Just run it in powershell

Edit: it works… until terminal reboot. Any persistent solution?

1 Like

Hi eli,

I’m having an identical error, but the steps you’ve mentioned haven’t fixed it. Flyctl has been successfully installed, as verified by running .fly/bin/flyctl version in the home directory and getting back ‘flyctl v0.0.441 linux/amd64 …’, and have run both of the export commands (both in the home directory and in the .fly/bin directory) and added them both to my .bashrc file, yet I still cannot use the flyctl tool from the home directory without using /.fly/bin first. Any ideas why this might be happening?


It’s hard to say off the bat, but if you’re having trouble with this, I’d recommend making sure that the changes to ~/.bashrc and/or the local exports are present in the current shell by running

echo $PATH

Basically, you’ll want to make sure that the $FLYCTL_INSTALL settings are somewhere in your $PATH so that bash knows where to find it. How that’s configured to happen can vary quite a bit depending on your local setup.

It’s possible that something else in your setup is overwriting the changes we’re trying to make to the $PATH, or that these changes aren’t making it to the shell session that you’re using to run flyctl commands. For example, this will (and does :sweat_smile: ) happen if you used a different, newer terminal window to make these changes.

If you tried all possibilities and it didn’t work, just run .fly/bin/flyctl <your_fly_command> . This will serve as an alternative to the fly and flyctl commands

1 Like

I was having the same issue and followed the advice above but it still wasn’t working :pensive: adding the following to the end of the ~/.bashrc file fixed the problem though:

export FLYCTL_INSTALL="/home/<your-username>/.fly"

It’s only a small change but it seems to have done the trick for me!

1 Like

Can anyone share a working specs to install and use flyctl on windows?

This worked for me: Install flyctl · Fly Docs

Thanks for reply! I installed it, loged in, added PATH, but still get this error:

It appeared I just needed to reload vs code :face_with_symbols_over_mouth:

1 Like

This is what I’m seeing. Note C:\Users\rubys\.fly\bin in my path.

If you are open to recommendations, I strongly encourage WSL2. It plus Windows Terminal and VSCode are an awesome combination.

1 Like

I have the same issue, after reading Eli’s and james’s reply, I get the hang of it and this works for me. Open the terminal and run this command

nano ~/.bashrc

then at the end of it, add the following command

export FLYCTL_INSTALL="/home/<your.username>/.fly"

Save the file by pressing Ctrl + X, then Y, and Enter.

I had the same issue and solve it like this:
in the terminal run
nano ~/.bashrc

added the two following lines at the end of your bashrc file

export FLYCTL_INSTALL="/home/<your.username>/.fly"

Close and save the bashrc file and run in the terminal

source ~/.bashrc

1 Like