# Install Files.com Agent on Mac

On macOS, you install the Files.com Agent as a service so it starts automatically when the system powers on or reboots, and so it restarts itself if the agent program needs to recover from a problem. Running the Agent as a service is what makes the connection reliable across restarts and crashes.

## Configure the Root Path

Before you install the Agent as a service, set the `root` setting in the configuration file to either a local drive path (`/path/to/folder`) or a path to an accessible mounted network drive (`/mnt/path/to/folder`).

## Download the Agent

Download the agent executable for your system from the [official download location](https://filescorp.hosted-by-files.com/builds/files-agent-server/latest). Choose the version with "macos" in the name that matches your architecture and save it to the same location as your configuration file on the host system.

## Install the Agent

To install the Agent as a [`Launchd`](https://en.wikipedia.org/wiki/Launchd) service on a Mac, use this command:

```
files-agent service install --config /path/to/files_agent_config.toml
```

This method keeps the executable and configuration file in their original locations.

Start the service with:

```
files-agent service start
```

If you update the configuration file, stop the service, make your changes, and restart it.

Stop the service with:

```
files-agent service stop
```

Remove the service with:

```
files-agent service uninstall
```


---

# 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://moverdocs.files.com/connections/any-server-with-files.com-agent/install-files.com-agent-on-mac.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.
