Skip to main content

Deploy as Interactive App

Deploy your marimo notebooks as read-only web applications that users can interact with. When running as an app, notebooks are presented in a clean interface optimized for end-users, with optional code visibility and built-in authentication.

Running as an App

Use marimo run to launch your notebook as an interactive web application:
The app will be available at http://localhost:2718 by default (or your specified port).

App Mode Features

Read-Only Interface

In app mode, users can:
  • Interact with UI elements (sliders, dropdowns, buttons, etc.)
  • View outputs and visualizations that update reactively
  • Navigate between cells and sections
  • Download outputs and data when enabled
Users cannot:
  • Edit or add cells
  • Modify code
  • Access the notebook source (unless --include-code is used)

Code Visibility

By default, code is hidden in app mode. Control code visibility with the --include-code flag:
You can also hide code for specific cells using the cell decorator:

Live Reload

Enable automatic reload when notebook files change:
With --watch, the app automatically refreshes when you save changes to the notebook file. Great for development!

Authentication and Access Control

Token Authentication

Protect your app with password authentication:
With --token, marimo generates a random password and displays it in the terminal. The app URL will include an access token for convenience.

Authentication Methods

Users can authenticate in three ways:
  1. Login Page: Browser users are redirected to a login page
  2. Query Parameter: http://localhost:2718?access_token=your-password
  3. HTTP Basic Auth: For programmatic access

Custom Authentication

For production deployments, implement custom authentication using ASGI middleware:
See the Authentication Guide for detailed examples.

Configuration Options

Network Configuration

1

Host and Port

Specify where the app listens:
2

Reverse Proxy

Configure for deployment behind a proxy:
3

Base URL

Mount app at a subpath:
4

CORS

Allow specific origins:

Session Management

The default session TTL is 120 seconds. Sessions are closed after this duration of inactivity. Set a longer TTL for apps with long-running computations.

Advanced Options

Serve multiple notebooks from a single server:
When running multiple notebooks, marimo creates a gallery index page where users can select which notebook to view.

Command-Line Arguments

Pass arguments to your notebook at runtime:
Access arguments in your notebook:

Health and Status Endpoints

monitor your deployed app:
These endpoints are useful for:
  • Load balancer health checks
  • Monitoring and alerting
  • Automated deployment verification

Best Practices

For Production Deployments:
  1. Use authentication with --token-password or custom ASGI middleware
  2. Set appropriate session TTL based on your use case
  3. Configure CORS to allow only trusted origins
  4. Use environment variables for sensitive configuration
  5. Enable health checks for monitoring
  6. Run behind a reverse proxy (nginx, Caddy) for SSL/TLS
  7. Use --headless to prevent browser launch on server

Examples

Public Dashboard

Internal Tool with Auth

Development Server

Next Steps

Deploy to Platforms

Deploy your app to cloud platforms and services

Run as Script

Execute notebooks as Python scripts

WASM Deployment

Deploy browser-based notebooks with WebAssembly

Authentication

Advanced authentication and security