Skip to main content

marimo run

Run one or more marimo notebooks as read-only web applications. Perfect for sharing interactive dashboards and apps.

Usage

Arguments

NAME - Path to notebook file(s) or directory(ies) to run (required)
  • Can specify multiple files or directories
  • If a directory is provided, all marimo notebooks in it will be available
  • Supports URLs for remote notebooks
  • When multiple paths are provided, creates a gallery view
ARGS - Arguments to pass to the notebook (after --)
  • All arguments after -- are passed to the notebook’s sys.argv

Options

Server Configuration

-p, —port PORT - Port to attach to
  • Type: Integer
  • Default: Auto-assigned
—host HOST - Host to attach to
  • Type: String
  • Default: 127.0.0.1
—proxy PROXY - Address of reverse proxy
  • Type: String
—base-url URL - Base URL for the server (should start with /)
  • Type: String
  • Default: ""

Browser & UI

—headless - Don’t launch a browser
  • Type: Flag
  • Default: False
—include-code - Include notebook code in the app
  • Type: Flag
  • Default: False
  • When enabled, users can view the source code

Authentication

—token / —no-token - Use token for authentication
  • Type: Flag
  • Default: False
—token-password PASSWORD - Use a specific token for authentication
  • Type: String
—token-password-file FILE - Path to file containing token password, or - for stdin
  • Type: String

Security & CORS

—allow-origins ORIGIN - Allowed origins for CORS
  • Type: String (can be repeated)
—trusted / —untrusted - Run notebooks hosted remotely
  • If --untrusted, runs marimo in a Docker container

Development Features

—watch - Watch files for changes and reload the app
  • Type: Flag
  • Default: False
  • Uses watchdog if installed, otherwise polls every 1 second
—skew-protection / —no-skew-protection - Enable skew protection middleware
  • Type: Flag
  • Default: True

Console & Debugging

—redirect-console-to-browser - Redirect console logs to browser console
  • Type: Flag
  • Default: False

Validation

—check / —no-check - Perform static check of notebook before running
  • Type: Flag
  • Default: True
  • Validates notebook for errors before starting

Sandbox & Isolation

—sandbox / —no-sandbox - Run in an isolated virtual environment
  • Type: Flag
  • For multiple files/directories, uses IPC kernels with per-notebook sandboxed environments
  • Requires uv and pyzmq

Session Management

—session-ttl SECONDS - Seconds to wait before closing a session on websocket disconnect
  • Type: Integer
  • Default: 120

Examples

Basic Usage

Custom Server Configuration

Including Code

Authentication

Development Workflow

Remote Notebooks

Passing Arguments to Notebook

Access arguments in your notebook:

Sandbox Mode

Production Deployment

CORS Configuration

Console Output

Tips

  • Use --watch during development to see changes immediately
  • Enable --include-code for educational or open-source apps
  • Use --sandbox for untrusted notebooks or to isolate dependencies
  • For production, combine --headless, --host 0.0.0.0, and --token
  • Gallery mode is great for creating dashboards or app collections