Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

docker build says BuildKit is enabled but the buildx component is missing or broken

ErrorERROR: BuildKit is enabled but the buildx component is missing or broken.

Short answer

docker build is backed by the buildx plugin. When the plugin is not installed, or the file exists but cannot run, Docker prints this error. Install the docker-buildx-plugin package from Docker's apt repository, or download the binary into a cli-plugins folder and make it executable.

  • Applies to Docker Engine 28, Ubuntu 24.04, WSL 2, Docker Buildx 0.2x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask Docker whether it can see the buildx plugin.

    docker buildx version
    docker version
  2. 2Match what you see, then jump to its fix

    1. 1docker buildx version fails or says buildx is not a docker command.The docker-buildx-plugin package is not installedFix
    2. 2You copied docker-buildx from the GitHub releases, and it still is not found or cannot run.A manually downloaded binary is in the wrong place or not executableFix

What does the error look like?

  • ERROR: BuildKit is enabled but the buildx component is missing or broken.

Cause 1 of 2

The docker-buildx-plugin package is not installed

1Check

Docker's Ubuntu install command lists docker-buildx-plugin next to docker-ce and docker-ce-cli. If that package was left out of the install, the plugin is absent.

apt list --installed 2>/dev/null | grep -i docker

2Fix

Install the plugin from Docker's apt repository.

sudo apt install docker-buildx-plugin

3Verify

buildx prints a version.

docker buildx version

Confirmed by docs.docker.com

Did this fix it?

Cause 2 of 2

A manually downloaded binary is in the wrong place or not executable

1Check

The binary must be named docker-buildx and sit in a cli-plugins folder. On Linux and macOS that is $HOME/.docker/cli-plugins for one user. System-wide folders include /usr/local/lib/docker/cli-plugins and /usr/libexec/docker/cli-plugins.

ls -l ~/.docker/cli-plugins/

2Fix

Move or rename the file to docker-buildx in that folder and make it executable.

mkdir -p ~/.docker/cli-plugins
mv ./buildx-v0.0.0.linux-amd64 ~/.docker/cli-plugins/docker-buildx   # your downloaded file name
chmod +x ~/.docker/cli-plugins/docker-buildx

3Verify

docker finds the plugin.

docker buildx version

Confirmed by docs.docker.com

Did this fix it?

How do I stop it coming back?

  • Install Docker from Docker's own apt repository with the full package list, so buildx and compose arrive with the engine.
  • Remove conflicting distro packages before installing Docker Engine.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

A dev container port does not open in the browser when Docker runs on a remote host

If your application only accepts calls from localhost, it will reject connections from published ports

Three things usually break it: the app listens only on localhost inside the container, so published ports are rejected; you open the container port instead of the mapped localhost port VS Code shows; or you changed appPort or a Compose ports list and did not rebuild.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.