User Tools

Site Tools


docker:install_docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docker:install_docker [2016/10/13 23:56] – created peterdocker:install_docker [2025/05/20 15:43] (current) peter
Line 1: Line 1:
 ====== Docker - Install Docker ====== ====== Docker - Install Docker ======
  
 +===== Check the kernel version and the OS architecture =====
 +
 +Run **uname -a** to check the version of the currently running Linux kernel:
 +
 +<code bash>
 +uname -a
 +</code>
 +
 +Check that it's a 64Bit Kernel (x86_64).  Docker won't work without this.
 +
 +----
 +
 +Check the Ubuntu version.
 +
 +<code bash>
 +cat /etc/lsb-release
 +</code>
 +
 +The command shows that the Ubuntu version is 16.04.
 +
 +----
 +
 +It is recommended to update Ubuntu before you install new software. Run the following command to fetch the latest updates from the Ubuntu repository and install them.
 +
 +<code bash>
 +sudo apt update
 +sudo upgrade
 +</code>
 +
 +----
 +
 +Now install docker with the apt command:
 +
 +<code bash>
 +sudo apt install -y docker.io
 +</code>
 +
 +Wait until the installation has been completed.
 +
 +----
 +
 +===== Add your user to the docker group =====
 +
 +<code bash>
 +sudo usermod -aG docker $USER
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  This allows docker to be run without using sudo.
 +
 +To enable this functionality, log out and log back in; or run: <code bash>
 +newgrp docker
 +</code>
 +
 +</WRAP>
 +
 +----
 +
 +===== Verify that you can run docker commands without sudo =====
 +
 +<code bash>
 +docker run hello-world
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  If an error is seen such as **docker: Got permission denied while trying to connect to the Docker daemon socket**, then:
 +
 +<code bash>
 +sudo chmod 666 /var/run/docker.sock
 +</code>
 +
 +</WRAP>
 +
 +
 +----
 +
 +===== Start Docker =====
 +
 +<code bash>
 +systemctl start docker
 +</code>
 +
 +----
 +
 +===== Enable docker to run at system boot =====
 +
 +<code bash>
 +systemctl enable docker
 +</code>
 +
 +----
 +
 +===== Check the docker version =====
 +
 +<code bash>
 +docker version
 +</code>
 +
 +Show the currently installed Docker version.
 +
 +----
 +
 +<WRAP info>
 +**NOTE:**  docker is now installed.
 +
 +  * A container can now be started by downloading a Docker Image from the Docker Registry.
 +
 +</WRAP>
  
docker/install_docker.1476402997.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki