Skip to main content
Command-line options allow you to configure Bitcoin Core at startup. These options can also be specified in the bitcoin.conf file (without the leading -).

Usage

Command-line options override values set in the configuration file, and configuration file options override values set in the GUI.

General Options

flag
Print help message and exit
flag
Print help message with all options and exit
flag
Print version and exit
string
default:"bitcoin.conf"
Specify path to read-only configuration file. Relative paths are prefixed by datadir location.
string
Specify data directory. Cannot be negated.
string
default:"settings.json"
Specify path to dynamic settings data file. Can be disabled with -nosettings.
string
default:"bitcoind.pid"
Specify PID file. Relative paths are prefixed by datadir location.

Chain Selection Options

string
default:"main"
Use the specified chain: main, test, testnet4, signet, or regtest
flag
Use the test network (testnet3)
flag
Use the testnet4 test network
flag
Use the signet test network
flag
Enter regression test mode, which uses a special chain for testing

Database Options

number
default:"450"
Maximum database cache size in MiB (minimum 4). Unused memory is shared with mempool.
string
Specify directory to hold blocks subdirectory for *.dat files
boolean
default:"0"
Maintain a full transaction index, used by the getrawtransaction RPC
boolean
default:"0"
Maintain a transaction output spender index, used by the gettxspendingprevout RPC
boolean
default:"0"
Maintain coinstats index used by the gettxoutsetinfo RPC
string
Maintain an index of compact filters for blocks. Supported types: basic
number
default:"0"
Reduce storage by pruning old blocks. Value is target size in MiB (minimum 550). 0 = disable pruning.
flag
Rebuild chain state and block index from block files on disk
flag
Rebuild chain state from block index

Network Options

boolean
default:"1"
Accept connections from outside (default: 1 if no -proxy or -connect)
number
Listen for connections on specified port. Default: 8333 (mainnet), 18333 (testnet3), 18444 (testnet4), 38333 (signet), 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. Does not apply to manual connections via -addnode.
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). -noconnect disables automatic connections.
string
Connect to a node to retrieve peer addresses, then disconnect. Can be specified multiple times.
string
Connect through SOCKS5 proxy. Format: <ip:port|path>[=<network>]
string
Use separate SOCKS5 proxy to reach peers via Tor onion services. Set -noonion to disable.
string
I2P SAM proxy to reach I2P peers and accept I2P connections
string
Make automatic outbound connections only to specified network. Can be specified multiple times. Values: ipv4, ipv6, onion, i2p, cjdns
boolean
default:"1"
Allow DNS lookups for -addnode, -seednode and -connect
boolean
default:"1"
Query for peer addresses via DNS lookup if low on addresses
boolean
Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)
string
Specify your own public address
string
default:"0"
Keep outbound traffic under given target per 24h. 0 = no limit. Suffix units: k|K|m|M|g|G|t|T
number
default:"5000"
Specify socket connection timeout in milliseconds (minimum: 1)

RPC Server Options

flag
Accept command line and JSON-RPC commands
boolean
default:"0"
Accept public REST requests
string
default:"127.0.0.1"
Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
number
Listen for JSON-RPC connections on specified port. Default: 8332 (mainnet), 18332 (testnet3), 18443 (regtest)
string
default:"127.0.0.1"
Allow JSON-RPC connections from specified source. Can specify IP, network/netmask, or network/CIDR. Can be specified multiple times.
string
Username for JSON-RPC connections
string
Password for JSON-RPC connections
string
Username and HMAC-SHA-256 hashed password. Format: <USERNAME>:<SALT>$<HASH>. Can be specified multiple times.
string
Location of the auth cookie. Relative paths are prefixed by datadir location.
number
default:"4"
Set the number of threads to service RPC calls
number
default:"16"
Set the depth of the work queue to service RPC calls
string
Set a whitelist to filter incoming RPC calls. Format: <USERNAME>:<rpc 1>,<rpc 2>,...

Mempool Options

number
default:"300"
Keep the transaction memory pool below specified megabytes
number
default:"336"
Do not keep transactions in the mempool longer than specified hours
boolean
default:"1"
Whether to save the mempool on shutdown and load on restart
boolean
default:"0"
Reject transactions from network peers. Disables automatic broadcast and rebroadcast.

Transaction Relay Options

number
default:"0.00001"
Fees (in BTC/kvB) smaller than this are considered zero fee for relaying, mining, and transaction creation
boolean
default:"1"
Relay and mine data carrier transactions
number
default:"83"
Maximum size of data-carrying raw scriptPubKeys to relay and mine

Notification Options

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.
string
Execute command on startup
string
Execute command immediately before beginning shutdown

ZeroMQ Options

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
Enable publish hash block and tx sequence in specified address

Debugging and Testing Options

string
Output debugging information. Can be specified multiple times. Categories: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation, i2p, ipc
string
Exclude debugging information for a category. Can be negated to exclude all debugging.
boolean
default:"0"
Include IP addresses in debug output
boolean
default:"1"
Prepend debug output with timestamp
flag
Send trace/debug info to console instead of debug.log
flag
Shrink debug.log file on client startup
string
Append comment to the user agent string

Daemon Options (Unix only)

flag
default:"0"
Run in the background as a daemon and accept commands
flag
default:"0"
Wait for initialization to be finished before exiting. Implies -daemon.

Example Usage

Start a Full Node with RPC

Start a Pruned Node

Start Testnet Node

Start with Custom Data Directory

Connect to Specific Peers Only

Notes

All command-line options (except -?, -help, -version, and -conf) may be specified in the configuration file.
Command-line options override values set in the configuration file.

See Also