

Authored by Ryan Kelly, Staff Systems Engineer, Cloud Management
So you want to connect to the Docker instance on Photon OS remotly from another Docker client? In this guide I will walk you through a few short steps to configure Photon OS to enable the remote docker API. NOTE: This is not considered the secure method. If you want to use encryption and secure connections I will have a follow up post on that soon.
Login to your Photon OS using SSH or open the console and type the following and press enter

1 |
systemctl stop docker |

1 |
vi /etc/default/docker |
Press i on the keyboard then enter the following, when done press the ESC key then hold Shift and press the Z key twice

1 |
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock" |
Since Photon OS uses IP tables we need to open that port, type the following and press enter

1 |
iptables -A INPUT -p tcp --dport 2375 -j ACCEPT |
Now start docker with the following command and press enter

1 |
systemctl start docker |
To test that it worked, open a web browser to the Photon OS at http://ipaddress:2375/info and you should see the following.

Enjoy!
Priyesh Padmavilasom
iptables -A INPUT -p tcp –dport 2375 -j ACCEPT
Please note that this wont persist on restarts. If you need this to persist, please add the same to /etc/systemd/scripts/iptables