Where Does ElectRS Store Data and Config?
ElectRS keeps a RocksDB index in db_dir with layered TOML config files. Defaults and priority order.
Last updated
ElectRS splits a small config surface from a large index. Config is a TOML file resolved through a priority chain: system file, home file, local file, then explicit flags, env vars and CLI args. The index is a RocksDB tree under db_dir, nested per network, that rebuilds from the node when lost.
That split sets backup scope. The config file is tiny and precious; the index is huge and disposable. Point db_dir at fast storage with room to spare, since reindexing costs a full sync. Auth to the node rides on the cookie file or explicit credentials in config only.
Where ElectRS stores this, by platform
~/.electrs/config.toml
Home config in the chain /etc/electrs/config.toml, ~/.electrs/config.toml, ./electrs.toml plus conf flags and ELECTRS_ env vars. Index under db_dir (default ./db) with per-network children. Cookie auth defaults to ~/.bitcoin/.cookie.
Frequently asked questions
Which ElectRS config file actually loads?
The highest-priority one present wins among system, home and local TOML files, before explicit conf flags, env vars and CLI args. Print the effective setup with the config dump command. Hardened units pass skip-default-conf-files to pin a single source.
Where is the ElectRS database?
Under db_dir with per-network RocksDB children, defaulting to ./db relative to launch. It re-syncs from Bitcoin Core when deleted, so back up config and node data instead. Keep it on fast local disks, never network mounts.
How does ElectRS authenticate to Bitcoin Core?
Through the cookie file by default or user and password lines kept in the config file only. Cookie paths follow the node data dir. Never commit a config with plaintext credentials to shared repos.
Notice an outdated path? Let us know.