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

bitcoind [options]
bitcoin-qt [options]
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
bitcoind -?
-help
flag
Print help message with all options and exit
bitcoind -help
-version
flag
Print version and exit
bitcoind -version
-conf
string
default:"bitcoin.conf"
Specify path to read-only configuration file. Relative paths are prefixed by datadir location.
bitcoind -conf=/etc/bitcoin/bitcoin.conf
-datadir
string
Specify data directory. Cannot be negated.
bitcoind -datadir=/mnt/bitcoin
-settings
string
default:"settings.json"
Specify path to dynamic settings data file. Can be disabled with -nosettings.
bitcoind -settings=/var/lib/bitcoin/settings.json
-pid
string
default:"bitcoind.pid"
Specify PID file. Relative paths are prefixed by datadir location.
bitcoind -pid=/var/run/bitcoind.pid

Chain Selection Options

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

Database Options

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

Network Options

-listen
boolean
default:"1"
Accept connections from outside (default: 1 if no -proxy or -connect)
bitcoind -listen=1
-port
number
Listen for connections on specified port. Default: 8333 (mainnet), 18333 (testnet3), 18444 (testnet4), 38333 (signet), 18444 (regtest)
bitcoind -port=8333
-bind
string
Bind to given address and always listen on it. Use [host]:port notation for IPv6.
bitcoind -bind=0.0.0.0:8333
-maxconnections
number
default:"125"
Maintain at most this many connections to peers. Does not apply to manual connections via -addnode.
bitcoind -maxconnections=200
-addnode
string
Add a node to connect to and attempt to keep the connection open. Can be specified multiple times.
bitcoind -addnode=69.164.218.197 -addnode=10.0.0.2:8333
-connect
string
Connect only to the specified node(s). -noconnect disables automatic connections.
bitcoind -connect=192.168.1.100
-seednode
string
Connect to a node to retrieve peer addresses, then disconnect. Can be specified multiple times.
bitcoind -seednode=seed.bitcoin.sipa.be
-proxy
string
Connect through SOCKS5 proxy. Format: <ip:port|path>[=<network>]
bitcoind -proxy=127.0.0.1:9050
-onion
string
Use separate SOCKS5 proxy to reach peers via Tor onion services. Set -noonion to disable.
bitcoind -onion=127.0.0.1:9050
-i2psam
string
I2P SAM proxy to reach I2P peers and accept I2P connections
bitcoind -i2psam=127.0.0.1:7656
-onlynet
string
Make automatic outbound connections only to specified network. Can be specified multiple times. Values: ipv4, ipv6, onion, i2p, cjdns
bitcoind -onlynet=ipv4 -onlynet=ipv6
-dns
boolean
default:"1"
Allow DNS lookups for -addnode, -seednode and -connect
bitcoind -dns=1
-dnsseed
boolean
default:"1"
Query for peer addresses via DNS lookup if low on addresses
bitcoind -dnsseed=1
-discover
boolean
Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)
bitcoind -discover=1
-externalip
string
Specify your own public address
bitcoind -externalip=203.0.113.42
-maxuploadtarget
string
default:"0"
Keep outbound traffic under given target per 24h. 0 = no limit. Suffix units: k|K|m|M|g|G|t|T
bitcoind -maxuploadtarget=144M
-timeout
number
default:"5000"
Specify socket connection timeout in milliseconds (minimum: 1)
bitcoind -timeout=10000

RPC Server Options

