How to Uninstall Docker Compose? Complete Guide
Docker Compose is a very handy tool for managing multi-container applications. But whether to solve a problem or to free up disk space, you may sometimes need to uninstall it.
So Debugbar has put together a little complete guide for you to cleanly remove Docker Compose (DC) from your system, whether you are on Windows, Mac or Linux.
Uninstalling Docker Compose on Mac
You installed Docker Compose on Mac? 4 solutions are available to remove it. Let’s look at each of them in detail.
Via the Docker Desktop application
If you installed Docker Compose on your Mac via the Docker Desktop application, uninstalling it is very simple:
- Open Docker Desktop.
- Go to the Troubleshoot section.
- Click the Uninstall button to completely uninstall Docker Engine and Docker Compose.
Be careful, this will remove Docker from your system, not just Docker Compose.
Via Homebrew
Did you install DC via the Homebrew package manager? You’ll then need to open the command terminal and type the following command:
- brew uninstall docker-compose
After running the command, DC should be uninstalled.
Via MacPorts
If you used MacPorts to install Docker Compose, you’ll need to open the command terminal and run the following line to uninstall it:
- sudo port uninstall docker-compose
Via the rm command
Finally, the last method is to directly delete the Docker Compose source directory with the rm command. To do this:
- Open the command terminal and check the location of Docker Compose with the following command:
- which docker-compose
- Then use rm to uninstall it:
- sudo rm -rf /usr/local/bin/docker-compose
The application should now be removed from your machine.
Uninstalling Docker Compose on Ubuntu
You use Linux and want to uninstall DC? You can do it in 2 ways. Here’s how.
Uninstall the Docker Compose CLI plugin
To remove the Docker Compose CLI plugin on Ubuntu or Debian you’ll need to open a terminal and type the following command:
- sudo apt-get remove docker-compose-plugin
On RPM-based distributions the command to type in order to uninstall the Docker Compose CLI plugin will be different:
- sudo yum remove docker-compose-plugin
Manual installation
If you installed Docker Compose manually with curl, you’ll need to uninstall it with the following command:
- rm $DOCKER_CONFIG/cli-plugins/docker-compose
Finally, if you installed it for all users, the command to run is:
- rm /usr/local/lib/docker/cli-plugins/docker-compose
Useful tip: In case of “Permission denied” error, add sudo before the command.
In summary, uninstalling Docker Compose depends on the installation method chosen initially. Follow the steps for your system and feel free to use the rm command as a last resort.