bitcoin.conf configuration file is used by bitcoind, bitcoin-qt, and bitcoin-cli to control Bitcoin Core’s behavior.
Configuration File Location
By default,bitcoin.conf is located in the Bitcoin data directory:
| Operating System | Default Path |
|---|---|
| Linux | ~/.bitcoin/bitcoin.conf |
| macOS | ~/Library/Application Support/Bitcoin/bitcoin.conf |
| Windows | %LOCALAPPDATA%\Bitcoin\bitcoin.conf |
-conf command-line option:
File Format
The configuration file is a plain text file withoption=value entries, one per line.
Basic Syntax
Leading and trailing whitespaces are removed. An option must be specified without the leading
- used in command-line arguments.Comments
Comments start with# and extend to the end of the line:
Network-Specific Options
Options can be specified for specific networks using section headers or prefixes:Negated Options
Most options can be negated using theno prefix:
Common Configuration Options
Core Options
Specify the data directory path. Default varies by platform.
Specify path to an additional configuration file. Relative paths are prefixed by datadir location.
Include additional configuration file. Can be used multiple times. Relative to datadir.
Specify PID file location. Default:
bitcoind.pidChain and Database Options
Use a specific chain:
main, test, testnet4, signet, or regtestUse the test network (testnet3)
Enter regression test mode
Maximum database cache size in MiB. Minimum 4, default 450.
Reduce storage by pruning old blocks. Specify target size in MiB. 0=disable, 1=enable with 550 MiB minimum.
Maintain a full transaction index for the getrawtransaction RPC
Specify directory to hold blocks subdirectory. Default:
<datadir>RPC Server Options
Accept command line and JSON-RPC commands
Username for JSON-RPC connections
Password for JSON-RPC connections
Username and HMAC-SHA-256 hashed password. Format:
<USERNAME>:<SALT>$<HASH>Listen for JSON-RPC connections on this port. Default: 8332 (mainnet), 18332 (testnet3), 18443 (regtest)
Bind to given address to listen for JSON-RPC connections. Use
[host]:port notation for IPv6.Allow JSON-RPC connections from specified source. Can specify IP, network/netmask, or network/CIDR.
Accept public REST requests
Network Options
Accept connections from outside
Listen for connections on this port. Default: 8333 (mainnet), 18333 (testnet3), 18444 (regtest)
Bind to given address and always listen on it. Use
[host]:port notation for IPv6.Maintain at most this many connections to peers
Add a node to connect to and attempt to keep the connection open. Can be specified multiple times.
Connect only to the specified node(s). Can be specified multiple times.
Connect through SOCKS5 proxy
Use separate SOCKS5 proxy to reach peers via Tor onion services
Mempool Options
Keep the transaction memory pool below this many megabytes
Do not keep transactions in the mempool longer than this many hours
Save the mempool on shutdown and load on restart
Advanced Options
Mining and Block Creation
Mining and Block Creation
Transaction Relay
Transaction Relay
ZeroMQ Notifications
ZeroMQ Notifications
Notification Commands
Notification Commands
Configuration Precedence
Settings are applied in the following order (later overrides earlier):bitcoin.conffilesettings.jsonfile (dynamic settings from GUI/RPC)- Command-line options
The
settings.json file contains dynamic settings set by Bitcoin Core GUI and RPCs at runtime, and augments or replaces static settings in bitcoin.conf.Example Configurations
Minimal RPC Configuration
Pruned Node Configuration
Full Archival Node
Testnet Configuration
Validation and Debugging
To check which settings are in use:- Check
debug.logoutput for configuration values - Unrecognized options appear as warnings in
debug.log - Use
bitcoin-cli getinfoto verify runtime settings
See Also
- Command-Line Options - All available command-line arguments
- Data Directory Structure - File and directory layout