-server
flag
Accept command line and JSON-RPC commands
bitcoind -server
-rest
boolean
default:"0"
Accept public REST requests
bitcoind -rest=1
-rpcbind
string
default:"127.0.0.1"
Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
bitcoind -rpcbind=127.0.0.1:8332 -rpcbind=[::1]:8332
-rpcport
number
Listen for JSON-RPC connections on specified port. Default: 8332 (mainnet), 18332 (testnet3), 18443 (regtest)
bitcoind -rpcport=8332
-rpcallowip
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.
bitcoind -rpcallowip=192.168.1.0/24 -rpcallowip=10.0.0.5
-rpcuser
string
Username for JSON-RPC connections
bitcoind -rpcuser=bitcoinrpc
-rpcpassword
string
Password for JSON-RPC connections
bitcoind -rpcpassword=your-secure-password
-rpcauth
string
Username and HMAC-SHA-256 hashed password. Format: <USERNAME>:<SALT>$<HASH>. Can be specified multiple times.
bitcoind -rpcauth=alice:e3c4f2a7$0f2d...
-rpccookiefile
string
Location of the auth cookie. Relative paths are prefixed by datadir location.
bitcoind -rpccookiefile=/var/lib/bitcoin/.cookie
-rpcthreads
number
default:"4"
Set the number of threads to service RPC calls
bitcoind -rpcthreads=8
-rpcworkqueue
number
default:"16"
Set the depth of the work queue to service RPC calls
bitcoind -rpcworkqueue=32
-rpcwhitelist
string
Set a whitelist to filter incoming RPC calls. Format: <USERNAME>:<rpc 1>,<rpc 2>,...
bitcoind -rpcwhitelist=user1:getblockcount,getbestblockhash

Mempool Options

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

Transaction Relay Options

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

Notification Options

-blocknotify
string
Execute command when the best block changes. %s in cmd is replaced by block hash.
bitcoind -blocknotify="/usr/local/bin/notify-block.sh %s"
-alertnotify
string
Execute command when an alert is raised. %s in cmd is replaced by message.
bitcoind -alertnotify="echo %s | mail -s 'Bitcoin Alert' admin@example.com"
-startupnotify
string
Execute command on startup
bitcoind -startupnotify="/usr/local/bin/startup.sh"
-shutdownnotify
string
Execute command immediately before beginning shutdown
bitcoind -shutdownnotify="/usr/local/bin/shutdown.sh"

ZeroMQ Options

-zmqpubhashblock
string
Enable publish hash block in specified address
bitcoind -zmqpubhashblock=tcp://127.0.0.1:28332
-zmqpubhashtx
string
Enable publish hash transaction in specified address
bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332
-zmqpubrawblock
string
Enable publish raw block in specified address
bitcoind -zmqpubrawblock=tcp://127.0.0.1:28332
-zmqpubrawtx
string
Enable publish raw transaction in specified address
bitcoind -zmqpubrawtx=tcp://127.0.0.1:28332
-zmqpubsequence
string
Enable publish hash block and tx sequence in specified address
bitcoind -zmqpubsequence=tcp://127.0.0.1:28332

Debugging and Testing Options

-debug
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
bitcoind -debug=net -debug=mempool
-debugexclude
string
Exclude debugging information for a category. Can be negated to exclude all debugging.
bitcoind -debugexclude=libevent
-logips
boolean
default:"0"
Include IP addresses in debug output
bitcoind -logips=1
-logtimestamps
boolean
default:"1"
Prepend debug output with timestamp
bitcoind -logtimestamps=1
-printtoconsole
flag
Send trace/debug info to console instead of debug.log
bitcoind -printtoconsole
-shrinkdebugfile
flag
Shrink debug.log file on client startup
bitcoind -shrinkdebugfile
-uacomment
string
Append comment to the user agent string
bitcoind -uacomment="my custom node"

Daemon Options (Unix only)

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

Example Usage

Start a Full Node with RPC

bitcoind -daemon -server -rpcuser=myuser -rpcpassword=mypass -rpcallowip=127.0.0.1

Start a Pruned Node

bitcoind -daemon -prune=10000 -dbcache=1024

Start Testnet Node

bitcoind -testnet -daemon -server -rpcport=18332

Start with Custom Data Directory

bitcoind -datadir=/mnt/bitcoin -daemon

Connect to Specific Peers Only

bitcoind -connect=192.168.1.100 -connect=192.168.1.101

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