Skip to main content
The 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: You can specify a custom location using the -conf command-line option:

File Format

The configuration file is a plain text file with option=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:
The testnet section header is [test], not [testnet]. For testnet4, use [testnet4].
Network-specific options take precedence over non-network specific options. If multiple values for the same option are found with the same precedence, the first one is chosen.

Negated Options

Most options can be negated using the no prefix:

Common Configuration Options

Core Options

string
Specify the data directory path. Default varies by platform.
string
Specify path to an additional configuration file. Relative paths are prefixed by datadir location.
string
Include additional configuration file. Can be used multiple times. Relative to datadir.
string
Specify PID file location. Default: bitcoind.pid

Chain and Database Options

string
default:"main"
Use a specific chain: main, test, testnet4, signet, or regtest
boolean
default:"0"
Use the test network (testnet3)
boolean
default:"0"
Enter regression test mode
number
default:"450"
Maximum database cache size in MiB. Minimum 4, default 450.
number
default:"0"
Reduce storage by pruning old blocks. Specify target size in MiB. 0=disable, 1=enable with 550 MiB minimum.
boolean
default:"0"
Maintain a full transaction index for the getrawtransaction RPC
string
Specify directory to hold blocks subdirectory. Default: <datadir>

RPC Server Options

boolean
default:"0"
Accept command line and JSON-RPC commands
string
Username for JSON-RPC connections
string
Password for JSON-RPC connections
string
Username and HMAC-SHA-256 hashed password. Format: <USERNAME>:<SALT>$<HASH>
number
Listen for JSON-RPC connections on this port. Default: 8332 (mainnet), 18332 (testnet3), 18443 (regtest)
string
default:"127.0.0.1"
Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
string
default:"127.0.0.1"
Allow JSON-RPC connections from specified source. Can specify IP, network/netmask, or network/CIDR.
Do not expose the RPC server to untrusted networks such as the public internet!
boolean
default:"0"
Accept public REST requests

Network Options

boolean
default:"1"
Accept connections from outside
number
Listen for connections on this port. Default: 8333 (mainnet), 18333 (testnet3), 18444 (regtest)
string
Bind to given address and always listen on it. Use [host]:port notation for IPv6.
number
default:"125"
Maintain at most this many connections to peers
string
Add a node to connect to and attempt to keep the connection open. Can be specified multiple times.
string
Connect only to the specified node(s). Can be specified multiple times.
string
Connect through SOCKS5 proxy
string
Use separate SOCKS5 proxy to reach peers via Tor onion services

Mempool Options

number
default:"300"
Keep the transaction memory pool below this many megabytes
number
default:"336"
Do not keep transactions in the mempool longer than this many hours
boolean
default:"1"
Save the mempool on shutdown and load on restart

Advanced Options

number
default:"3996000"
Set maximum BIP141 block weight
number
default:"0.00001000"
Set lowest fee rate (in BTC/kvB) for transactions to be included in block creation
number
default:"0.00001000"
Fees (in BTC/kvB) smaller than this are considered zero fee for relaying and mining
boolean
default:"0"
Reject transactions from network peers. Automatic broadcast is disabled.
boolean
default:"1"
Relay and mine data carrier transactions
string
Enable publish hash block in specified address
string
Enable publish hash transaction in specified address
string
Enable publish raw block in specified address
string
Enable publish raw transaction in specified address
string
Execute command when the best block changes. %s in cmd is replaced by block hash.
string
Execute command when an alert is raised. %s in cmd is replaced by message.

Configuration Precedence

Settings are applied in the following order (later overrides earlier):
  1. bitcoin.conf file
  2. settings.json file (dynamic settings from GUI/RPC)
  3. 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:
  1. Check debug.log output for configuration values
  2. Unrecognized options appear as warnings in debug.log
  3. Use bitcoin-cli getinfo to verify runtime settings
Users should never make configuration changes they do not understand. Always be cautious of accepting configuration changes from untrusted sources.

See Also