Get docker-compose Working on Raspberry Pi

Janne Kemppainen |

I was setting up Docker on my Raspberry Pi since I wanted to run Home Assistant on top of it. I wanted to use docker-compose to manage the container, but the installation was not successful.

$ docker-compose up -d
-bash: docker-compose: command not found

I had looked at the docker-compose installation instructions and chose to use the pip installation method under the alternative install options. Since we should use Python 3 instead of Python 2, which is the system default, I adapted the command to:

$ python3 -m pip install docker-compose

It seemed to install everything properly but I still got the command not found error. What gives?

Turns out that I forgot to include sudo in the installation command!

So I uninstalled the previous attempt just in case:

$ python3 -m pip uninstall docker-compose

And then installed again with sudo privileges

$ sudo python3 -m pip install docker-compose

and the docker-compose command started working!

Subscribe to my newsletter

What’s new with PäksTech? Subscribe to receive occasional emails where I will sum up stuff that has happened at the blog and what may be coming next.

powered by TinyLetter | Privacy Policy