Incoming connections
Enabling incoming connections allows you to access your Deepnote cloud machine from the web. You can use this to connect to popular tools such as Tensorboard or Streamlit, which depend on using a local webserver to access their interfaces (they often prompt you to open an address like http://localhost:8080 in your browser to start using them).
When you enable incoming connections, Deepnote exposes port 8080 on the internet under an address such as b9d13315-f12a-4931-857c-ed6b4c59dcad.deepnoteproject.com. You can use this address to access services running on the port 8080 on your Deepnote machine.
Enabling incoming connections means that anyone on the internet will be able to access port 8080 on your machine.
Tunneling setting is located in the Environment sidebar
1
# Example http connection you can paste into your cell
2
!python -m http.server 8080
Copied!

What if I need to expose a different port?

Right now we only support exposing port 8080. To expose other ports, you can either reconfigure your tool, or use utilities like socat which can forward traffic from port 8080 to the port your choosing. You can use the example below to set up port forwarding with socat in the terminal:
1
apt update && apt install socat
2
socat tcp-l:8080,fork,reuseaddr tcp:127.0.0.1:YOUR_PORT
Copied!

Running Flask

You can also use Deepnote to prototype a simple Flask server. When using its development server, don't forget to set the host to reach it from outside the local machine.
Example:
1
from flask import Flask
2
​
3
app = Flask(__name__)
4
​
5
@app.route("/")
6
def hello_world():
7
return "<p>Hello, World!</p>"
8
​
9
app.run(host='0.0.0.0', port=8080)
Copied!
Last modified 3mo ago