How to remote access(from out net) to jupyter notebook running on docker on ubuntu server

can anyone help to answer my question below:

I have a ubuntu server behind the router, the ubuntu server ip is static assigned by me as Docker is running on the ubuntu server.

  • How to map ports with - Express + Docker + Azure
  • Messed up Docker environment
  • Docker for Windows: cannot assign requested address
  • SSH connection to my container closed by remote host
  • What does it take to get the splunk logger running with docker-compose?
  • Nginx service on Docker giving better performance on 1GB RAM Node than 4GB RAM Node
  • I have set up port forwarding of the route so that I can remote ssh access to the ubuntu server. I have tested from another computer behind the router and I can successfully access the jupyter notebook on the docker by

    However, when I tried to access from a computer outside the router, I failed to access the jupyter notebook. May I ask what IP shall I use or how can I access from the outside?

    Thanks.enter image description here

  • ADD and COPY to merge the contents of a dir with the one already on the build
  • Can't add a shell build step with docker on containerized Jenkins
  • How to demonize one image of a docker-compose composition?
  • Binaries from postgresql not available when linked to another docker container
  • How to pass docker options --mac-address, -v etc in kubernetes?
  • Where pulled images of docker are stored in Windows?
  • One Solution collect form web for “How to remote access(from out net) to jupyter notebook running on docker on ubuntu server”

    The easiest and safest way would probably be to create an SSH-tunnel – that way you don’t have to expose your Jupyter server to the public internet.

    In Putty, under the tab Connection -> SSH -> Tunnels, enter the following:

    source-port: 8888

    Click add and then start the session like normal. Now your client machine’s port 8888 will be tunneled to the server’s port 8888. You can check if that works by running nc -l -p 8888 on the server and entering http://localhost:8888 in your client’s browser. The request should then show up on the server.

    In order to get this to work with Jupyter instead of netcat, you might need to set some options, as Jupyter is very picky when it comes to non-local connections:

    # Allow connections to come from anywhere
    c.NotebookApp.allow_origin = '*'
    # Allow connections to refer to the server however they want to
    c.NotebookApp.ip = '*'

    You should also make sure you have some sort of access control enabled in Jupyter, as otherwise anyone with access to your client’s port 8888 will have access to Jupyter.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.