This issue is common when attempting to run interactive dashboards (such as Vizro or Plotly Dash) within Databricks notebooks; many users face the "This site can't be reached" message because the dashboard tries to launch a local web server on an address like http://127.0.0.1:8050/โwhich works on a local machine but is not accessible from a Databricks cloud notebook environment.โ
Why This Happens
-
Cloud-managed notebook environments (Databricks, Azure Databricks, AWS SageMaker, etc.) run code on remote servers and do not expose localhost (127.0.0.1) web servers to your browser. When a dashboard is launched, its web server starts inside the cluster or notebook container, but connections to localhost only work if both server and browser are on the same machineโwhich is not the case with Databricks.โ
-
Even for frameworks designed with remote-first architectures (e.g., Dash), special configuration or enterprise solutions are required to expose the dashboard port via a secure proxy.โ
Workarounds and Solutions
-
Direct Databricks Visualization: Use Databricks' built-in visualization features (display(pandas_dataframe)) and design dashboards within Databricks itself instead of custom Python dashboards, if possible.โ
-
Proxying Solutions: In some enterprise setups, Dashboards can be exposed using Databricks' driver-port proxy URL formats, such as /l/driver-proxy/o/0/cluster-id/port. However, changes in Databricks environment/API can break these proxy routes, so you may need to consult your platform administrator or documentation for up-to-date methods.โ
-
Deploy Externally: Consider deploying the Vizro dashboard to an external service such as Hugging Face, Ploomber Cloud, Dash Enterprise, or on your own VM/server, and then access it via a public URL. This is the best way to ensure robust dashboard delivery in production settings.โ
-
Check Networking & DNS: Ensure your cluster's DNS settings and internal network allow dashboard traffic, though in most managed environments, exposing arbitrary dashboard ports is restricted by design for security.โ
Recommendations
-
For reliable, shareable dashboards, deploy Vizro or Dash apps to an external hosting provider rather than inside Databricks.โ
-
Consult Databricks and Vizro documentation for official guidance and supported deployment patternsโDatabricks visualizations are designed to work "natively" within its environment, while custom Python web servers are not directly or easily exposed to browser users.
-
If you still need a workaround and have an enterprise setup, request your IT/platform admin about proxying options or enabling driver proxy URLs for dashboard access.โ
This is a known limitation of cloud notebook environments; in summary, deploying Vizro dashboards in Databricks notebooks is not natively supported for interactive web dashboards, and you need to use alternative methods for public dashboard sharing or use Databricks's built-in visualization capabilities.โ