{"id":16179,"date":"2019-03-25T12:13:37","date_gmt":"2019-03-25T12:13:37","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=16179"},"modified":"2026-11-27T07:33:29","modified_gmt":"2026-11-27T07:33:29","slug":"how-to-install-docker-on-ubuntu","status":"publish","type":"post","link":"\/uk\/tutorials\/how-to-install-docker-on-ubuntu\/","title":{"rendered":"How to install Docker on Ubuntu"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p class=\"wp-block-paragraph\">To install Docker on Ubuntu, add Docker&#8217;s official Advanced Package Tool (APT) repository to your system, and install the Docker Engine (<code>docker-ce<\/code>) package together with its plugins. This is the recommended method for manual installations. Using Docker&rsquo;s repository gives you upstream releases and lets you update Docker with the same <code>apt<\/code> commands you use for everything else on your Ubuntu system.<\/p><p class=\"wp-block-paragraph\">The manual installation takes four stages:<\/p><ol class=\"wp-block-list\">\n<li>Remove packages that conflict with Docker Engine.<\/li>\n\n\n\n<li>Add Docker&#8217;s official APT repository.<\/li>\n\n\n\n<li>Install Docker Engine and its plugins.<\/li>\n\n\n\n<li>Verify that Docker is installed and running.<\/li>\n<\/ol><p class=\"wp-block-paragraph\">Hostinger customers can also forgo the manual work altogether and deploy a virtual private server (VPS) with Docker already bundled in. This guide covers both installation methods, explains how to configure Docker permissions, and shows you how to troubleshoot common installation errors and run your first container.<\/p><h2 id=\"h-what-do-you-need-before-installing-docker-on-ubuntu\" class=\"wp-block-heading h-t-title-2\">What do you need before installing Docker on Ubuntu?<\/h2><p class=\"wp-block-paragraph\">To install Docker on Ubuntu, make sure you have:<\/p><ul class=\"wp-block-list\">\n<li><strong>A 64-bit Ubuntu version that Docker supports.<\/strong> Docker Engine currently supports four Ubuntu releases, from 22.04 LTS to 26.10.<\/li>\n\n\n\n<li><strong>Terminal access.<\/strong> On a desktop, any terminal app works. On a server or VPS, connect over Secure Shell (SSH).<\/li>\n\n\n\n<li><strong>A user with<\/strong> <strong><code>sudo<\/code><\/strong> <strong>privileges.<\/strong> Every installation command needs root access.<\/li>\n\n\n\n<li><strong>An internet connection.<\/strong> Your system downloads Docker&#8217;s signing key and packages during setup.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">It&rsquo;s worth understanding <a data-click-id=\"hgr-post-content-link-docker-and-containerization\" href=\"\/gb\/tutorials\/what-is-docker\/\" target=\"_blank\" rel=\"noopener\">Docker and containerization<\/a> before you set anything up if you&rsquo;re new to containers.<\/p><h3 class=\"wp-block-heading h-t-title-3\">Which Ubuntu versions does Docker support?<\/h3><p class=\"wp-block-paragraph\">As of November 2026, Docker Engine supports these Ubuntu releases:<\/p><ul class=\"wp-block-list\">\n<li>Ubuntu 26.10 (Stonking)<\/li>\n\n\n\n<li>Ubuntu 26.04 LTS (Resolute)<\/li>\n\n\n\n<li>Ubuntu 24.04 LTS (Noble)<\/li>\n\n\n\n<li>Ubuntu 22.04 LTS (Jammy)<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Docker adds support for new Ubuntu releases and drops end-of-life ones, so check the <a data-click-id=\"hgr-post-content-link-docker-version-requirements\" href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/#os-requirements\" target=\"_blank\" rel=\"noreferrer noopener\">Docker version requirements<\/a> in their documentation for the current list.<\/p><p class=\"wp-block-paragraph\">This tutorial uses a VPS running on Ubuntu 26.10, but the process is the same on any supported release.<\/p><p class=\"wp-block-paragraph\">To confirm your Ubuntu version and codename, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cat \/etc\/os-release<\/pre><p class=\"wp-block-paragraph\">Look at the <code>VERSION_ID<\/code> and <code>VERSION_CODENAME<\/code> lines in the output. Then check your architecture:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dpkg --print-architecture<\/pre><p class=\"wp-block-paragraph\">Most desktop PCs and x86-based servers return <code>amd64<\/code>, but you may also encounter <code>arm64<\/code> on specific servers. Knowing your CPU architecture is important to make sure you download the right package.<\/p><div class=\"wp-block-image\"><figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0946b1d18ea&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0946b1d18ea\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/image7-3.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-163162\"><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">Existing packages can conflict with Docker Engine if you&#8217;ve installed Docker or another container runtime before.&nbsp;<\/p><h2 id=\"h-how-to-install-docker-on-ubuntu-using-the-official-apt-repository\" class=\"wp-block-heading h-t-title-2\">How to install Docker on Ubuntu using the official APT repository<\/h2><p class=\"wp-block-paragraph\">To install Docker on Ubuntu from the official APT repository, remove conflicting packages, add Docker&rsquo;s repository, install Docker Engine with its plugins, and verify the installation. This method works the same way on an Ubuntu desktop, a home server, or a VPS. The commands detect your Ubuntu version and CPU architecture automatically, so they run unchanged on any supported release.<\/p><h3 class=\"wp-block-heading h-t-title-3\">1. Remove conflicting Docker packages<\/h3><p class=\"wp-block-paragraph\">Before installing Docker Engine, remove the unofficial Docker-related packages that Ubuntu&#8217;s own repositories ship, such as <code>docker.io<\/code>, plus older Docker Compose packages and their own builds of <code>containerd<\/code> and <code>runc<\/code>. Docker&#8217;s repository provides its own versions of these components, so leaving the distribution packages in place can cause package conflicts and leave incompatible Docker components installed.<\/p><p class=\"wp-block-paragraph\">Docker currently lists these packages as conflicting: <code>docker.io<\/code>, <code>docker-compose<\/code>, <code>docker-compose-v2<\/code>, <code>docker-doc<\/code>, <code>docker-buildx<\/code>, <code>podman-docker<\/code>, <code>containerd<\/code>, and <code>runc<\/code>. To remove any installed package from your system, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc | cut -f1)<\/pre><p class=\"wp-block-paragraph\">The command checks which of these packages are installed and passes the matching package names to <code>apt remove<\/code>. APT removes nothing and reports 0 packages to remove if none are installed.<\/p><p class=\"wp-block-paragraph\">Removing these packages doesn&#8217;t automatically delete existing images, containers, volumes, or networks stored in <code>\/var\/lib\/docker\/<\/code>; they stay on disk. Back up your volumes and configuration files before you continue if you&#8217;re replacing a Docker installation that runs production workloads.<\/p><p class=\"wp-block-paragraph\">Docker may also have been installed through Snap. To check whether a Docker Snap package is present, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">snap list docker<\/pre><p class=\"wp-block-paragraph\">Remove the Docker snap before you continue if the command lists one:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo snap remove docker<\/pre><p class=\"wp-block-paragraph\">Like the APT packages, a snap installation keeps its own data, so back up anything you still need from it first.<\/p><h3 class=\"wp-block-heading h-t-title-3\">2. Add Docker&#8217;s official APT repository<\/h3><p class=\"wp-block-paragraph\">First, refresh your package index and install the two tools the repository setup needs, <code>ca-certificates<\/code> and <code>curl<\/code>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update\n\nsudo apt install ca-certificates curl<\/pre><p class=\"wp-block-paragraph\"><code>ca-certificates<\/code> lets your system verify HTTPS connections, while <code>curl<\/code> sends the HTTPS requests; together, they download Docker&#8217;s signing key securely. Enter <code>Y<\/code> and press <strong>Enter<\/strong> if APT prompts you to confirm the installation.<\/p><div class=\"wp-block-image\"><figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0946b1d7eed&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0946b1d7eed\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/image3-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-163163\"><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">Then, create a directory for APT keyrings, download Docker&#8217;s GNU Privacy Guard (GPG) key into it, and make the key readable:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo install -m 0755 -d \/etc\/apt\/keyrings\n\nsudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\n\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.asc<\/pre><p class=\"wp-block-paragraph\">APT uses this key to verify the authenticity of Docker&#8217;s repository metadata. It then checks downloaded packages against the checksums in that metadata to ensure they haven&#8217;t been modified.<\/p><p class=\"wp-block-paragraph\">Now add the repository itself. This command writes a repository definition to <strong>\/etc\/apt\/sources.list.d\/docker.sources<\/strong>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo tee \/etc\/apt\/sources.list.d\/docker.sources &lt;&lt;EOF\n\nTypes: deb\n\nURIs: https:\/\/download.docker.com\/linux\/ubuntu\n\nSuites: $(. \/etc\/os-release &amp;&amp; echo \"${UBUNTU_CODENAME:-$VERSION_CODENAME}\")\n\nComponents: stable\n\nArchitectures: $(dpkg --print-architecture)\n\nSigned-By: \/etc\/apt\/keyrings\/docker.asc\n\nEOF<\/pre><p class=\"wp-block-paragraph\">The Types: deb and URIs lines tell APT that the repository contains binary packages hosted on Docker&#8217;s download server. Here&#8217;s what the remaining lines do:<\/p><ul class=\"wp-block-list\">\n<li><strong>Suites<\/strong> sets the repository&#8217;s distribution name, taking it from your system&rsquo;s information, such as <code>noble<\/code> for Ubuntu 24.04. This tells APT which exact packages to retrieve.&nbsp;<\/li>\n\n\n\n<li><strong>Components: stable<\/strong> limits APT to Docker&#8217;s stable release channel.<\/li>\n\n\n\n<li><strong>Architectures<\/strong>, as with suites, fetches the CPU architecture of your machine from the system.<\/li>\n\n\n\n<li><strong>Signed-By<\/strong> tells APT to trust this repository only when its metadata is signed with the key you just downloaded.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Finally, refresh the package index so APT can see the new repository:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update<\/pre><p class=\"wp-block-paragraph\">You should see <code>download.docker.com<\/code> among the sources in the output.<\/p><div class=\"wp-block-image\"><figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0946b1e2024&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0946b1e2024\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/image9-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-163164\"><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">A previous Docker installation might have left a repository definition in <code>\/etc\/apt\/sources.list.d\/docker.list<\/code>. An outdated or duplicate entry can cause APT errors when you add the new repository configuration. See the troubleshooting table below if <code>apt update<\/code> reports repository conflicts.&nbsp;<\/p><h3 class=\"wp-block-heading h-t-title-3\">3. Install Docker Engine and the required plugins<\/h3><p class=\"wp-block-paragraph\">With the repository in place, install Docker Engine and its plugins:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/pre><p class=\"wp-block-paragraph\">Press <strong>Y<\/strong> and <strong>Enter<\/strong> when APT asks you to confirm. This command installs five packages:<\/p><ul class=\"wp-block-list\">\n<li><strong>docker-ce<\/strong> is Docker Engine, the background service (daemon) that builds and runs containers.<\/li>\n\n\n\n<li><strong>docker-ce-cli<\/strong> is the Docker command-line tool you use to talk to the daemon.<\/li>\n\n\n\n<li><strong>containerd.io<\/strong> provides the container runtime that Docker Engine uses to manage container lifecycles.&nbsp;<\/li>\n\n\n\n<li><strong>docker-buildx-plugin<\/strong> adds Docker Buildx, an extended build tool that provides advanced BuildKit features, including multi-platform image builds.&nbsp;<\/li>\n\n\n\n<li><strong>docker-compose-plugin<\/strong> adds Docker Compose, which defines and runs multi-container applications from a YAML configuration file.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Compose is installed as a command-line interface (CLI) plugin, so it&rsquo;s run as <code>docker compose<\/code>, with a space, instead of the legacy Compose packages&rsquo; docker-compose command. To run more than one container at a time, read our guide to <a data-click-id=\"hgr-post-content-link-docker-compose-for-multi-container-applications\" href=\"\/gb\/tutorials\/what-is-docker-compose\/\" target=\"_blank\" rel=\"noopener\">Docker Compose for multi-container applications<\/a>.<\/p><p class=\"wp-block-paragraph\">Why use Docker&rsquo;s repository instead of running <code>sudo apt install docker.io<\/code>? Ubuntu, not Docker, maintains <code>docker.io<\/code>, so it can lag behind upstream releases. Installing from Docker&#8217;s repository gives you the latest upstream releases, including Buildx and Compose plugins, and makes future updates available through APT. The repository setup is a one-time step.<\/p><h3 class=\"wp-block-heading h-t-title-3\">4. Verify Docker is installed and running<\/h3><p class=\"wp-block-paragraph\">Start by checking the installed version:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker --version<\/pre><p class=\"wp-block-paragraph\">The output shows the installed Docker version and its build identifier, which confirms the Docker CLI is installed.<\/p><p class=\"wp-block-paragraph\">Next, check if the Docker service is running:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl status docker<\/pre><p class=\"wp-block-paragraph\">Look for <strong>active (running)<\/strong> in the output. Press <strong>Q<\/strong> to return to the prompt.<\/p><div class=\"wp-block-image\"><figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0946b1e88cc&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0946b1e88cc\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/image8-2.png\/public\" alt=\"\" class=\"wp-image-163165\"><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">Start the service manually if the status is <strong>inactive<\/strong> or <strong>failed<\/strong>:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl start docker<\/pre><p class=\"wp-block-paragraph\">Usually, the Docker service starts on boot. Enable it with the following command if it doesn&#8217;t start automatically on your system:&nbsp;<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl enable docker<\/pre><p class=\"wp-block-paragraph\">Next, run a test container:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo docker run hello-world<\/pre><p class=\"wp-block-paragraph\">The <code>hello-world<\/code> image is a minimal test image used for verifying your installation. When everything works, the container prints a message that begins with <strong>Hello from Docker!<\/strong> and explains the steps Docker just took.&nbsp;<\/p><p class=\"wp-block-paragraph\">That message confirms the whole chain works: the CLI reached the daemon, the daemon pulled an image over the internet, and Docker successfully created and ran a container.&nbsp;<\/p><div class=\"wp-block-image\"><figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b0946b2015b8&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b0946b2015b8\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/image6-2.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-163166\"><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">Finally, confirm that the Compose plugin is available:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker compose version<\/pre><p class=\"wp-block-paragraph\">Docker is now installed and working. For the commands you&rsquo;ll use daily to manage images, containers, and volumes, see our list of <a data-click-id=\"hgr-post-content-link-essential-docker-commands\" href=\"\/gb\/tutorials\/docker-cheat-sheet\/\" target=\"_blank\" rel=\"noopener\">essential Docker commands<\/a>.<\/p><h2 id=\"h-how-to-install-docker-on-ubuntu-using-hostingers-vps-template\" class=\"wp-block-heading h-t-title-2\">How to install Docker on Ubuntu using Hostinger&#8217;s VPS template<\/h2><p class=\"wp-block-paragraph\">To skip the manual steps on a Hostinger VPS, install the Ubuntu with Docker operating system (OS) template, which comes with Docker pre-configured.&nbsp;<\/p><p class=\"wp-block-paragraph\">To install the Docker template on an existing VPS:<\/p><ol class=\"wp-block-list\">\n<li>Log in to the <a data-click-id=\"hgr-post-content-link-hostinger-dashboard\" href=\"https:\/\/hpanel.hostinger.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Hostinger dashboard<\/a>, go to the <strong>VPS<\/strong> section, and click <strong>Manage<\/strong> next to your server.<br><img alt=\"\" decoding=\"async\" width=\"624\" height=\"167\" src=\"https:\/\/www.hostinger.com\/2839bcdb-3b22-48e3-9d45-3339395b7553\"><\/li>\n\n\n\n<li>On the sidebar, expand <strong>OS &amp; Panel<\/strong> and select <strong>Operating System<\/strong>.<br><img alt=\"\" decoding=\"async\" width=\"624\" height=\"272\" src=\"https:\/\/www.hostinger.com\/0ac6052d-b7d0-4fc9-a110-4d0697b388c1\"><\/li>\n\n\n\n<li>Find <strong>Docker<\/strong> among the application templates and select one. The two matching installations have differing Ubuntu releases &ndash; we recommend picking the latest version available unless you have a specific reason to run an older Ubuntu release.<img alt=\"\" decoding=\"async\" width=\"624\" height=\"260\" src=\"https:\/\/www.hostinger.com\/a5f33226-066d-441f-b762-978dce5ca6d6\"><\/li>\n\n\n\n<li>Confirm the OS change, acknowledge the data loss warning, and set a root password when prompted.<\/li>\n\n\n\n<li>Wait for the installation to finish.<br><img alt=\"\" decoding=\"async\" width=\"624\" height=\"220\" src=\"https:\/\/www.hostinger.com\/d58972d2-fb06-4387-b05d-68e9fb241803\"><\/li>\n<\/ol>    <div class=\"announcement-block announcement-block--warning\">\n        <span class=\"announcement-block__heading\">\n            <svg width=\"24\" height=\"26\" viewBox=\"0 0 24 26\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                d=\"M12 23.5C17.799 23.5 22.5 18.799 22.5 13C22.5 7.20101 17.799 2.5 12 2.5C6.20101 2.5 1.5 7.20101 1.5 13C1.5 18.799 6.20101 23.5 12 23.5ZM13.637 8.65198C13.637 7.74791 12.9041 7.01501 12 7.01501C11.0959 7.01501 10.363 7.74791 10.363 8.65198C10.5335 10.5375 10.875 14.383 10.875 14.383C10.875 15.0043 11.3787 15.508 12 15.508C12.6213 15.508 13.125 15.0043 13.125 14.383V14.38L13.637 8.65198ZM11.9927 16.714C11.3714 16.714 10.8677 17.2177 10.8677 17.839C10.8677 18.4603 11.3714 18.964 11.9927 18.964H12.0073C12.6286 18.964 13.1323 18.4603 13.1323 17.839C13.1323 17.2177 12.6286 16.714 12.0073 16.714H11.9927Z\"\n                fill=\"#BE1025\"\/>\n            <\/svg>\n            Warning        <\/span>\n        <p class=\"announcement-block__content\">\n            <strong>Warning!<\/strong> Changing the operating system on an existing VPS permanently deletes all existing data on the VPS, including any stored snapshots. Back up any files, databases, and configuration you want to keep before you start.        <\/p>\n    <\/div>\n\n    \n\n\n\n<\/p><p class=\"wp-block-paragraph\">When you create a new VPS, you can pick the Docker template during the initial server setup instead, so there&#8217;s no existing data to lose.<\/p><p class=\"wp-block-paragraph\">After the installation finishes, connect to your VPS using your preferred method, then verify Docker exactly as in step 4 of the manual method:&nbsp;<\/p><ol class=\"wp-block-list\">\n<li>Run <code>docker --version<\/code>.&nbsp;<\/li>\n\n\n\n<li>Check <code>sudo systemctl status docker<\/code>.<\/li>\n\n\n\n<li>Run <code>sudo docker run hello-world<\/code>.<\/li>\n<\/ol><h2 id=\"h-how-do-you-run-docker-without-sudo-on-ubuntu\" class=\"wp-block-heading h-t-title-2\">How do you run Docker without sudo on Ubuntu?<\/h2><p class=\"wp-block-paragraph\">To run Docker without <code>sudo<\/code> on Ubuntu, add your user to the docker group. By default, the Docker daemon runs with root privileges, and only root and members of the <code>docker<\/code> group can access it. That&rsquo;s why commands that talk to the daemon, such as <code>docker run<\/code>, needed <code>sudo<\/code> so far. This step is optional &ndash; before you change it, understand what group membership grants.&nbsp;<\/p><p class=\"wp-block-paragraph\">The <code>docker<\/code> group grants root-level privileges to its members. Any user in the group can start a container that mounts the host&rsquo;s filesystem, then modify system files and take full control of the host.&nbsp;<\/p><p class=\"wp-block-paragraph\">Running Docker without <code>sudo<\/code> is a convenience, not a security improvement, so only add users you&#8217;d trust with <code>sudo<\/code> privileges anyway.<\/p><p class=\"wp-block-paragraph\">To add your current user to the group, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo usermod -aG docker $USER<\/pre><p class=\"wp-block-paragraph\">The Docker packages normally create the <code>docker<\/code> group during installation, but if the group doesn&#8217;t exist, create it with:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo groupadd docker<\/pre><p class=\"wp-block-paragraph\"><br>Then, run the command again.<\/p><p class=\"wp-block-paragraph\">Group changes apply only to new login sessions. To apply the change, log out and back in or activate the new group in your current shell:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">newgrp docker<\/pre><p class=\"wp-block-paragraph\">On a VPS, closing the current session and reconnecting has the same effect. Now verify that it works without sudo:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker run hello-world<\/pre><p class=\"wp-block-paragraph\">The <strong>Hello from Docker!<\/strong> message confirms that Docker now works without sudo.<\/p><p class=\"wp-block-paragraph\">The most common causes of a &#8220;permission denied&#8221; error mentioning <code>\/var\/run\/docker.sock<\/code> are:<\/p><ul class=\"wp-block-list\">\n<li>Your current session predates the group change. Log out fully and log back in.<\/li>\n\n\n\n<li>You added a different user than the one you&#8217;re logged in as. Run <code>groups<\/code> to see your current groups.<\/li>\n\n\n\n<li>You ran Docker with <code>sudo<\/code> before the change, and your <code>~\/.docker<\/code> folder is now owned by root.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Our guide to <a data-click-id=\"hgr-post-content-link-fixing-docker-permission-errors\" href=\"\/gb\/tutorials\/how-to-fix-docker-permission-denied-error\/\" target=\"_blank\" rel=\"noopener\">fixing Docker permission errors<\/a> walks through these and other cases in detail.<\/p><p class=\"wp-block-paragraph\">To run Docker without root-level access at all, look into <a data-click-id=\"hgr-post-content-link-dockers-rootless-mode\" href=\"https:\/\/docs.docker.com\/engine\/security\/rootless\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker&#8217;s rootless mode<\/a>, which runs the Docker daemon and containers under a non-root user, reducing the impact of a compromised daemon or container. However, it takes extra effort to set up and has some trade-offs:<\/p><ul class=\"wp-block-list\">\n<li>Containers cannot publish ports below 1024 by default, including 80 (HTTP) and 443 (HTTPS).<\/li>\n\n\n\n<li>User-mode networking is slower.<\/li>\n\n\n\n<li>Containers aren&rsquo;t able to see client IP addresses by default.<\/li>\n\n\n\n<li>Overlay networking and Stream Control Transmission Protocol (SCTP) ports are not supported.<\/li>\n<\/ul><h2 id=\"h-how-do-you-troubleshoot-docker-installation-errors-on-ubuntu\" class=\"wp-block-heading h-t-title-2\">How do you troubleshoot Docker installation errors on Ubuntu?<\/h2><p class=\"wp-block-paragraph\">To troubleshoot Docker installation errors on Ubuntu, match the error message to its cause, then fix one of four things: the APT repository setup, the Docker service, your docker group membership, or network access to Docker Hub.&nbsp;<\/p><p class=\"wp-block-paragraph\">The table below lists the most common errors, their likely causes, and the commands that fix them.<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><thead><tr><th><strong>Error<\/strong><\/th><th><strong>Likely cause<\/strong><\/th><th><strong>Solution<\/strong><\/th><\/tr><\/thead><tbody><tr><td><code>E: Unable to locate package docker-ce<\/code><\/td><td>The Docker repository wasn&#8217;t added, <code>sudo apt<\/code> update wasn&#8217;t run afterward, or your Ubuntu release isn&#8217;t supported<\/td><td>Check that <strong>\/etc\/apt\/sources.list.d\/docker.sources<\/strong> exists, run <code>sudo apt<\/code> update, and confirm your release with <code>cat \/etc\/os-release<\/code><\/td><\/tr><tr><td><code>NO_PUBKEY<\/code> or <code>The following signatures couldn't be verified<\/code><\/td><td>Docker&#8217;s GPG key is missing, incomplete, or unreadable<\/td><td>Re-run the GPG-key download and permission commands from step 2, confirm that <code>Signed-By<\/code> points to <code>\/etc\/apt\/keyrings\/docker.asc<\/code>, then run <code>sudo apt update<\/code> again<\/td><\/tr><tr><td><code>Conflicting values set for option Signed-By<\/code><\/td><td>An old <strong>docker.list<\/strong> file from a previous installation points to a different key<\/td><td>Remove the obsolete repository file with <code>sudo rm \/etc\/apt\/sources.list.d\/docker.list<\/code>, then run <code>sudo apt update<\/code><\/td><\/tr><tr><td><code>Cannot connect to the Docker daemon at unix:\/\/\/var\/run\/docker.sock. Is the docker daemon running?<\/code><\/td><td>The Docker service is stopped or failed to start<\/td><td>Run <code>sudo systemctl start docker<\/code>, then check the logs with <code>sudo journalctl -u docker<\/code><\/td><\/tr><tr><td><code>permission denied while trying to connect to the Docker daemon socket<\/code><\/td><td>Your user isn&#8217;t in the docker group, or your session hasn&#8217;t picked up the change<\/td><td>Use <code>sudo,<\/code> or follow the section on running Docker without <code>sudo<\/code><\/td><\/tr><tr><td><code>hello-world<\/code> fails with a timeout or Domain Name System (DNS) error<\/td><td>The server can&#8217;t reach Docker Hub because of a network, DNS, or proxy problem<\/td><td>Test name resolution with <code>getent hosts registry-1.docker.io <\/code>and check your network settings<\/td><\/tr><tr><td><code>toomanyrequests<\/code> when pulling images<\/td><td>Docker Hub applies <a data-click-id=\"hgr-post-content-link-pull-rate-limits\" href=\"https:\/\/docs.docker.com\/docker-hub\/usage\/\" target=\"_blank\" rel=\"noreferrer noopener\">pull rate limits<\/a>, which are lower for unauthenticated users<\/td><td>Check your current pull limits, wait for the limit to reset, or authenticate with <code>docker login<\/code> to access the higher limits available to signed-in users<\/td><\/tr><tr><td><code>docker: 'compose' is not a docker command<\/code><\/td><td>The Docker Compose plugin installation has failed<\/td><td>Run <code>sudo apt install docker-compose-plugin<\/code><\/td><\/tr><\/tbody><\/table><\/figure><p class=\"wp-block-paragraph\">Run these two commands to diagnose errors that aren&#8217;t in the table:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-cache policy docker-ce<\/pre><p class=\"wp-block-paragraph\">This shows which repository APT would install <code>docker-ce<\/code> from. A healthy setup lists <code>https:\/\/download.docker.com\/linux\/ubuntu<\/code> with a candidate version. APT can&#8217;t see the Docker repository if the candidate is <code>(none)<\/code>.<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo journalctl -u docker --no-pager -n 50<\/pre><p class=\"wp-block-paragraph\">This prints the last 50 log lines from the Docker service. When the daemon refuses to start, the reason, such as an invalid <strong>\/etc\/docker\/daemon.json<\/strong> file, usually appears near the end.<\/p><p class=\"wp-block-paragraph\">Avoid these common fixes, which trade a quick workaround for a security gap or a broken setup:<\/p><ul class=\"wp-block-list\">\n<li><strong>Don&rsquo;t open Docker&#8217;s application programming interface (API) ports, like 2375 or 2376, to fix an installation error.<\/strong> A standard installation doesn&#8217;t need them; the CLI talks to the daemon through a local socket. According to Docker&rsquo;s guide to <a data-click-id=\"hgr-post-content-link-protecting-the-docker-daemon-socket\" href=\"https:\/\/docs.docker.com\/engine\/security\/protect-access\/\" target=\"_blank\" rel=\"noreferrer noopener\">protecting the Docker daemon socket<\/a>, anyone with access to the daemon has root access to the host, so exposing the API to the network hands your server to anyone who finds the port.<\/li>\n\n\n\n<li><strong>Don&#8217;t disable AppArmor to get a container running.<\/strong> It&#8217;s one of the security layers that isolates containers from the host. Find the specific denial in the logs and adjust that rule instead, following the principle of least privilege.<\/li>\n\n\n\n<li><strong>Don&#8217;t delete Docker&#8217;s default bridge network.<\/strong> Docker manages it, and removing it rarely fixes an installation problem and can do more harm than good.<\/li>\n<\/ul><h2 id=\"h-how-to-run-your-first-docker-container\" class=\"wp-block-heading h-t-title-2\">How to run your first Docker container<\/h2><p class=\"wp-block-paragraph\">To run your first Docker container, choose a pre-built image from Docker Hub, such as a web server or a database, and start it with the <code>docker run<\/code> command. The <code>hello-world<\/code> container proves your installation works, but it exits right after printing its message.&nbsp;<\/p><p class=\"wp-block-paragraph\">Pulling a ready-made image is a quick way to learn how Docker handles ports, volumes, and container lifecycles before you start writing your own Dockerfiles. Follow our tutorial to <a data-click-id=\"hgr-post-content-link-create-your-first-docker-container\" href=\"\/gb\/tutorials\/how-to-create-docker-container\/\" target=\"_blank\" rel=\"noopener\">create your first Docker container<\/a> and put your new installation to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To install Docker on Ubuntu, add Docker&#8217;s official Advanced Package Tool (APT) repository to your system, and install the Docker Engine (docker-ce) package together with its plugins. This is the recommended method for manual installations. Using Docker&rsquo;s repository gives you upstream releases and lets you update Docker with the same apt commands you use for [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/how-to-install-docker-on-ubuntu\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":141279,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to install Docker on Ubuntu (Manual and VPS template)","rank_math_description":"Learn how to install Docker on Ubuntu using the manual method or a VPS template. Step-by-step guide for beginners and developers.","rank_math_focus_keyword":"install docker ubuntu","_content_updated_date":"2026-11-27","footnotes":""},"categories":[22664],"tags":[],"class_list":["post-16179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/instalar-docker-ubuntu\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/installer-docker-sur-ubuntu\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-instalar-y-usar-docker-en-ubuntu\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-install-docker-ubuntu\/","default":0},{"locale":"de-DE","link":"https:\/\/www.hostinger.com\/de\/tutorials\/docker-auf-ubuntu-installieren\/","default":0},{"locale":"it-IT","link":"https:\/\/www.hostinger.com\/it\/tutorial\/come-installare-docker-ubuntu\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-docker-on-ubuntu\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-instalar-y-usar-docker-en-ubuntu\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-instalar-y-usar-docker-en-ubuntu\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-instalar-y-usar-docker-en-ubuntu\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/instalar-docker-ubuntu\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=16179"}],"version-history":[{"count":50,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16179\/revisions"}],"predecessor-version":[{"id":141278,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/16179\/revisions\/141278"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media\/141279"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=16179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=16179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=16179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}