Check Whether Compose Is Already Installed
docker compose versionIf this prints a version, Compose is installed and you can skip to the first project below. The installation steps in how to install Docker on Ubuntu and how to install Docker on Debian install it together with the engine. If Docker answers that compose is not a docker command, the plugin is missing.
Install on Ubuntu and Debian
Compose is the docker-compose-plugin package in Docker's apt repository. With that repository set up as in the two guides above:
sudo apt update
sudo apt install docker-compose-plugin
docker compose versionIf apt cannot find the package, Docker's repository is not configured on this server; add it first, as the install guides show. Do not mix Docker's packages with the Docker packages of your distribution.
Install on AlmaLinux and Rocky Linux
Docker lists AlmaLinux and Rocky Linux 8, 9, and 10 as supported and has a repository for each. Add the one for your distribution, then install the engine with the plugins. On AlmaLinux:
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/alma/docker-ce.repoOn Rocky Linux, the address ends in /linux/rocky/docker-ce.repo instead. Then, on both:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
docker compose versiondnf asks you to accept Docker's signing key; compare the fingerprint with the one in Docker's documentation. The packages conflict with the distribution's podman and runc, which Docker's install page has you remove first; check that nothing on the server still needs Podman before you do. The install does not start Docker, which is why enable --now follows. If Docker Engine is already installed, sudo dnf install docker-compose-plugin is enough.
The Old docker-compose Command
docker-compose, with a hyphen, is the standalone Compose v1, which Docker no longer supports and which gets no fixes. Do not install it. A script or tutorial that calls docker-compose up -d usually works with docker compose up -d, so change the script and test it once. To see whether v1 is still on the server, run docker-compose version; a 1.x version is the old tool. Remove it with the package manager that installed it.
Some old guides download a Compose binary with curl or pipe an install script into a shell as root. Use the package instead: it is signed by the repository key and updates with the rest of the system, while Docker notes that manual installations do not update themselves.
Your First compose.yaml
mkdir ~/hello
cd ~/hello
nano compose.yamlservices:
web:
image: nginx:1.30
ports:
- "127.0.0.1:8080:80"
restart: unless-stoppedNo version: line is needed: Compose treats the top-level version key as obsolete and warns about it. The port is bound to the loopback address, so only the server itself reaches it; see Docker port mapping.
Start, Check, and Stop
docker compose up -d
docker compose ps
curl -I http://127.0.0.1:8080
docker compose logs web
docker compose downThe curl line should print the response headers: a status line with the code 200 and a Server header that names nginx. down removes the container and the project network. More options are in docker compose up -d, and reading the output in how to view Docker container logs.
Keeping Compose Up to Date
The plugin updates with the rest of the system through sudo apt update and sudo apt upgrade, or sudo dnf upgrade; see sudo apt update. Containers are not touched by that update.
Troubleshooting
- compose is not a docker command: the plugin is not installed for the Docker you run; check
command -v dockerand install the package. - Permission denied on the socket: see how to run Docker without sudo.
- No configuration file provided: you are not in the folder with
compose.yaml, or the file has another name; use-f.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations