Installing Rancher 2.0 on Ubuntu 18.04

# currently Rancher 2.0 does not support latest docker, we use the xenial targeted packages
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") xenial stable"
apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
apt-mark hold docker-ce
nano /lib/systemd/system/docker.service
    [Service]
    EnvironmentFile=-/etc/default/docker
    ExecStart=/usr/bin/dockerd $DOCKER_OPTS -H fd://
nano /etc/default/docker
    DOCKER_OPTS="--iptables=false --dns 1.1.1.1 --dns 1.0.0.1 --dns 8.8.8.8 --dns 8.8.4.4"
systemctl daemon-reload
systemctl restart docker
 
# copy certificates to /etc/ssl/private
export CERT_DOMAIN_FILENAME=example.org
docker run -d --name rancher --restart=unless-stopped -p 443:443 -v /etc/ssl/private/${CERT_DOMAIN_FILENAME}.crt:/etc/rancher/ssl/cert.pem -v /etc/ssl/private/${CERT_DOMAIN_FILENAME}.key:/etc/rancher/ssl/key.pem -v /srv/rancher:/var/lib/rancher rancher/rancher:latest