Tools: Guía para instalar Docker en Ubuntu 26.04 LTS usando el repositorio oficial (2026)

Tools: Guía para instalar Docker en Ubuntu 26.04 LTS usando el repositorio oficial (2026)

Qué cambió respecto a instalaciones anteriores

Requisitos previos

Paso 1: actualizar el índice de paquetes

Paso 2: remover paquetes conflictivos

Paso 3: instalar dependencias necesarias

Paso 4: agregar la llave oficial de Docker

Paso 5: agregar el repositorio oficial de Docker

Paso 6: actualizar APT e instalar Docker Engine

Paso 7: habilitar e iniciar Docker

Paso 8: validar la instalación con hello-world

- opcional

Paso 9: usar Docker sin sudo - opcional

Comando completo para instalación rápida

Sugerencia final: preparar primero el servidor con hpsr.sh

Fuentes consultadas Docker sigue siendo una de las herramientas más prácticas para desplegar aplicaciones, servicios web, bases de datos, paneles administrativos, herramientas internas y stacks completos mediante contenedores. En esta guía vamos a instalar Docker Engine en Ubuntu 26.04 LTS usando el repositorio oficial de Docker, no el paquete docker.io de los repositorios de Ubuntu. Esto permite instalar una versión más actual de Docker y mantenerla actualizada desde la fuente oficial. La guía está pensada para servidores, VPS y entornos de desarrollo donde necesitas Docker Engine, Docker CLI, Buildx y Docker Compose como plugin oficial. Esta guía está actualizada para Ubuntu 26.04 LTS, cuyo codename es resolute. Si ya habías instalado Docker en Ubuntu 22.04, 24.04 o 25.04, el proceso general sigue siendo muy parecido: agregar la llave oficial de Docker, configurar el repositorio APT e instalar los paquetes. Sin embargo, hay algunos detalles importantes que vale la pena actualizar. El cambio más visible es el uso de docker.sources. Es el formato de fuentes APT moderno y es el que Docker está usando actualmente en su documentación para Ubuntu. Antes de comenzar necesitas: Actualiza la información de paquetes disponible en APT: Opcionalmente puedes actualizar el sistema completo antes de instalar Docker: En servidores de producción, revisa primero qué paquetes se van a actualizar antes de ejecutar un upgrade completo. Ubuntu puede incluir paquetes relacionados con Docker en sus propios repositorios, como docker.io o docker-compose. Esos paquetes no son los mismos que los paquetes oficiales publicados por Docker. Para evitar conflictos, remueve cualquier paquete anterior si existe: Instala los paquetes mínimos necesarios para descargar la llave oficial de Docker y usar repositorios HTTPS: A diferencia de métodos anteriores, aquí no instalamos gnupg porque no vamos a convertir la llave con gpg --dearmor. Crea el directorio donde APT espera encontrar llaves de repositorios externos: Si tienes archivos antiguos de una instalación previa, puedes limpiarlos para evitar duplicados o conflictos: Ahora descarga la llave oficial de Docker: Y asigna permisos de lectura: Ahora crea el archivo /etc/apt/sources.list.d/docker.sources usando el formato Deb822: Este bloque detecta automáticamente el codename de Ubuntu. En Ubuntu 26.04 debe resolver a: Suites: resolute Puedes verificarlo con: cat /etc/apt/sources.list.d/docker.sources Actualiza nuevamente el índice de paquetes, ahora incluyendo el repositorio oficial de Docker: Antes de instalar, puedes validar que APT ya detecta el paquete docker-ce desde el repositorio de Docker: Luego instala Docker Engine y sus componentes principales: Los paquetes instalados son: En Debian y Ubuntu, Docker normalmente queda configurado para iniciar automáticamente después de instalarse. Aun así, este comando deja el servicio habilitado e iniciado explícitamente: Verifica el estado del servicio: También puedes revisar la versión instalada: Si tu usuario todavía no pertenece al grupo docker, puede que estos comandos requieran sudo. Eso lo ajustaremos más adelante. Ejecuta el contenedor de prueba oficial: Si todo está correcto, Docker descargará la imagen hello-world, ejecutará un contenedor temporal y mostrará un mensaje de confirmación. También puedes revisar información general del motor: Por defecto, Docker requiere permisos administrativos porque el daemon corre como root. Para usar Docker sin anteponer sudo, puedes agregar tu usuario al grupo docker. Primero asegúrate de que el grupo exista: Luego agrega tu usuario actual: Aplica el cambio en la sesión actual: Importante: pertenecer al grupo docker equivale prácticamente a tener privilegios de root sobre el host. Solo agregues usuarios de confianza a este grupo. Si quieres hacer la instalación en un solo bloque, puedes usar este script: Si decides usar Docker sin sudo, ejecuta después: Instalar Docker en Ubuntu 26.04 LTS es muy parecido a hacerlo en versiones anteriores de Ubuntu, pero la forma recomendada de configurar el repositorio cambió ligeramente. Los detalles importantes son: Con estos pasos, Docker queda listo para levantar contenedores, usar Compose, desplegar aplicaciones y preparar stacks completos de desarrollo o producción. Si estás instalando Docker en un VPS nuevo, antes de montar tus contenedores puede ser buena idea preparar la base del servidor: usuario administrativo, SSH seguro, firewall, Fail2Ban, actualizaciones automáticas y una configuración inicial más ordenada. Para eso creé hpsr.sh, un script Bash interactivo para hacer el bootstrap inicial y hardening básico de servidores Debian y Ubuntu. No reemplaza una estrategia completa de seguridad, ni herramientas como Ansible o Terraform, pero ayuda a evitar el setup manual repetitivo que casi siempre se hace al levantar un servidor nuevo. Puedes revisarlo aquí: Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

