Okay, let's get you updated! The exact steps depend on your operating system and how you initially installed Docker.
Please tell me:
- What is your Operating System? (e.g., Ubuntu 22.04, Windows 10/11, macOS Ventura)
- How did you install Docker originally?
- Using Docker Desktop (common for Windows and macOS)?
- Using a package manager like
apt (Debian/Ubuntu), yum/dnf (CentOS/RHEL/Fedora)?
- Using the convenience script from
get.docker.com?
- Something else?
In the meantime, here are the general instructions for common scenarios:
Before you start (Recommended for all systems):
- Backup important data: If you have critical data in Docker volumes or containers that aren't easily reproducible, consider backing them up.
- Stop running containers (optional but good practice):
docker stop $(docker ps -q)
This stops all running containers gracefully. You can restart them after the update.
1. Docker Desktop (Windows & macOS)
This is the easiest. Docker Desktop usually prompts you for updates, or you can check manually:
- macOS: Click the Docker whale icon in the menu bar, then select "Check for Updates..."
- Windows: Right-click the Docker whale icon in the system tray, then select "Check for Updates..."
If an update is available, follow the on-screen prompts to download and install it. Docker Desktop will handle the underlying engine update.
2. Linux (using Package Manager - apt, yum, dnf)
If you installed Docker Engine from Docker's official repositories:
-
Debian/Ubuntu (using apt):
- Update your package list:
sudo apt update
- Install the latest version of Docker packages (this will upgrade existing ones):
sudo apt install --only-upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
(The exact package names might vary slightly based on your initial install, but docker-ce is the main one.)
-
CentOS/RHEL/Fedora (using yum or dnf):
- Update your package list (dnf automatically refreshes metadata, yum might need
sudo yum makecache fast):
# For Fedora or newer RHEL/CentOS:
sudo dnf upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# For older CentOS/RHEL using yum:
sudo yum upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
If you haven't added Docker's official repository before, you'll need to do that first. The update commands above assume the repository is already configured.
3. Linux (using the convenience script from get.docker.com)
If you installed Docker using the curl -fsSL https://get.docker.com -o get-docker.sh script, you can often re-run it to get the latest version. However, it's generally better to manage updates through the package manager once the repository is set up by the script.
If the script set up the repository correctly (it usually does), the package manager instructions (Section 2) should work.
If you want to try re-running the script (use with caution, understand what it does):
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
This script is designed to be idempotent and install/update to the latest stable release.
After Updating (All Systems):
- Verify the version:
docker --version
# or for more details:
docker version
# and
docker info | grep "Server Version" # For Linux
- Restart Docker service (if necessary, mostly for Linux server installs):
Usually, the package manager handles this. If not, or if Docker Desktop doesn't restart automatically:
# For Linux systems using systemd:
sudo systemctl restart docker
- Test Docker:
docker run hello-world
This will pull a small test image and run it, confirming Docker is working.
- Restart your containers:
If you stopped them earlier, restart the ones you need.
Once you provide your OS and installation method, I can give you more precise instructions!