DockLogDockLogBlog
4 min readDockLog

Install Docker Compose on Linux

Install the official Docker Compose plugin (Compose V2) on Linux using Docker's apt repository, with verification and your first compose file.

DockLog ships as a single-container compose file in our docs. If docker compose is not found on your VPS, this post follows the official Docker Compose installation guide.

Sources: Compose install overview, Install the Compose plugin on Linux, Docker Engine install.

Compose V2 vs the old binary

Modern Docker uses the Compose plugin:

bash
docker compose up -d

The legacy standalone docker-compose binary (hyphenated) is deprecated. Docker's docs mark standalone install as backward compatibility only. Do not follow random blog posts that curl an old docker-compose release unless you are maintaining legacy automation.

Command styleStatus
docker composeCurrent plugin (recommended)
docker-composeLegacy standalone (avoid for new servers)

Prerequisites

You need Docker Engine and Docker CLI installed first. If the daemon is missing, start with Install Docker Engine on Ubuntu and Debian.

Quick check:

bash
docker version

If that fails, install Engine before continuing.

When you installed Docker from Docker's official apt repository, Compose is often already present as docker-compose-plugin. Check:

bash
docker compose version

Example output shape:

text
Docker Compose version v2.x.x

If the command works, you are done. Skip to "First compose file" below.

Install or update the plugin

On Ubuntu or Debian with Docker's repository configured:

bash
sudo apt update
sudo apt install -y docker-compose-plugin
docker compose version

RPM-based distros (Fedora, RHEL, CentOS) use yum instead per the official Linux plugin doc:

bash
sudo yum update
sudo yum install docker-compose-plugin

Bundled with Engine install

The official Engine install line already includes the plugin:

bash
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

If you followed our Docker Engine install post, you likely have Compose already.

Alternative: Docker Desktop

Docker's recommended path on Mac, Windows, and Linux desktops is Docker Desktop, which bundles Engine, CLI, and Compose. For a headless VPS, use the plugin via apt, not Desktop.

Manual plugin install (when apt is not an option)

Official docs allow downloading the CLI plugin binary from GitHub releases. Manual installs do not auto-update. Prefer the repository method when possible.

bash
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version

For system-wide install, use /usr/local/lib/docker/cli-plugins/ instead of ~/.docker/cli-plugins/. Pick architecture (x86_64, aarch64, etc.) per the manual install section.

Verify plugin integration

These should all work without docker-compose on PATH:

bash
docker compose version
docker compose ls
docker compose --help

docker compose ls shows running compose projects on the host. Empty output on a fresh server is normal.

First compose file

Official Compose docs: Quickstart. Minimal example:

yaml
# compose.yaml
services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
bash
mkdir -p ~/compose-test && cd ~/compose-test
# paste compose.yaml
docker compose up -d
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080
docker compose down

You want 200 from curl. That confirms pull, create, network, and port publish.

DockLog smoke test

Once Engine and Compose work, try DockLog the way we document it:

yaml
services:
  docklog:
    image: aimldev/docklog:latest
    ports:
      - "8888:8000"
    environment:
      DISABLE_AUTH: "true"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped
bash
docker compose up -d

Open http://your-host:8888. Full production shape (auth, SECRET_KEY, persistence) is in Compose for production.

Upgrade Compose

With the plugin from Docker's repo:

bash
sudo apt update
sudo apt install docker-compose-plugin

Same command upgrades to the latest plugin version available in the repository. Pin Engine and plugin versions together on hosts where reproducibility matters.

Troubleshooting

SymptomLikely causeFix
docker: 'compose' is not a docker commandPlugin not installedapt install docker-compose-plugin
Old docker-compose v1 behaviorStandalone binary still on PATHRemove legacy binary, use plugin
permission denied on socketUser not in docker groupEngine post-install
Compose file version errorsObsolete version: key in YAMLModern Compose ignores top-level version; see Compose spec
Pull works, up hangsDisk full or cgroup limitsdf -h, check docker system df

Compose file tips before production

Official Compose file reference: Compose file.

Practices we use before leaving stacks running:

  • restart: unless-stopped on long-running services
  • logging options with max-size and max-file (log management)
  • healthcheck blocks where the app supports them (health checks post)
  • Secrets via .env files, not committed to git

Official learning path after install: Getting started with Docker and How Compose works.

Continue reading