# Setup (/docs/configuration/librechat_yaml/setup)

**The `librechat.yaml` file should be placed in the root of the project where the .env file is located.**

You can copy the [example config file](/docs/configuration/librechat_yaml/example) as a good starting point while reading the rest of the guide.

The example config file has some options ready to go for Mistral AI, Groq and Openrouter.

**Note:** You can set an alternate filepath for the `librechat.yaml` file through an environment variable:

```bash filename=".env"
CONFIG_PATH="/alternative/path/to/librechat.yaml"
```

## Docker Setup

For Docker, you need to make use of an [override file](/docs/configuration/docker_override), named `docker-compose.override.yml`, to ensure the config file works for you.

- First, make sure your containers stop running with `docker compose down`
- Create or edit existing `docker-compose.override.yml` at the root of the project:


```yaml filename="docker-compose.override.yml"
version: '3.4'

services:
  api:
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml
```

- **Note:** If you are using `CONFIG_PATH` for an alternative filepath for this file, make sure to specify it accordingly.

- Start docker again, and you should see your config file settings apply

```bash filename="Restart the containers"
docker compose up
```

## Troubleshooting

### Server Exits Immediately on Startup

If your server exits immediately after starting with exit code 1, this is likely due to configuration validation errors in your `librechat.yaml` file.

**To diagnose the issue:**

1. **Check the server logs** for validation error messages:
   ```bash filename="View Docker logs"
   docker compose logs api
   ```

2. **Validate your YAML syntax** using the [YAML Validator](/toolkit/yaml_checker) or tools like [yamlchecker.com](https://yamlchecker.com/)

3. **Common validation errors include:**
   - Invalid YAML syntax (incorrect indentation, missing colons, etc.)
   - Unknown configuration keys or typos in property names
   - Invalid values for specific configuration options
   - Missing required fields

**Temporary workaround:**

If you need to start the server urgently while debugging configuration issues, you can bypass validation by setting:

```bash filename=".env"
CONFIG_BYPASS_VALIDATION=true
```

<Callout type="warning" title="Warning">
Using `CONFIG_BYPASS_VALIDATION=true` will cause the server to log a warning and continue with default configuration. This is not recommended for production use. Always fix the validation errors in your configuration file.
</Callout>
