# MacOS

## Prerequisites

1. Minimum 2GB of RAM
2. At least 2GB available disk space.
3. Supported macOS version:
   * MacOS 14 Sonoma (Tested)
   * MacOS 11 Monterey (Tested)

## Dependencies

We will be using the following dependencies:

* Python 3.10
* Tools: `git`, `homebrew`, `bash` or `zsh`
* Additional Modmail requirements: `cairo`, `libxml2`, `libxslt`, `libffi`

{% hint style="info" %}
All code blocks should be executed in zsh or bash and line by line unless specified otherwise.
{% endhint %}

To install these dependencies, we will be using Terminal (zsh or bash):

```bash
brew install git python@3.10 cairo libxml2 libxslt libffi
pip3 install cairosvg
```

After that, install `pipenv` with:

```bash
python3.10 -m pip install pipenv
```

## Installing Bot

Clone and change directory into the Modmail folder with:

```bash
git clone https://github.com/modmail-dev/modmail
cd modmail
```

Inside the Modmail folder, install `pipenv` and its Python packages with:

<pre class="language-bash"><code class="lang-bash"><strong>python3.10 -m pipenv install --python 3.10
</strong></code></pre>

Create a file named `.env` with `nano` and paste all the environmental variables (secrets) needed to run the bot via right-clicking in the nano editor. Refer to the steps in the [parent Installation page](/installation.md#preparing-your-environmental-variables) to find where to obtain these.

```bash
cp .env.example .env
nano .env
```

<figure><img src="/files/W9meRpBIsbIaLCXsg8Xh" alt=""><figcaption></figcaption></figure>

After that, exit the nano editor with `Ctrl+X` and select or enter `y` when prompted to save. Press enter to maintain the exiting name of the document.

{% hint style="info" %}
If using the `nano` editor is a bit of a learning curve, you can edit the `.env` file manually with your preferred GUI-based editor like TextEdit.
{% endhint %}

After your `.env` file is ready, you can now go ahead and try running your bot with:

```bash
python3.10 -m pipenv run bot
```

If no error shows up, it means your bot is now running correctly. You can stop the bot from running with `Ctrl+C` to continue using your terminal.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.modmail.dev/installation/local-hosting-vps/macos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
