'command not found' when I try to run docker-compose

I’m running Armbian (Debian Buster arm64) on an Odroid HC2 (XU4). I installed Docker Compose using the instrux found in the Linux section of the docs install page.
I’m logged in as root via SSH. I run the curl command (which I literally copied/pasted from the docs install page)
curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
then
chmod +x /usr/local/bin/docker-compose
and I check it with
which docker-compose
which returns:
/usr/local/bin/docker-compose
When I try to test the installation…
docker-compose --version
it returns:
bash: /usr/bin/docker-compose: Permission denied
Notice that it seems to want /usr/bin instead of /usr/local/bin, so (as suggested on the docs install page) I run
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
and I try to test the installation again. Now it returns:
/usr/bin/docker-compose: line 1: Not: command not found

I removed everything and tried the curl command (pointed at /usr/bin instead of /usr/local/bin) again, followed by the chmod command. Now which docker-compose returns
/usr/bin/docker-compose
So I try to test the installation again with docker-compose --version and I get the same thing:
/usr/bin/docker-compose: line 1: Not: command not found

What in the heck am I doing wrong?

1 Like

Idem on Ubuntu 20.04 LTS on raspberry pi4
If you type cat docker-compose in /usr/local/bin, you’ll get “Not found” …
Type uname -s then uname -m, and see if you get something from URL in your browser. For me, uname -s is Linux, and uname -m is aarch64, but unfortunately https://github.com/docker/compose/releases/download/1.26.2/docker-compose-Linux-aarch64 does not exists.

1 Like

Thank you! I’ll try to build from source.

In case anyone stumbles upon this and, like me, is trying to install docker-compose on Debian Buster-based Armbian (arm64 architecture) the answer, as it turns out, is quite simple…

Install Docker using softy. (Softy does all the work - it’s great!) Test the install with

docker run hello-world

Once that’s done and successful, you can just run

sudo apt install docker-compose

and it just works. If you want to test it, paste this into docker-compose.yml:

version: '3'  
services:
  web:
    image: nginx:latest
    ports:
     - "8080:80"
    links:
     - php
  php:
    image: php:7-fpm

then run

docker-compose up -d && docker ps

to test.

2 Likes

Thank you very much, your answer actually solved my problem. For next users having my same trouble I suggest them to check out if the remote file you want to get on your local machine does exist or not (in order to verify it just copy the link pointing to the remote file in a WEB browser and press enter). If the file does not exist you will probably face this kind of issue.

I had this same issue, the command:
docker-compose --version
would return:
/usr/local/bin/docker-compose: line 1: Not: command not found.
It turned out that I was typing the command incorrectly for my set up. The correct command was this:
docker compose version

1 Like