I'm trying to install the latest version of Docker from scratch on my Ubuntu Server 24.04.4 LTS. I've made sure to run both "sudo apt update" and "sudo apt upgrade". I also uninstalled any conflicting packages, which I didn't have. I've successfully set up Docker's APT repository. However, when I try to install Docker with the command:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
I'm getting several errors that state the packages aren't available or can't be located. Specifically, I'm seeing messages like:
- Package docker-ce is not available, but is referred to by another package.
- E: Package 'docker-ce' has no installation candidate.
- E: Unable to locate package containerd.io.
As a beginner, I'm finding it hard to understand the solutions I see online. If anyone has some detailed guidance on what to do next, I'd really appreciate it!
5 Answers
I recommend going further down the Docker installation page. They sometimes update their documentation, so the solutions can be a bit buried. It's worth scrolling through!
Make sure you're using the installation instructions provided by Docker directly. The default Ubuntu repositories sometimes have outdated or broken Docker packages. Following only the official Docker instructions is the best route.
That’s exactly what I’m doing! Checking the official guidelines now.
It might be that your repository setup isn't correct. I usually automate this with Ansible. Here’s a playbook I use for installing Docker that might help you figure it out: [Ansible Playbook for Docker](https://github.com/jameskilbynet/iac/blob/main/ansible/docker/install_docker.yml)
Thanks a lot! I’ll check out that playbook and see if I can follow it!
Another option is to use the Docker installation script. You can run:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
This should handle the setup for you.
It sounds like you might not have added the Docker APT source correctly. To make sure everything's set up right, double-check the installation instructions on Docker's official site. They usually have the most reliable steps for adding the repository.
I followed what was in the manual, but I might've missed something important. Can you share a link to what I should check?
Sure! Here it is: [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/) - follow those steps closely!

I’m trying to avoid a GUI setup. Is it going to be straightforward without it?