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 192.168.1.100. Docker is running on the ubuntu server.

  • How to have login and access settings with a docker image registry
  • Running Chromium inside Docker - Gtk: cannot open display: :0
  • Pycharm not showing all files from django external library
  • Docker container stuck after enter in container
  • docker mongodb replication on same server
  • Docker compose and concurrent integration testing
  • 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 192.168.1.100:8888.

    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

  • How do I build a Docker image for a Ruby project without build tools?
  • ERROR: The Docker Engine version is less than the minimum required by Compose
  • Console prints not appearing when using Docker in Ruby on Rails
  • Is it possible/sane to develop within a container Docker
  • Docker : How are intermediate containers formed
  • Docker and Neo4J
  • 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
    destination-port: 192.168.1.100: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.