« Back to home

Enable docker API on raspberry (debian)

This is a note to myself so I don't forget how to enable the docker API on a raspberry.

Simple but insecure. Create a docker.service file using:
sudo nano /etc/systemd/system/docker.service

With the following content:

ExecStart=/usr/bin/dockerd -H=tcp:// -H=fd://  

Then reload the config
sudo systemctl daemon-reload

And restart the docker
sudo systemctl restart docker

For security use port 2376 instead of 2375. It also requires you to generate a certificate. See Protect the Docker daemon socket.