Linux

Where Is ClickHouse Data Stored?

ClickHouse stores tables and metadata under /var/lib/clickhouse/ on Linux. Server behavior is defined in the main XML config.

Last updated

The default data path is /var/lib/clickhouse/ as set by the path element in config. Main config is /etc/clickhouse-server/config.xml with extra files in /etc/clickhouse-server/config.d/. Logs are in /var/log/clickhouse-server/.

Custom disks and object storage alter where parts reside. Confirm the live value in config since admins change defaults and Docker mounts often replace these paths.

Where ClickHouse stores this, by platform

Linux
/var/lib/clickhouse/

Config is /etc/clickhouse-server/config.xml. Logs are /var/log/clickhouse-server/clickhouse-server.log and clickhouse-server.err.log. Tmp files are under tmp/ and user files under user_files/. Keep the package config unmodified and use config.d/ for changes.

Frequently asked questions

Which files define the data path?

The path element in /etc/clickhouse-server/config.xml sets the base dir. Files in config.d/ merge with it in alphabetical order. Check preprocessed configs if the value looks unexpected.

Where are logs when the server fails to start?

Check /var/log/clickhouse-server/clickhouse-server.log and the err log. On systemd also run journalctl for the clickhouse-server unit. Start with the explicit config file path to test changes.

Notice an outdated path? Let us know.