Docker supports TLS certificates which help in securing your server-node connection. So basically you generate a certificate and a private key and get it signed for a secure connection between the server and the clients.
Generate the key with the following commands:
$ sudo mkdir -p /etc/docker/ssl
$ mkdir -p ~/.docker
$ openssl genrsa -out ~/.docker/serverkey.pem 2048
$ openssl req -new -x509 -days 365 \
-key serverkey.pem \