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

# Quickstart

> Run your first self-hosted browser session

## Get started in three steps

### Step 1: Start Rusty Browser

<AccordionGroup>
  <Accordion icon="server" title="Run the server">
    Follow the [Self-Hosting guide](/open-source/self-hosting) to start `rusty-server`, Redis, Flux, and the browser agent on your machine or infrastructure.
  </Accordion>

  <Accordion icon="terminal" title="Set the API URL">
    Point examples and tools at your local server:

    ```bash theme={null}
    export RUSTY_BROWSER_URL="http://localhost:8080"
    ```

    Or in your `.env` file:

    ```
    RUSTY_BROWSER_URL=http://localhost:8080
    ```
  </Accordion>
</AccordionGroup>

### Step 2: Create a browser

All browser activity starts with a browser. Create one with a single request:

<AccordionGroup>
  <Accordion icon="terminal" title="Using cURL">
    ```bash theme={null}
    curl -X PUT "$RUSTY_BROWSER_URL/browsers/"
    ```
  </Accordion>

  <Accordion icon="js" title="Using JavaScript">
    ```javascript theme={null}
    const apiUrl = process.env.RUSTY_BROWSER_URL || 'http://localhost:8080';
    const response = await fetch(`${apiUrl}/browsers/`, { method: 'PUT' });

    const { execution_id: browserId } = await response.json();
    console.log('browser ID:', browserId);
    ```
  </Accordion>

  <Accordion icon="python" title="Using Python">
    ```python theme={null}
    import requests

    response = requests.put('http://localhost:8080/browsers/')

    browser_id = response.json()['execution_id']
    print('Browser ID:', browser_id)
    ```
  </Accordion>
</AccordionGroup>

<Note>
  Use the returned `execution_id` wherever the examples below show `{id}`.
</Note>

### Step 3: Control the browser

With a browser ID, you can navigate, interact, and extract data:

<AccordionGroup>
  <Accordion icon="terminal" title="Navigate to a URL">
    ```bash theme={null}
    curl -X POST "$RUSTY_BROWSER_URL/browsers/{id}/navigate/" \
      -H "Content-Type: application/json" \
      -d '{ "url": "https://example.com" }'
    ```
  </Accordion>

  <Accordion icon="terminal" title="Fetch page text">
    ```bash theme={null}
    curl -X POST "$RUSTY_BROWSER_URL/browsers/{id}/fetch-text/" \
      -H "Content-Type: application/json" \
      -d '{ "node_id": 1 }'
    ```
  </Accordion>

  <Accordion icon="terminal" title="Take a screenshot">
    ```bash theme={null}
    curl -X POST "$RUSTY_BROWSER_URL/browsers/{id}/screenshot/"
    ```
  </Accordion>

  <Accordion icon="terminal" title="Use AI to instruct the browser">
    ```bash theme={null}
    curl -X POST "$RUSTY_BROWSER_URL/browsers/{id}/instruct/" \
      -H "Content-Type: application/json" \
      -d '{ "instruction": "Click the sign in button and fill in the login form" }'
    ```
  </Accordion>
</AccordionGroup>

### Step 4: Close the browser

Always close browsers when you're done so the agent process and browser resources are released:

```bash theme={null}
curl -X DELETE "$RUSTY_BROWSER_URL/browsers/{id}/"
```

<Warning>
  Idle browsers still consume CPU, memory, and browser agent capacity. Close them when finished.
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Self-Hosting" icon="server" href="/open-source/self-hosting">
    Configure Rusty Browser for local or production use
  </Card>

  <Card title="Browsers" icon="browser" href="/concepts/sessions">
    Browser lifecycle and best practices
  </Card>

  <Card title="All Commands" icon="terminal" href="/api-reference/introduction">
    Navigate, click, type, scroll, screenshot, and more
  </Card>

  <Card title="AI Instructions" icon="wand-magic-sparkles" href="/api-reference/endpoints/commands/instruct">
    Drive the browser with natural language
  </Card>
</CardGroup>