$ -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">upgrade -y -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">upgrade -y -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">upgrade -y for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 500;">apt-cache policy -weight: 500;">docker-ce -weight: 500;">apt-cache policy -weight: 500;">docker-ce -weight: 500;">apt-cache policy -weight: 500;">docker-ce -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status -weight: 500;">docker --no-pager -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status -weight: 500;">docker --no-pager -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status -weight: 500;">docker --no-pager -weight: 500;">docker --version -weight: 500;">docker compose version -weight: 500;">docker --version -weight: 500;">docker compose version -weight: 500;">docker --version -weight: 500;">docker compose version -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 600;">sudo -weight: 500;">docker info -weight: 600;">sudo -weight: 500;">docker info -weight: 600;">sudo -weight: 500;">docker info getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" newgrp -weight: 500;">docker newgrp -weight: 500;">docker newgrp -weight: 500;">docker -weight: 500;">docker run --rm hello-world -weight: 500;">docker run --rm hello-world -weight: 500;">docker run --rm hello-world -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done -weight: 600;">sudo snap -weight: 500;">remove -weight: 500;">docker 2>/dev/null || true -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 500;">docker --version -weight: 600;">sudo -weight: 500;">docker compose version -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done -weight: 600;">sudo snap -weight: 500;">remove -weight: 500;">docker 2>/dev/null || true -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 500;">docker --version -weight: 600;">sudo -weight: 500;">docker compose version -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update for pkg in -weight: 500;">docker.io -weight: 500;">docker-doc -weight: 500;">docker-compose -weight: 500;">docker-compose-v2 podman--weight: 500;">docker containerd runc -weight: 500;">docker -weight: 500;">docker-engine; do -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">remove -y "$pkg" 2>/dev/null || true done -weight: 600;">sudo snap -weight: 500;">remove -weight: 500;">docker 2>/dev/null || true -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y ca-certificates -weight: 500;">curl -weight: 600;">sudo -weight: 500;">install -m 0755 -d /etc/-weight: 500;">apt/keyrings -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.gpg -weight: 600;">sudo rm -f /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.list -weight: 600;">sudo -weight: 500;">curl -fsSL https://download.-weight: 500;">docker.com/linux/ubuntu/gpg -o /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo chmod a+r /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc -weight: 600;">sudo tee /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources > /dev/null <<EOF Types: deb URIs: https://download.-weight: 500;">docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Architectures: $(dpkg --print-architecture) Signed-By: /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc EOF -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y -weight: 500;">docker-ce -weight: 500;">docker-ce-cli containerd.io -weight: 500;">docker-buildx-plugin -weight: 500;">docker-compose-plugin -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable --now -weight: 500;">docker -weight: 600;">sudo -weight: 500;">docker run --rm hello-world -weight: 500;">docker --version -weight: 600;">sudo -weight: 500;">docker compose version getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" newgrp -weight: 500;">docker -weight: 500;">docker run --rm hello-world getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" newgrp -weight: 500;">docker -weight: 500;">docker run --rm hello-world getent group -weight: 500;">docker >/dev/null || -weight: 600;">sudo groupadd -weight: 500;">docker -weight: 600;">sudo usermod -aG -weight: 500;">docker "$USER" newgrp -weight: 500;">docker -weight: 500;">docker run --rm hello-world - Ubuntu 26.04 LTS instalado. - Acceso con un usuario con permisos -weight: 600;">sudo. - Conexión a internet. - Un entorno basado en systemd, como una instalación normal de Ubuntu Server o Ubuntu Desktop. - -weight: 500;">docker-ce: Docker Community Edition, el motor principal. - -weight: 500;">docker-ce-cli: la interfaz de línea de comandos -weight: 500;">docker. - containerd.io: runtime de contenedores usado por Docker. - -weight: 500;">docker-buildx-plugin: soporte moderno para builds con BuildKit. - -weight: 500;">docker-compose-plugin: Docker Compose como plugin oficial, usando el comando -weight: 500;">docker compose. - Ubuntu 26.04 usa el codename resolute. - Docker ya publica repositorio para esta versión. - El método actual usa /etc/-weight: 500;">apt/keyrings/-weight: 500;">docker.asc. - El repositorio se configura con /etc/-weight: 500;">apt/sources.list.d/-weight: 500;">docker.sources. - Docker Compose se instala como plugin y se usa con -weight: 500;">docker compose. - En servidores con UFW, hay que considerar cómo Docker maneja reglas de red y puertos publicados. - Docker Docs — Install Docker Engine on Ubuntu - Docker Docs — Linux post-installation steps - Docker Ubuntu repository — resolute