DEV Community

Cover image for How to update Docker and Docker Compose on Ubuntu
farid teymouri
farid teymouri

Posted on

117 1 1 1

How to update Docker and Docker Compose on Ubuntu

Updating Docker:

On Linux, you can update Docker using the package manager used to install it. For example, if you installed Docker using the apt package manager, you can update it using the following commands:

# Update the package index
sudo apt update

# Upgrade Docker
sudo apt upgrade docker-ce
Enter fullscreen mode Exit fullscreen mode

If you installed Docker using another package manager like yum or dnf (for CentOS/RHEL) or pacman (for Arch Linux), use the respective package manager's update command.

On macOS, you can update Docker by downloading the latest Docker Desktop application from the Docker website and installing it.

On Windows, you can update Docker by downloading the latest Docker Desktop application for Windows from the Docker website and installing it.

Updating Docker Compose:

Docker Compose is a separate tool from Docker itself, and it requires a separate update process. To update Docker Compose, you can use the following commands:

# Check the current version of Docker Compose
docker-compose version

# Download the latest version of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose

# Verify the installation
docker-compose version

Enter fullscreen mode Exit fullscreen mode

The above commands will download the latest version of Docker Compose and replace the existing one, if any.

Note: Before updating any software, it's always a good practice to check the official documentation for any specific instructions or compatibility requirements.

Additionally, make sure to back up any important data or configurations related to Docker and Docker Compose before performing the update to avoid any potential data loss or conflicts.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay