Where Does Kafka Store Config and Topic Data?
Kafka brokers read server.properties from the install config dir and write topic data to log.dirs, defaulting to /tmp in dev single-node setups.
Last updated
Kafka separates its own configuration from the data it stores, and both live wherever the deployment puts them. The properties files (server, kraft, controller) set roles, listeners, and log directories. The log.dirs folders then accumulate topic partitions and metadata snapshots as plain segment files.
The shipped /tmp default is a demo convenience, not a plan. Real deployments point log.dirs at durable volumes and format them explicitly with a cluster id. Config and data travel separately in every serious setup: properties in config management, log dirs on storage.
Where Kafka stores this, by platform
[KafkaDir]/config/kraft/server.properties
Broker roles, listeners, and log.dirs. The /tmp default fits single-node trials; production points log.dirs at mounted volumes. Format with kafka-storage before first boot.
[KafkaDir]\config\kraft\server.properties
Same properties-plus-log-dirs split on Windows installs. Prefer short ASCII paths for log.dirs; long names and spaces cause the classic Windows broker failures.
Frequently asked questions
Where is topic data actually stored?
Read log.dirs in the properties file the broker started with. The /tmp default suits demos only; production mounts dedicated volumes and points log.dirs there. Unmounted blank dirs risk silent reformatting, so verify mounts first.
Do I need to format storage before starting?
Run kafka-storage format with the cluster id before first start on each node. It writes meta.properties and the initial metadata snapshot. Skipping it on blank dirs was removed as a footgun; formatting is now explicit.
Notice an outdated path? Let us know.