Getting Started

Every notebook server has their own port forwarding URL that you can find by running echo $PORT_FORWARD_URL in your terminal. You can use this to deploy and run apps directly in your notebook and securely share them immediately on a public URL. Here’s an example you can run in a notebook that launches a gradio server on localhost:5000 in your notebook server.

python
import gradio as gr

def greet(name, intensity):
    return "Hello, " + name + "!" * int(intensity)

demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"],
    outputs=["text"],
)

demo.launch(server_port=5000)

!echo $PORT_FORWARD_URL