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

# Customize an outpost

> Customize the project code and tools available to every new Devin session.

The generated application includes an image block for the workspace Devin sees in a
new session. Customize that block with the normal
[`modal.Image` API](https://modal.com/docs/guide/images).

## Before you begin

You need a deployed `modal-devin` application from
[Create an outpost](/tutorials/create-an-outpost).

<Steps>
  <Step title="Open the generated outpost file">
    Find this block in `outposts/my_outpost.py`:

    ```python theme={null}
    base_image = (
        worker.base_image()
        # Add every application-specific build step here.
    )

    image = worker.prepare_image(base_image)
    ```
  </Step>

  <Step title="Install workspace tools">
    Add packages before `prepare_image()`:

    ```python theme={null}
    base_image = (
        worker.base_image()
        .apt_install("ripgrep", "jq")
        .pip_install("pytest", "ruff")
    )
    image = worker.prepare_image(base_image)
    ```
  </Step>

  <Step title="Add a repository">
    The default workspace is `/root/workspace`:

    ```python theme={null}
    base_image = (
        worker.base_image()
        .run_commands(
            "git clone https://github.com/your-org/app /root/workspace/app"
        )
    )
    image = worker.prepare_image(base_image)
    ```
  </Step>

  <Step title="Set environment variables">
    Add non-secret configuration to the image:

    ```python theme={null}
    base_image = worker.base_image().env(
        {
            "PYTHONUNBUFFERED": "1",
            "PROJECT_ROOT": "/root/workspace/app",
        }
    )
    image = worker.prepare_image(base_image)
    ```

    Keep credentials out of image environment variables. Attach a
    [Modal Secret](https://modal.com/docs/guide/secrets) to the function that needs it.
  </Step>

  <Step title="Deploy the changes">
    ```bash theme={null}
    uv run modal-devin deploy outposts/my_outpost.py
    ```

    New sessions use the new image. A resumed session continues from its preserved
    filesystem instead of merging in later image changes.
  </Step>
</Steps>

<Warning>
  Keep every image build operation before `prepare_image()` and leave the generated
  image wiring unchanged elsewhere in the application.
</Warning>

## Optional tools

Choose the Python version or disable Chrome and FFmpeg when the workload does not
need them:

```python theme={null}
base_image = worker.base_image(
    python_version="3.12",
    install_chrome=False,
    install_ffmpeg=False,
)
```

| Option           | Default  | Effect                                   |
| ---------------- | -------- | ---------------------------------------- |
| `python_version` | `"3.12"` | Selects the Python version               |
| `install_chrome` | `True`   | Enables browser and computer-use support |
| `install_ffmpeg` | `True`   | Enables screen-recording support         |

See the [image reference](/reference/images) for everything else the standard image
includes.
