Update Node-RED on Azure Ubuntu VM by CLI

Goal: upgrade Node-RED

I am running Docker Version 26.0.0 on Azure VM Ubuntu 22.04.
I communicate with this VM using SSH session to command line interface.
I run Node-RED on this VM and have opened port 1880 on this VM.

I had a Node-RED version 2.xx running on this Docker with IMAGE name iot-app-nodered.
I was able to see this Node-RED (running on Azure VM) on my browser (running on my Win10 desktop) at port 1880.
I want to install a more recent version of Node-RED.
I pulled a new version using “sudo docker pull nodered/node-red”
I now see images iot-app-nodered and nodered/node-red in response to “sudo docker images -a”.

I stopped iot-app-nodered using “sudo docker stop c5f829c8803f”.

I ran nodered/node-red using “sudo docker run -d nodered/node-red”
I see new nodered/node-red in the “sudo docker ps” response but NOT the old iot-app-nodered.
The new nodered/node-red is running
Problem: My browser running on my desk top Win10 does NOT display the Node-RED GUI at port 1880.

I stop the new nodered/node-red.
I run the old iot-app-nodered using “udo docker run -d iot-app-nodered”
I see iot-app-nodered in the “sudo docker ps” response but NOT the new nodered/node-red.
The old iot-app-nodered is running.
Problem: My browser running on my desktop Win10 does NOT display the Node-RED GUI at port 1880 as it did previously.

What did I break?

Maybe I misunderstand something as I don’t use Node-RED and I reply to many questions quickly, but you ran the new container without port mapping. Isn’t that the container which you want to access on port 1880?

Yes, Node-RED communicates on port 1880. I opened this port on my VM.
When I started Node-RED I assumed that Node-RED would do the connection to port 1880 on its own somehow.

I see there is a Docker run command with snytax

docker run -p [OUTSIDE_PORT]:[INSIDE/CONTINER_PORT] [IMAGE_NAME:TAG/IMAGE_ID]

but I thought that this would find use in mapping one port to another… for example if I wanted Node-RED to communicate on port 2000 then

docker run -p 2000:1880 nodered/node-red

I guess I must explicitly specify the port when starting Node-RED.
A web search brings back

Running under Docker : Node-RED

I follow the suggestion at this link. Here is the command I used:

sudo docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red

So, as you suggested, I mapped port 1880 to VM port 1880 explicitly.
It works! I now see Node-RED in my browser at port 1880

Thanks for the advice!
Mike