To set up Docker on Ubuntu 25.10 (Questing Quokka), follow these steps. These instructions use the official Docker repository to ensure you get the latest version.
Step 1: Uninstall Old Versions
Conflicting packages (like docker.io or podman-docker) might be installed by default. Remove them to prevent conflicts:
sudo apt-get remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc
Step 2: Set Up the Docker Repository
1、Update your package index and install necessary dependencies:
sudo apt-get update
sudo apt-get install ca-certificates curl
2、Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
3、Add the repository to your sources:
This command automatically detects your Ubuntu version codename (questing for 25.10) and adds the correct repository.
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
4、Update the package index again to include the new Docker packages:
sudo apt-get update
Step 3: Install Docker Engine
Install the latest version of Docker Engine, containerd, and Docker Compose:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 4: Verify the Installation
Run the “hello-world” image to verify that Docker is installed and running correctly:
sudo docker run hello-world
Step 5: Run Docker Without Sudo (Optional)
By default, running Docker requires sudo. To run Docker commands as your current user:
1、Create the docker group (it likely already exists):
sudo groupadd docker
2、Add your user to the group:
sudo usermod -aG docker $USER
3、Apply the changes:
Log out and log back in, or run the following command to activate the changes immediately:
newgrp docker
4、Test it:
docker run hello-world
(This should now work without sudo).
Run a never-exit docker container of ubuntu20.04
The “Tail Null” (Classic)
This is a very common alternative often used in older scripts. It “watches” a file that never changes, keeping the process active.
docker run -d --name my-ubuntu ubuntu:20.04 tail -f /dev/null
How to enter the container
Once your container is running in the background, you can log into it using exec:
docker exec -it my-ubuntu bash
sss