> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/marimo-team/marimo/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with marimo in minutes - from installation to your first interactive notebook

# Quickstart

Get up and running with marimo in minutes. This guide walks you through installation, creating your first notebook, and exploring marimo's core features.

## Installation

Install marimo using pip or conda:

<CodeGroup>
  ```bash pip theme={null}
  pip install marimo
  ```

  ```bash conda theme={null}
  conda install -c conda-forge marimo
  ```

  ```bash recommended theme={null}
  # Install with recommended optional dependencies
  pip install "marimo[recommended]"
  ```
</CodeGroup>

<Tip>
  The `recommended` extras include SQL support, AI completion, formatting tools, and more features that enhance your experience.
</Tip>

## Your first notebook

<Steps>
  <Step title="Run the interactive tutorial">
    The fastest way to learn marimo is through the built-in tutorial:

    ```bash theme={null}
    marimo tutorial intro
    ```

    This launches an interactive notebook that teaches you marimo's core concepts.
  </Step>

  <Step title="Create a new notebook">
    Start a new notebook with the `edit` command:

    ```bash theme={null}
    marimo edit
    ```

    This opens marimo in your browser with an empty notebook.
  </Step>

  <Step title="Add your first cell">
    Click the "+ Code" button to add a cell, then write some Python:

    ```python theme={null}
    import marimo as mo

    slider = mo.ui.slider(1, 100, value=50)
    slider
    ```

    When you run this cell (Ctrl+Enter or Cmd+Enter), you'll see an interactive slider.
  </Step>

  <Step title="Create a reactive cell">
    Add another cell that uses the slider value:

    ```python theme={null}
    import numpy as np
    import matplotlib.pyplot as plt

    x = np.linspace(0, 2 * np.pi, slider.value)
    y = np.sin(x)

    plt.plot(x, y)
    plt.title(f"Sine wave with {slider.value} points")
    plt.gcf()
    ```

    Move the slider and watch the plot update automatically - that's reactivity!
  </Step>

  <Step title="Save your notebook">
    Save your notebook with Ctrl+S (or Cmd+S). You'll be prompted for a filename. marimo saves it as a `.py` file:

    ```bash theme={null}
    # Your notebook is now saved as a Python file
    marimo edit my_notebook.py
    ```
  </Step>
</Steps>

## Core workflows

### Creating notebooks

Create or edit notebooks with the `edit` command:

```bash theme={null}
# Start a new notebook
marimo edit

# Edit an existing notebook
marimo edit notebook.py

# Edit with a specific port
marimo edit notebook.py --port 3000
```

### Running as apps

Deploy your notebook as a web app where code is hidden and non-editable:

```bash theme={null}
marimo run notebook.py
```

This is perfect for:

* Sharing interactive dashboards with colleagues
* Creating internal tools
* Publishing data stories
* Building demos and prototypes

<Note>
  In app mode, users can interact with UI elements but cannot edit the code. The notebook remains fully reactive.
</Note>

### Executing as scripts

Run notebooks as command-line scripts:

```bash theme={null}
python notebook.py
```

You can pass arguments:

```python theme={null}
import marimo as mo

# Access CLI arguments in your notebook
args = mo.cli_args()
print(args)
```

```bash theme={null}
python notebook.py --arg1 value1 --arg2 value2
```

### Exploring tutorials

marimo includes several built-in tutorials:

```bash theme={null}
# List all available tutorials
marimo tutorial --help

# Run specific tutorials
marimo tutorial intro      # Introduction to marimo
marimo tutorial dataflow   # How reactivity works
marimo tutorial ui         # Interactive UI elements
marimo tutorial plots      # Data visualization
marimo tutorial sql        # SQL cells
marimo tutorial markdown   # Dynamic markdown
```

## Essential features

### Interactive UI elements

marimo provides 40+ UI components that automatically trigger cell re-execution:

<CodeGroup>
  ```python Slider theme={null}
  import marimo as mo

  slider = mo.ui.slider(1, 100, value=50, label="Sample size")
  slider
  ```

  ```python Dropdown theme={null}
  import marimo as mo

  dropdown = mo.ui.dropdown(
      options=["linear", "polynomial", "exponential"],
      value="linear",
      label="Model type"
  )
  dropdown
  ```

  ```python Table theme={null}
  import marimo as mo
  import pandas as pd

  df = pd.DataFrame({
      "name": ["Alice", "Bob", "Charlie"],
      "age": [25, 30, 35]
  })

  table = mo.ui.table(df)
  table
  ```
</CodeGroup>

Access values with `.value`:

```python theme={null}
mo.md(f"Selected {slider.value} samples using {dropdown.value} model")
```

### Dynamic markdown

Create markdown that updates with your data:

```python theme={null}
import marimo as mo

name = "marimo"
count = 42

mo.md(f"""
# Welcome to {name}!

You have processed **{count}** records.

{"🎉" * min(count, 10)}
""")
```

### SQL cells

Query data with native SQL support:

```python theme={null}
import marimo as mo
import pandas as pd

df = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
```

```sql theme={null}
SELECT * FROM df WHERE x > 1
```

The SQL cell creates a dataframe you can use in Python cells.

### Layouts

Organize outputs with flexible layouts:

<CodeGroup>
  ```python Horizontal stack theme={null}
  import marimo as mo

  mo.hstack([plot1, plot2, plot3])
  ```

  ```python Vertical stack theme={null}
  import marimo as mo

  mo.vstack([header, content, footer])
  ```

  ```python Tabs theme={null}
  import marimo as mo

  mo.ui.tabs({
      "Data": data_table,
      "Visualization": chart,
      "Analysis": results
  })
  ```
</CodeGroup>

## Converting from Jupyter

Convert existing Jupyter notebooks to marimo:

```bash theme={null}
# Convert to marimo format
marimo convert notebook.ipynb > notebook.py

# Edit the converted notebook
marimo edit notebook.py
```

<Warning>
  Automatic conversion works well for simple notebooks, but you may need to refactor cells that have hidden state or out-of-order execution dependencies.
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Key concepts" icon="book" href="/key-concepts">
    Learn about reactivity, cells, and the marimo execution model
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Explore advanced installation options and optional dependencies
  </Card>
</CardGroup>

## Getting help

* Browse the [examples gallery](https://marimo.io/gallery) for inspiration
* Join the [Discord community](https://marimo.io/discord) for support
* Check the [FAQ](https://docs.marimo.io/faq.html) for common questions
* Watch [YouTube tutorials](https://www.youtube.com/@marimo-team) for video guides
