summaryrefslogtreecommitdiff
path: root/devdocs/docker/engine%2Finstall%2Fbinaries%2Findex.html
blob: 27299a50856875e59aeaf5ed8140a3de2dd6ad4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<h1>Install Docker Engine from binaries</h1>

<blockquote class="important"> <p><strong>Important</strong></p> <p>This page contains information on how to install Docker using binaries. These instructions are mostly suitable for testing purposes. We do not recommend installing Docker using binaries in production environments as they will not be updated automatically with security updates. The Linux binaries described on this page are statically linked, which means that vulnerabilities in build-time dependencies are not automatically patched by security updates of your Linux distribution.</p> <p>Updating binaries is also slightly more involved when compared to Docker packages installed using a package manager or through Docker Desktop, as it requires (manually) updating the installed version whenever there is a new release of Docker.</p> <p>Also, static binaries may not include all functionalities provided by the dynamic packages.</p> <p>On Windows and Mac, we recommend that you install <a href="https://docs.docker.com/desktop/">Docker Desktop</a> instead. For Linux, we recommend that you follow the instructions specific for your distribution.</p> </blockquote> <p>If you want to try Docker or use it in a testing environment, but you’re not on a supported platform, you can try installing from static binaries. If possible, you should use packages built for your operating system, and use your operating system’s package management system to manage Docker installation and upgrades.</p> <p>Static binaries for the Docker daemon binary are only available for Linux (as <code class="language-plaintext highlighter-rouge">dockerd</code>) and Windows (as <code class="language-plaintext highlighter-rouge">dockerd.exe</code>). Static binaries for the Docker client are available for Linux, Windows, and macOS (as <code class="language-plaintext highlighter-rouge">docker</code>).</p> <p>This topic discusses binary installation for Linux, Windows, and macOS:</p> <ul> <li><a href="#install-daemon-and-client-binaries-on-linux">Install daemon and client binaries on Linux</a></li> <li><a href="#install-client-binaries-on-macos">Install client binaries on macOS</a></li> <li><a href="#install-server-and-client-binaries-on-windows">Install server and client binaries on Windows</a></li> </ul> <h2 id="install-daemon-and-client-binaries-on-linux">Install daemon and client binaries on Linux</h2> <h3 id="prerequisites">Prerequisites</h3> <p>Before attempting to install Docker from binaries, be sure your host machine meets the prerequisites:</p> <ul> <li>A 64-bit installation</li> <li>Version 3.10 or higher of the Linux kernel. The latest version of the kernel available for your platform is recommended.</li> <li>
<code class="language-plaintext highlighter-rouge">iptables</code> version 1.4 or higher</li> <li>
<code class="language-plaintext highlighter-rouge">git</code> version 1.7 or higher</li> <li>A <code class="language-plaintext highlighter-rouge">ps</code> executable, usually provided by <code class="language-plaintext highlighter-rouge">procps</code> or a similar package.</li> <li>
<a href="https://tukaani.org/xz/">XZ Utils</a> 4.9 or higher</li> <li>A <a href="https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount">properly mounted</a> <code class="language-plaintext highlighter-rouge">cgroupfs</code> hierarchy; a single, all-encompassing <code class="language-plaintext highlighter-rouge">cgroup</code> mount point is not sufficient. See Github issues <a href="https://github.com/moby/moby/issues/2683">#2683</a>, <a href="https://github.com/moby/moby/issues/3485">#3485</a>, <a href="https://github.com/moby/moby/issues/4568">#4568</a>).</li> </ul> <h4 id="secure-your-environment-as-much-as-possible">Secure your environment as much as possible</h4> <h5 id="os-considerations">OS considerations</h5> <p>Enable SELinux or AppArmor if possible.</p> <p>It is recommended to use AppArmor or SELinux if your Linux distribution supports either of the two. This helps improve security and blocks certain types of exploits. Review the documentation for your Linux distribution for instructions for enabling and configuring AppArmor or SELinux.</p> <blockquote class="warning"> <p>Security Warning</p> <p>If either of the security mechanisms is enabled, do not disable it as a work-around to make Docker or its containers run. Instead, configure it correctly to fix any problems.</p> </blockquote> <h5 id="docker-daemon-considerations">Docker daemon considerations</h5> <ul> <li> <p>Enable <code class="language-plaintext highlighter-rouge">seccomp</code> security profiles if possible. See <a href="../../security/seccomp/index">Enabling <code class="language-plaintext highlighter-rouge">seccomp</code> for Docker</a>.</p> </li> <li> <p>Enable user namespaces if possible. See the <a href="../../reference/commandline/dockerd/index#daemon-user-namespace-options">Daemon user namespace options</a>.</p> </li> </ul> <h3 id="install-static-binaries">Install static binaries</h3> <ol> <li> <p>Download the static binary archive. Go to <a href="https://download.docker.com/linux/static/stable/">https://download.docker.com/linux/static/stable/</a>, choose your hardware platform, and download the <code class="language-plaintext highlighter-rouge">.tgz</code> file relating to the version of Docker Engine you want to install.</p> </li> <li> <p>Extract the archive using the <code class="language-plaintext highlighter-rouge">tar</code> utility. The <code class="language-plaintext highlighter-rouge">dockerd</code> and <code class="language-plaintext highlighter-rouge">docker</code> binaries are extracted.</p> <div class="highlight"><pre class="highlight" data-language="">$ tar xzvf /path/to/&lt;FILE&gt;.tar.gz
</pre></div>  </li> <li> <p><strong>Optional</strong>: Move the binaries to a directory on your executable path, such as <code class="language-plaintext highlighter-rouge">/usr/bin/</code>. If you skip this step, you must provide the path to the executable when you invoke <code class="language-plaintext highlighter-rouge">docker</code> or <code class="language-plaintext highlighter-rouge">dockerd</code> commands.</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo cp docker/* /usr/bin/
</pre></div>  </li> <li> <p>Start the Docker daemon:</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo dockerd &amp;
</pre></div>  <p>If you need to start the daemon with additional options, modify the above command accordingly or create and edit the file <code class="language-plaintext highlighter-rouge">/etc/docker/daemon.json</code> to add the custom configuration options.</p> </li> <li> <p>Verify that Docker is installed correctly by running the <code class="language-plaintext highlighter-rouge">hello-world</code> image.</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo docker run hello-world
</pre></div>  <p>This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.</p> </li> </ol> <h2 id="install-client-binaries-on-macos">Install client binaries on macOS</h2> <blockquote> <p><strong>Note</strong></p> <p>The following instructions are mostly suitable for testing purposes. The macOS binary includes the Docker client only. It does not include the <code class="language-plaintext highlighter-rouge">dockerd</code> daemon which is required to run containers. Therefore, we recommend that you install <a href="https://docs.docker.com/desktop/">Docker Desktop</a> instead.</p> </blockquote> <p>The binaries for Mac also do not contain:</p> <ul> <li>A runtime environment. You must set up a functional engine either in a Virtual Machine, or on a remote Linux machine.</li> <li>Docker components such as <code class="language-plaintext highlighter-rouge">buildx</code>, <code class="language-plaintext highlighter-rouge">docker scan</code>, and <code class="language-plaintext highlighter-rouge">docker compose</code>.</li> </ul> <p>To install client binaries, perform the following steps:</p> <ol> <li> <p>Download the static binary archive. Go to <a href="https://download.docker.com/mac/static/stable/">https://download.docker.com/mac/static/stable/</a> and select <code class="language-plaintext highlighter-rouge">x86_64</code> (for Mac on Intel chip) or <code class="language-plaintext highlighter-rouge">aarch64</code> (for Mac on Apple silicon), and then download the <code class="language-plaintext highlighter-rouge">.tgz</code> file relating to the version of Docker Engine you want to install.</p> </li> <li> <p>Extract the archive using the <code class="language-plaintext highlighter-rouge">tar</code> utility. The <code class="language-plaintext highlighter-rouge">docker</code> binary is extracted.</p> <div class="highlight"><pre class="highlight" data-language="">$ tar xzvf /path/to/&lt;FILE&gt;.tar.gz
</pre></div>  </li> <li> <p>Clear the extended attributes to allow it run.</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo xattr -rc docker
</pre></div>  <p>Now, when you run the following command, you can see the Docker CLI usage instructions:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker/docker
</pre></div>  </li> <li> <p><strong>Optional</strong>: Move the binary to a directory on your executable path, such as <code class="language-plaintext highlighter-rouge">/usr/local/bin/</code>. If you skip this step, you must provide the path to the executable when you invoke <code class="language-plaintext highlighter-rouge">docker</code> or <code class="language-plaintext highlighter-rouge">dockerd</code> commands.</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo cp docker/docker /usr/local/bin/
</pre></div>  </li> <li> <p>Verify that Docker is installed correctly by running the <code class="language-plaintext highlighter-rouge">hello-world</code> image. The value of <code class="language-plaintext highlighter-rouge">&lt;hostname&gt;</code> is a hostname or IP address running the Docker daemon and accessible to the client.</p> <div class="highlight"><pre class="highlight" data-language="">$ sudo docker -H &lt;hostname&gt; run hello-world
</pre></div>  <p>This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.</p> </li> </ol> <h2 id="install-server-and-client-binaries-on-windows">Install server and client binaries on Windows</h2> <blockquote> <p><strong>Note</strong></p> <p>The following section describes how to install the Docker daemon on Windows Server which allows you to run Windows containers only. The binaries for Windows do not contain Docker components such as <code class="language-plaintext highlighter-rouge">buildx</code>, <code class="language-plaintext highlighter-rouge">docker scan</code>, and <code class="language-plaintext highlighter-rouge">docker compose</code>. If you are running Windows 10 or 11, we recommend that you install <a href="https://docs.docker.com/desktop/">Docker Desktop</a> instead.</p> </blockquote> <p>Binary packages on Windows include both <code class="language-plaintext highlighter-rouge">dockerd.exe</code> and <code class="language-plaintext highlighter-rouge">docker.exe</code>. On Windows, these binaries only provide the ability to run native Windows containers (not Linux containers).</p> <p>To install server and client binaries, perform the following steps:</p> <ol> <li> <p>Download the static binary archive. Go to <a href="https://download.docker.com/win/static/stable/x86_64">https://download.docker.com/win/static/stable/x86_64</a> and select the latest version from the list.</p> </li> <li> <p>Run the following PowerShell commands to install and extract the archive to your program files:</p> <div class="highlight"><pre class="highlight" data-language=""> PS C:\&gt; Expand-Archive /path/to/&lt;FILE&gt;.zip -DestinationPath $Env:ProgramFiles
</pre></div>  </li> <li> <p>Register the service and start the Docker Engine:</p> <div class="highlight"><pre class="highlight" data-language=""> PS C:\&gt; &amp;$Env:ProgramFiles\Docker\dockerd --register-service
 PS C:\&gt; Start-Service docker
</pre></div>  </li> <li> <p>Verify that Docker is installed correctly by running the <code class="language-plaintext highlighter-rouge">hello-world</code> image.</p> <div class="highlight"><pre class="highlight" data-language="">PS C:\&gt; &amp;$Env:ProgramFiles\Docker\docker run hello-world:nanoserver
</pre></div>  <p>This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.</p> </li> </ol> <h2 id="upgrade-static-binaries">Upgrade static binaries</h2> <p>To upgrade your manual installation of Docker Engine, first stop any <code class="language-plaintext highlighter-rouge">dockerd</code> or <code class="language-plaintext highlighter-rouge">dockerd.exe</code> processes running locally, then follow the regular installation steps to install the new version on top of the existing version.</p> <h2 id="next-steps">Next steps</h2> <ul> <li>Continue to <a href="../linux-postinstall/index">Post-installation steps for Linux</a>.</li> <li>Take a look at the <a href="../../../get-started/index">Get started</a> training modules to learn how to build an image and run it as a containerized application.</li> <li>Review the topics in <a href="https://docs.docker.com/develop/">Develop with Docker</a> to learn how to build new applications using Docker.</li> </ul> 
<p><a href="https://docs.docker.com/search/?q=binaries">binaries</a>, <a href="https://docs.docker.com/search/?q=installation">installation</a>, <a href="https://docs.docker.com/search/?q=docker">docker</a>, <a href="https://docs.docker.com/search/?q=documentation">documentation</a>, <a href="https://docs.docker.com/search/?q=linux">linux</a></p>
<div class="_attribution">
  <p class="_attribution-p">
    &copy; 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br>
    <a href="https://docs.docker.com/engine/install/binaries/" class="_attribution-link">https://docs.docker.com/engine/install/binaries/</a>
  </p>
</div>