How to connect to docker on Azure VM? How to connect to docker on Azure VM? azure azure

How to connect to docker on Azure VM?


As Chun-Yen Wang said, you should add the port exposed to Azure NSG.
For example, I expose docker on port 5000, add inbound rules via Azure portal like this:

enter image description here

After that you can use Azure VM's public IP address to access it, you can find your public IP address here:

enter image description here

curl http://52.168.28.103:5000

Hope that helps.


The docker containers on Azure VM can be accessed via the public IP address of the host VM, and the port exposed:

  1. Public IP: there should be one when the VM is created.
  2. Port: whatever ports the docker container exposes, they need to be opened for web traffic, just like Create a Linux virtual machine with the Azure portal, section "Open port 80 for web traffic".


Assuming your host/remote machine is running Linux - If you want to access the container (running on a remote server) directly from local machine you should first install SSH Server in the container and map the 22 port of container to a port on host. And then open that host port and protocol TCP (to let SSH) for inbound traffic on NSG in Azure portal (as told by Chun/Jason)