Docker is an application that allows for deployment of software within virtual containers. It was written in the Go programming language. In this tutorial, you’ll learn how to install Docker CE on Debian 9.<\/p>\n
Docker CE is the “Community Edition”, which is suitable for developers and small teams.<\/p>\n
1GB of RAM is the minimum requirement, though I recommend using at least 2GB of RAM.<\/p>\n
Connect to your server using SSH via the Terminal on Mac or PuTTY on Windows.<\/p>\n
ssh root@203.1.113.1\r\n<\/code><\/pre>\nReplace “203.1.113.1<\/code>” with your server IP.<\/p>\nYou will be prompted to type “Yes<\/code>” or “No<\/code>” to add the server’s RSA fingerprint to your list of known hosts. Type “Yes<\/code>” and hit “Enter<\/code>“.<\/p>\nNow you are connected as\u00a0root<\/code>, so you don’t need to use\u00a0sudo<\/code>. If you connect as a user you will need\u00a0sudo<\/code>\u00a0to perform most of the actions.<\/p>\nOn a fresh machine, as root, update\u00a0apt<\/code>.<\/p>\napt-get update\r\n<\/code><\/pre>\nInstall packages to allow apt to use a repository over\u00a0HTTPS<\/code>.<\/p>\napt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y\r\n<\/code><\/pre>\nAdd Docker\u2019s official GPG key.<\/p>\n
curl -fsSL https:\/\/download.docker.com\/linux\/$(. \/etc\/os-release; echo \"$ID\")\/gpg | sudo apt-key add -\r\n<\/code><\/pre>\nVerify that key fingerprint is equal to:\u00a09DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88<\/code>.<\/p>\napt-key fingerprint 0EBFCD88\r\n<\/code><\/pre>\nUse the following command to set up the stable repository.<\/p>\n
add-apt-repository \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/$(. \/etc\/os-release; echo \"$ID\") $(lsb_release -cs) stable\"\r\n<\/code><\/pre>\nUpdate\u00a0apt<\/code>\u00a0again.<\/p>\napt-get update\r\n<\/code><\/pre>\nInstall Docker.<\/p>\n
apt-get install docker-ce -y\r\n<\/code><\/pre>\nCreate a user<\/h3>\n
If you don’t want to run Docker as the root user, create a non-root user.<\/p>\n
adduser foo\r\n<\/code><\/pre>\nThen, add this user to the Docker group.<\/p>\n
usermod -aG docker foo\r\n<\/code><\/pre>\nNow restart the Docker service.<\/p>\n
service docker restart\r\n<\/code><\/pre>\nVerify that Docker CE is installed correctly by running the\u00a0hello-world<\/code>\u00a0image.<\/p>\ndocker run hello-world\r\n<\/code><\/pre>\nThis command downloads a test image and runs it in a container. When the container runs, it prints a message like this one and exits.<\/p>\n
Unable to find image 'hello-world:latest' locally\r\nlatest: Pulling from library\/hello-world\r\n9a0669468bf7: Pull complete \r\nDigest: sha256:cf2f6d004a59f7c18ec89df311cf0f6a1c714ec924eebcbfdd759a669b90e711\r\nStatus: Downloaded newer image for hello-world:latest\r\n\r\nHello from Docker!\r\nThis message shows that your installation appears to be working correctly.\r\n\r\nTo generate this message, Docker took the following steps:\r\n 1. The Docker client contacted the Docker daemon.\r\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\r\n 3. The Docker daemon created a new container from that image which runs the\r\n executable that produces the output you are currently reading.\r\n 4. The Docker daemon streamed that output to the Docker client, which sent it\r\n to your terminal.\r\n\r\nTo try something more ambitious, you can run an Ubuntu container with:\r\n $ docker run -it ubuntu bash\r\n\r\nShare images, automate workflows, and more with a free Docker ID:\r\n https:\/\/cloud.docker.com\/\r\n\r\nFor more examples and ideas, visit:\r\n https:\/\/docs.docker.com\/engine\/userguide\/<\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[233,242,245],"manual_kb_tag":[447],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2895"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2895"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2895\/revisions"}],"predecessor-version":[{"id":2896,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2895\/revisions\/2896"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2895"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2895"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}