# Overview (https://www.librechat.ai/docs/configuration)

LibreChat uses four main configuration files. Each controls a different aspect of the application -- from environment variables to custom AI endpoints to Docker service overrides.

## Common Change Workflow

Most configuration changes follow the same pattern:

1. Edit `.env` for secrets, API keys, and server-level feature flags.
2. Edit `librechat.yaml` for custom endpoints, model specs, interface settings, MCP servers, agents, and advanced app behavior.
3. For Docker, make sure `librechat.yaml` is mounted through `docker-compose.override.yml` before expecting LibreChat to read it.
4. Restart LibreChat after every configuration change.
5. Check the API logs if the change does not appear in the UI.

For example, to enable OpenRouter you add `OPENROUTER_KEY` to `.env`, add an OpenRouter endpoint in `librechat.yaml`, make sure Docker mounts `librechat.yaml`, restart, then select OpenRouter from the endpoint selector.

## Configuration Files

<FileTree>
  <FileTree.Folder name="LibreChat (project root)" defaultOpen>
    <FileTree.File name=".env" active />
    <FileTree.File name="librechat.yaml" active />
    <FileTree.File name="docker-compose.yml" />
    <FileTree.File name="docker-compose.override.yml" active />
  </FileTree.Folder>
</FileTree>

**`.env`** -- Server-level settings: API keys, database connection strings, feature flags, and authentication secrets. This is the primary configuration file for most deployments. See the [.env reference](/docs/configuration/dotenv) for all available variables.

**`librechat.yaml`** -- Custom AI endpoints, model settings, interface options, and advanced features like MCP servers and agents. This file is optional -- LibreChat works with defaults if it does not exist. See the [librechat.yaml guide](/docs/configuration/librechat_yaml) for setup instructions.

**`docker-compose.yml`** -- Defines the Docker services (API server, database, search). Do not edit this file directly -- use an override file instead so your changes survive updates.

**`docker-compose.override.yml`** -- Your local customizations to Docker services: volume mounts, port mappings, environment overrides. Docker Compose merges this with the main file automatically. See the [Docker override guide](/docs/configuration/docker_override).

## Applying Changes

<Callout type="warning" title="Restart Required">

After editing any configuration file, you must restart LibreChat for changes to take effect.

<Tabs items={['Docker', 'Local']}>
  <Tabs.Tab>

```bash
docker compose down && docker compose up -d
```

  </Tabs.Tab>
  <Tabs.Tab>

Stop the running process (Ctrl+C) and restart:

```bash
npm run backend
```

  </Tabs.Tab>
</Tabs>

</Callout>

## Next Steps

<Cards num={3}>
  <Cards.Card title="librechat.yaml Setup" href="/docs/configuration/librechat_yaml" arrow>
    Create and configure the main LibreChat config file
  </Cards.Card>
  <Cards.Card title="Docker Setup" href="/docs/quick_start/local_setup" arrow>
    Install and run LibreChat with Docker
  </Cards.Card>
  <Cards.Card title=".env Reference" href="/docs/configuration/dotenv" arrow>
    Environment variables for server configuration
  </Cards.Card>
</Cards>
