<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu on Hoang Duong</title><link>https://tech.nguuyen.io.vn/en/tags/ubuntu/</link><description>Recent content in Ubuntu on Hoang Duong</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 22 Feb 2026 14:20:00 +0700</lastBuildDate><atom:link href="https://tech.nguuyen.io.vn/en/tags/ubuntu/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Install Docker on Ubuntu 🐳</title><link>https://tech.nguuyen.io.vn/en/posts/installation-guides/setup-docker-on-ubuntu/</link><pubDate>Sun, 30 Nov 2025 00:00:00 +0000</pubDate><guid>https://tech.nguuyen.io.vn/en/posts/installation-guides/setup-docker-on-ubuntu/</guid><description>&lt;img src="https://tech.nguuyen.io.vn/images/installation-guides/docker-installation-ubuntu.webp" alt="Featured image of post How to Install Docker on Ubuntu 🐳" />&lt;h2 id="-introduction-to-docker">🐳 Introduction to Docker
&lt;/h2>&lt;p>Docker is a popular platform in DevOps for deploying applications using &lt;strong>containers&lt;/strong>. Containers allow you to package applications together with all their dependencies and necessary configurations, ensuring consistent execution across all environments from development to production.&lt;/p>
&lt;p>&lt;strong>Benefits of Docker:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>⚡ &lt;strong>Consistency&lt;/strong>: Applications run identically across all environments&lt;/li>
&lt;li>🚀 &lt;strong>Speed&lt;/strong>: Containers start faster than virtual machines&lt;/li>
&lt;li>📦 &lt;strong>Packaging&lt;/strong>: Easy to share and deploy applications&lt;/li>
&lt;li>🔄 &lt;strong>Scalability&lt;/strong>: Easy to scale and manage multiple containers&lt;/li>
&lt;/ul>
&lt;p>This guide walks you through installing Docker on Ubuntu 20.04 and 22.04 in a straightforward and efficient manner, using Docker&amp;rsquo;s official repository to ensure you always have the latest stable version.&lt;/p>
&lt;hr>
&lt;h2 id="-prerequisites">✅ Prerequisites
&lt;/h2>&lt;p>Before you begin, make sure you have:&lt;/p>
&lt;ul>
&lt;li>🖥️ &lt;strong>Ubuntu 20.04 or 22.04 server&lt;/strong> installed&lt;/li>
&lt;li>🔐 &lt;strong>Sudo privileges&lt;/strong> to execute administrative commands&lt;/li>
&lt;li>🌐 &lt;strong>Internet connection&lt;/strong> to download packages&lt;/li>
&lt;li>⏱️ &lt;strong>Time&lt;/strong>: Installation takes approximately 5-10 minutes&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="1-update-the-system">1. Update the System
&lt;/h2>&lt;p>Before installing Docker, ensure your system is fully updated. This guarantees you have the latest security patches and necessary dependencies.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo apt update &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> sudo apt upgrade -y
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>💡 Notes:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>The &lt;code>apt update&lt;/code> command updates the list of available packages from repositories&lt;/li>
&lt;li>The &lt;code>apt upgrade -y&lt;/code> command automatically installs updates without prompting&lt;/li>
&lt;li>This process may take several minutes depending on the number of packages to update&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="2-install-docker">2. Install Docker
&lt;/h2>&lt;h3 id="21-install-required-dependencies">2.1. Install Required Dependencies
&lt;/h3>&lt;p>These packages are necessary for Docker to download and authenticate packages from the official repository:&lt;/p>
&lt;ul>
&lt;li>&lt;code>apt-transport-https&lt;/code>: Allows APT to use HTTPS protocol&lt;/li>
&lt;li>&lt;code>ca-certificates&lt;/code>: Provides SSL/TLS certificates for secure connection authentication&lt;/li>
&lt;li>&lt;code>curl&lt;/code>: Tool to download files from the internet&lt;/li>
&lt;li>&lt;code>software-properties-common&lt;/code>: Provides utilities for managing repositories&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="22-add-the-official-docker-repository">2.2. Add the Official Docker Repository
&lt;/h3>&lt;p>To install Docker from the official source, we need to add Docker&amp;rsquo;s GPG key and repository to the system. This ensures you receive official and security updates from Docker.&lt;/p>
&lt;p>&lt;strong>Step 1: Add Docker&amp;rsquo;s GPG Key&lt;/strong>&lt;/p>
&lt;p>The GPG key is used to authenticate the integrity of Docker packages:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -fsSL https://download.docker.com/linux/ubuntu/gpg &lt;span class="p">|&lt;/span> sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>Step 2: Add Docker Repository&lt;/strong>&lt;/p>
&lt;p>Add Docker repository to APT&amp;rsquo;s sources list. This command automatically detects your Ubuntu version (&lt;code>$(lsb_release -cs)&lt;/code>) and adds the appropriate repository:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">echo&lt;/span> &lt;span class="s2">&amp;#34;deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu &lt;/span>&lt;span class="k">$(&lt;/span>lsb_release -cs&lt;span class="k">)&lt;/span>&lt;span class="s2"> stable&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>💡 Explanation:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>arch=amd64&lt;/code>: Specifies 64-bit architecture&lt;/li>
&lt;li>&lt;code>signed-by&lt;/code>: Specifies the GPG key for authentication&lt;/li>
&lt;li>&lt;code>$(lsb_release -cs)&lt;/code>: Automatically retrieves Ubuntu&amp;rsquo;s code name (e.g., jammy for Ubuntu 22.04)&lt;/li>
&lt;li>&lt;code>stable&lt;/code>: Uses the stable channel (you can use &lt;code>test&lt;/code> or &lt;code>nightly&lt;/code> for experimental versions)&lt;/li>
&lt;/ul>
&lt;h3 id="23-install-docker-engine">2.3. Install Docker Engine
&lt;/h3>&lt;p>After adding the repository, update the package list and install Docker Engine:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo apt update
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo apt install -y docker-ce docker-ce-cli containerd.io
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>📦 Packages Being Installed:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>docker-ce&lt;/code>: Docker Community Edition - the open-source version of Docker&lt;/li>
&lt;li>&lt;code>docker-ce-cli&lt;/code>: Docker Command Line Interface - command-line tool to interact with Docker&lt;/li>
&lt;li>&lt;code>containerd.io&lt;/code>: Container runtime - low-level tool for managing container lifecycle&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>⏱️ Installation Time:&lt;/strong> This process typically takes 2-5 minutes depending on your internet speed.&lt;/p>
&lt;hr>
&lt;h2 id="3-verify-docker">3. Verify Docker
&lt;/h2>&lt;p>After installation, verify that Docker is running properly:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo systemctl status docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>Expected Result:&lt;/strong> You should see the status &lt;code>active (running)&lt;/code> if Docker started successfully.&lt;/p>
&lt;p>If Docker isn&amp;rsquo;t running, you can start it and enable auto-start on boot:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo systemctl start docker
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo systemctl &lt;span class="nb">enable&lt;/span> docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>💡 Command Explanations:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>systemctl start docker&lt;/code>: Starts the Docker service immediately&lt;/li>
&lt;li>&lt;code>systemctl enable docker&lt;/code>: Configures Docker to auto-start on system boot&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="4-test-docker">4. Test Docker
&lt;/h2>&lt;p>To confirm Docker is working correctly, run the sample &lt;code>hello-world&lt;/code> container:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo docker run hello-world
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>Expected Result:&lt;/strong> If you see the &amp;ldquo;Hello from Docker!&amp;rdquo; message along with Docker information, congratulations, installation successful! 🎉&lt;/p>
&lt;p>&lt;strong>🔍 What does the &lt;code>hello-world&lt;/code> container do?&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Downloads the &lt;code>hello-world&lt;/code> image from Docker Hub (if not already present)&lt;/li>
&lt;li>Runs the container and displays a welcome message&lt;/li>
&lt;li>Automatically stops after completion&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="5-configure-user-permissions">5. Configure User Permissions
&lt;/h2>&lt;p>By default, Docker requires root privileges to run commands. To run Docker without &lt;code>sudo&lt;/code>, add your current user to the &lt;code>docker&lt;/code> group:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo usermod -aG docker &lt;span class="nv">$USER&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">newgrp docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>💡 Explanation:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>usermod -aG docker $USER&lt;/code>: Adds the current user to the &lt;code>docker&lt;/code> group (which has Docker daemon access privileges)&lt;/li>
&lt;li>&lt;code>newgrp docker&lt;/code>: Applies group changes immediately without needing to log out&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>⚠️ Important Notes:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>After executing this command, you may need to log out and log back in for changes to take effect&lt;/li>
&lt;li>Alternatively, you can open a new terminal window to apply changes&lt;/li>
&lt;li>Adding a user to the &lt;code>docker&lt;/code> group grants equivalent root privileges on the Docker daemon, so only add trusted users&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Verify New Permissions:&lt;/strong>&lt;/p>
&lt;p>After configuration, try running Docker without &lt;code>sudo&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">docker run hello-world
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>If the command succeeds without &lt;code>sudo&lt;/code>, you&amp;rsquo;ve configured it correctly! ✅&lt;/p>
&lt;hr>
&lt;h2 id="6-uninstall-docker-if-needed">6. Uninstall Docker (if needed)
&lt;/h2>&lt;p>If you want to completely remove Docker from your system, follow these steps:&lt;/p>
&lt;p>&lt;strong>Step 1: Remove Docker Packages&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo apt remove -y docker-ce docker-ce-cli containerd.io
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>Step 2: Delete Docker Data&lt;/strong>&lt;/p>
&lt;p>Docker data (images, containers, volumes, networks) is stored in &lt;code>/var/lib/docker&lt;/code>. To remove completely:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo rm -rf /var/lib/docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;strong>⚠️ Warning:&lt;/strong> This command will delete &lt;strong>ALL&lt;/strong> Docker data including:&lt;/p>
&lt;ul>
&lt;li>All downloaded images&lt;/li>
&lt;li>All containers (running and stopped)&lt;/li>
&lt;li>All volumes and networks&lt;/li>
&lt;li>All data within containers&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Step 3: Remove Docker Configuration (optional)&lt;/strong>&lt;/p>
&lt;p>To completely remove all traces of Docker:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo rm -rf /var/lib/containerd
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo rm -rf /etc/docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;hr>
&lt;h2 id="-basic-docker-commands">📚 Basic Docker Commands
&lt;/h2>&lt;p>After installation, here are some basic commands you should know:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Command&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>docker --version&lt;/code>&lt;/td>
&lt;td>Check Docker version&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker ps&lt;/code>&lt;/td>
&lt;td>List running containers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker ps -a&lt;/code>&lt;/td>
&lt;td>List all containers (including stopped)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker images&lt;/code>&lt;/td>
&lt;td>List all images&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker pull &amp;lt;image&amp;gt;&lt;/code>&lt;/td>
&lt;td>Download image from Docker Hub&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker run &amp;lt;image&amp;gt;&lt;/code>&lt;/td>
&lt;td>Run container from image&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker stop &amp;lt;container&amp;gt;&lt;/code>&lt;/td>
&lt;td>Stop running container&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker rm &amp;lt;container&amp;gt;&lt;/code>&lt;/td>
&lt;td>Remove container&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>docker rmi &amp;lt;image&amp;gt;&lt;/code>&lt;/td>
&lt;td>Remove image&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="-troubleshooting">🔧 Troubleshooting
&lt;/h2>&lt;h3 id="issue-docker-daemon-wont-start">Issue: Docker daemon won&amp;rsquo;t start
&lt;/h3>&lt;p>&lt;strong>Cause:&lt;/strong> May be due to conflicts with other services or misconfiguration.&lt;/p>
&lt;p>&lt;strong>Solution:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Check Docker logs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo journalctl -u docker
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Restart Docker&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo systemctl restart docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="issue-permission-denied-when-running-docker">Issue: Permission denied when running Docker
&lt;/h3>&lt;p>&lt;strong>Cause:&lt;/strong> User hasn&amp;rsquo;t been added to the &lt;code>docker&lt;/code> group.&lt;/p>
&lt;p>&lt;strong>Solution:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Add user to docker group&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo usermod -aG docker &lt;span class="nv">$USER&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Log out and log back in, or run:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">newgrp docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="issue-cannot-connect-to-docker-daemon">Issue: Cannot connect to Docker daemon
&lt;/h3>&lt;p>&lt;strong>Cause:&lt;/strong> Docker daemon hasn&amp;rsquo;t been started.&lt;/p>
&lt;p>&lt;strong>Solution:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Check status&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo systemctl status docker
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Start Docker&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sudo systemctl start docker
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;hr>
&lt;h2 id="-conclusion">🎯 Conclusion
&lt;/h2>&lt;p>Congratulations on completing Docker installation on Ubuntu! 🎉 Now you can:&lt;/p>
&lt;ul>
&lt;li>🐳 &lt;strong>Create and run containers&lt;/strong> for your applications&lt;/li>
&lt;li>📦 &lt;strong>Use Docker images&lt;/strong> available from Docker Hub&lt;/li>
&lt;li>🚀 &lt;strong>Deploy applications&lt;/strong> consistently and easily&lt;/li>
&lt;li>🔄 &lt;strong>Manage development and production environments&lt;/strong> more efficiently&lt;/li>
&lt;/ul>
&lt;p>Docker is a powerful tool in the DevOps world. Continue exploring Docker features like Docker Compose, Docker Swarm, and CI/CD integration to optimize your development workflow!&lt;/p>
&lt;p>&lt;strong>📖 References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;a class="link" href="https://docs.docker.com/" target="_blank" rel="noopener"
>Official Docker Documentation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://hub.docker.com/" target="_blank" rel="noopener"
>Docker Hub&lt;/a> - The largest image repository&lt;/li>
&lt;li>&lt;a class="link" href="https://docs.docker.com/develop/dev-best-practices/" target="_blank" rel="noopener"
>Docker Best Practices&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Good luck with Docker! 🚀😊&lt;/p></description></item></channel></rss>