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.

  • Docker and uPnP
  • Why would I need Docker for nodejs?
  • Ping docker containers on different hosts with ip addresses
  • AWS UDP High Availability
  • Use Xcode with Docker (cross-compiling)
  • How to build a docker container with nix?
  • 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

  • Configuring hazelcast on a docker overlay network
  • Windows containers causes Azure SQL connections to fail
  • Docker-compose , anyway to specify a redis.conf file?
  • Django : Getting error while removing django.contrib.sites from INSTALLED_APPS
  • Odd behaviour of dnsmasq across docker containers
  • boot2docker / docker “Error. image library/.:latest not found”
  • 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.