> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Default paths and files of a ClickHouse server installation

> Where a ClickHouse server installed from the deb or rpm packages keeps its configuration, logs, data, binaries and service files, and how to check the paths on your server.

The tables below list the files and directories of a self-managed ClickHouse server that was installed from the official `deb` or `rpm` packages and runs with the default configuration. Every location that the server uses can be changed in the configuration, and other ways of installing ClickHouse (the Docker image, a standalone binary) can use different ones, so see [how to check the paths on your server](#check-the-paths-on-your-server).

## Configuration

| Path | Description |
| - | - |
| `/etc/clickhouse-server/config.xml` | Main configuration file of the server. |
| `/etc/clickhouse-server/config.d/` | Files that are merged into `config.xml`. Put your own server settings here, because a package upgrade can replace `config.xml`. |
| `/etc/clickhouse-server/users.xml` | Users, settings profiles and quotas that are defined in the configuration. |
| `/etc/clickhouse-server/users.d/` | Files that are merged into `users.xml`. If you set a password for the `default` user during installation, the installer saves its hash here in `default-password.xml`. |
| `/var/lib/clickhouse/preprocessed_configs/` | The resulting `config.xml` and `users.xml` after all merges and substitutions, written by the server for reference. Do not edit these files. |
| `/etc/clickhouse-client/config.xml` | System-wide configuration of `clickhouse-client`. A user can override it in `~/.clickhouse-client/config.xml`. |
| `/etc/clickhouse-keeper/keeper_config.xml` | Configuration of ClickHouse Keeper when it runs as a separate `clickhouse-keeper` service. |

See [Configuration files](https://clickhouse.com/docs/concepts/features/configuration/server-config/configuration-files.md) for the rules of merging.

## Logs

| Path | Description |
| - | - |
| `/var/log/clickhouse-server/clickhouse-server.log` | Server log with all messages up to the configured level (`trace` by default). |
| `/var/log/clickhouse-server/clickhouse-server.err.log` | Only messages of the level `notice` and more severe: warnings, errors and fatal errors. |
| `/var/log/clickhouse-keeper/clickhouse-keeper.log`, `clickhouse-keeper.err.log` | The same two logs of a separate `clickhouse-keeper` service. |

The files are rotated; the default configuration keeps ten files of up to 1000 MB each. The paths and the rotation are set in the [`logger`](https://clickhouse.com/docs/reference/settings/server-settings/settings/other#logger) section.

## Data

The server stores its data under one directory, set by the [`path`](https://clickhouse.com/docs/reference/settings/server-settings/settings/other#path) setting.

| Path | Description |
| - | - |
| `/var/lib/clickhouse/` | Data directory of the server (`path`). |
| `/var/lib/clickhouse/metadata/` | Definitions of databases and tables as `.sql` files. |
| `/var/lib/clickhouse/store/` | Data and metadata of the tables of `Atomic` databases (the default database engine), in directories named after the table UUID. |
| `/var/lib/clickhouse/data/` | One directory per database with a symbolic link per table that points into `store/`. |
| `/var/lib/clickhouse/metadata_dropped/` | Definitions of tables that were dropped and whose data is not deleted yet. |
| `/var/lib/clickhouse/tmp/` | Temporary data of queries that spill to disk ([`tmp_path`](https://clickhouse.com/docs/reference/settings/server-settings/settings/tmp#tmp_path)). |
| `/var/lib/clickhouse/user_files/` | Files that the [`file`](https://clickhouse.com/docs/reference/functions/table-functions/file) table function can read ([`user_files_path`](https://clickhouse.com/docs/reference/settings/server-settings/settings/user#user_files_path)). |
| `/var/lib/clickhouse/access/` | Users, roles and other access entities created with SQL statements such as `CREATE USER` ([`user_directories`](https://clickhouse.com/docs/reference/settings/server-settings/settings/user#user_directories)). |
| `/var/lib/clickhouse/format_schemas/` | Schema files for formats such as `CapnProto` and `Protobuf` ([`format_schema_path`](https://clickhouse.com/docs/reference/settings/server-settings/settings/format#format_schema_path)). |
| `/var/lib/clickhouse/user_scripts/` | Scripts of executable user-defined functions ([`user_scripts_path`](https://clickhouse.com/docs/reference/settings/server-settings/settings/user#user_scripts_path)). |
| `/var/lib/clickhouse/flags/` | Flag files that request a one-time action at the next start, for example `force_restore_data`. |
| `/var/lib/clickhouse/coordination/` | Logs and snapshots of a separate `clickhouse-keeper` service (`logs/` and `snapshots/`). |

The table data of a `MergeTree` table is in its directory under `store/`, one subdirectory per data part, plus a `detached/` subdirectory for detached parts.

## Binaries and services

| Path | Description |
| - | - |
| `/usr/bin/clickhouse` | The ClickHouse binary. It contains the server, the client and all tools. |
| `/usr/bin/clickhouse-server`, `/usr/bin/clickhouse-client`, `/usr/bin/clickhouse-local`, `/usr/bin/clickhouse-keeper` and others | Symbolic links to `/usr/bin/clickhouse`. |
| `/lib/systemd/system/clickhouse-server.service` | systemd unit of the server. It starts `/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml`. |
| `/etc/init.d/clickhouse-server` | Init script for systems without systemd. |
| `/lib/systemd/system/clickhouse-keeper.service` | systemd unit of a separate ClickHouse Keeper. |
| `/run/clickhouse-server/clickhouse-server.pid` | PID file of the server when it is started by systemd. |
| `/etc/default/clickhouse-server`, `/etc/default/clickhouse` | Optional files with environment variables for the systemd unit. |

The server runs as the `clickhouse` user and group, which own the data and log directories.

## Check the paths on your server

The data directory that the server really uses is the path of the `default` disk:

```sql theme={null}
SELECT
    name,
    path
FROM system.disks
WHERE name = 'default';
```

The path settings of the server configuration are in [`system.server_settings`](https://clickhouse.com/docs/reference/system-tables/server_settings):

```sql theme={null}
SELECT
    name,
    value,
    changed
FROM system.server_settings
WHERE name IN ('path', 'tmp_path', 'user_files_path', 'format_schema_path', 'user_scripts_path')
ORDER BY name;
```

For a setting that is not set in the configuration (`changed = 0`), the table shows the built-in default under `/var/lib/clickhouse/`, while the server places the directory under the configured `path`.

Each table reports where its data and its definition are stored:

```sql theme={null}
SELECT
    data_paths,
    metadata_path
FROM system.tables
WHERE database = 'default' AND name = 'my_table';
```

## Paths that are not on the file system

Some settings in `config.xml` look like file paths but name nodes in ClickHouse Keeper, for example `/clickhouse/task_queue/ddl`, the queue of `ON CLUSTER` queries in the [`distributed_ddl`](https://clickhouse.com/docs/reference/settings/server-settings/settings/distributed-ddl#distributed_ddl) section.
