DEV Community

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

Posted on

118 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.

AI Agent image

How to Build an AI Agent with Semantic Kernel (and More!)

Join Developer Advocate Luce Carter for a hands-on tutorial on building an AI-powered dinner recommendation agent. Discover how to integrate Microsoft Semantic Kernel, MongoDB Atlas, C#, and OpenAI for ingredient checks and smart restaurant suggestions.

Watch the video 📺

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay