Debian9 Docker17 CE - ewsdocker/ewsdocker.github.io GitHub Wiki

Installing Docker-CE on Debian 9

Perform the following steps:

1. Login as root

    Or su, or sudo -s, or use sudo before restricted commands.

2. Install additional utilities:

apt-get install apt-transport-https ca-certificates curl gnupg2 wget software-properties-common gdebi firewalld  

3. Start and configure firewall.

Check firewall status

systemctl status firewall

If the firewall is not running, enable and start firewalld

systemctl enable firewalld.service
systemctl start firewalld.service  

Open docker-ce ports.

firewall-cmd --zone=public --permanent --add-port=1000/tcp  
firewall-cmd --zone=public --permanent --add-port=2375/tcp  
firewall-cmd --zone=public --permanent --add-port=2376/tcp  
firewall-cmd --reload  

4. Create the docker group (this step might not be necessary on newer releases of Docker-CE):

groupadd docker  

5. Add users to the docker group:

usermod -aG docker <user>  

6. Install docker-ce package:

  • The latest stable version of Docker-CE is available from Docker Stable Downloads. Select the processor type (e.g. - amd64), place the mouse over the selected package, right click and select the copy link function;

  • Install the latest stable version (replace _link-url_ with the link copied from the above step):
wget link-url  
gdebi docker-ce*.deb  

Example:

    The url for the newest package at the time of this writing is
https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_17.12~ce-0~debian_amd64.deb  
    Using the url above, the following commands will download and install the selected docker-ce package:
wget https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_17.12~ce-0~debian_amd64.deb
gdebi docker-ce*.deb

7. Check proper installation:

docker run --rm --name=hello hello-world

8. Enable and start the docker service:

systemctl enable docker.service  
systemctl start docker.service  

9. Reboot to install changes and automatically start the dockerd daemon.

reboot  

Docker should be available to run without root/sudo by any user added to the docker group.

If docker fails to start, check that docker.service is running

systemctl status docker.service  

If it is not running, repeat steps 8 and 9 at least once - sometimes, the first reboot of Debian does not always enable the service.

10. Cleanup

rm *.deb  
docker rmi hello-world  

Docker-Compose

1. Install docker-compose

Goto the docker-compose releases page (https://github.com/docker/compose/releases/) and select the newest release. Download and install docker-compose

curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose  
chmod +x /usr/local/bin/docker-compose  

2. Test installation:

docker-compose --version  



Resources


Installing Docker-CE for Debian
Get Docker CE for Debian  at   Docker Docs
How-to Install Docker Engine on Diabian 9 Strecth Linux  at   Linux Config
Docker Community Edition for Debian  at   Docker Docs
Post Installation Steps for Linux  at   Docker Docs
Blowb – 3.2. Install Docker  at   Blowb Docs

Installing Docker Compose for Debian
Install Docker Compose  at   Docker Docs
How to install docker-compose on Debian 9 (Stretch)  at   How To Install

DNS Masq and Overriding Docker DNS Servers
Blowb – 3.3. Set up Dnsmasq  at   Blowb Docs
Overriding Docker DNS Servers  at   The Codeface

Home  <==  BACK      |      NEXT  ==> Debian9-Docker17-UserNs

⚠️ **GitHub.com Fallback** ⚠️