Understanding the bitcoin.conf file is essential for anyone running Bitcoin Core or managing a node on the Bitcoin network. This configuration file allows users to customize how their node behaves—from connecting to the mainnet or testnet, setting up RPC access, managing wallet parameters, and optimizing performance through pruning and connection limits.
In this comprehensive guide, we’ll walk through the default file locations across operating systems, break down key configuration options, provide a practical example setup, and answer common questions to help you configure your node securely and efficiently.
Default Location of bitcoin.conf by Operating System
The bitcoin.conf file isn’t created automatically when you install Bitcoin Core. You must manually create it in the correct directory depending on your OS.
Linux
On Linux systems, the default path is:
$HOME/.bitcoin/bitcoin.confWindows
For Windows users, the configuration file should be placed at:
%APPDATA%\Bitcoin\bitcoin.confYou can access this quickly by typing %APPDATA% into the File Explorer address bar and navigating to the Bitcoin folder.
macOS
macOS stores the configuration under:
$HOME/Library/Application Support/Bitcoin/bitcoin.confNote that the Library folder is hidden by default. Use Cmd + Shift + G in Finder to navigate directly using the path.
👉 Learn how to set up secure blockchain configurations with expert tools.
If you're unsure where to start, you can always download a sample configuration from the official Bitcoin GitHub repository, which includes well-documented examples.
Core Configuration Options in bitcoin.conf
Each line in bitcoin.conf follows the format key=value. Lines starting with # are treated as comments and ignored by the system. Below are the most important configuration categories and their functions.
Network & Node Settings
These settings define how your node connects to the Bitcoin network.
testnet
Set to1to connect to the Bitcoin testnet (used for testing), or0for the mainnet.
Example:testnet=0regtest
Enables private blockchain mode for development and testing. Only use this if you're building applications locally.regtest=0proxy
Route all connections through a SOCKS5 proxy (useful for privacy).#proxy=127.0.0.1:9050- bind and whitebind
Specify local IP addresses to bind incoming connections. Leave commented for default behavior. addnode
Manually add trusted nodes to connect to. Multiple entries allowed.addnode=69.164.218.197 addnode=10.0.0.2:8333- connect
Restrict connections only to specified nodes (disables automatic peer discovery). - listen
Enable listening mode so other nodes can connect to yours. Enabled by default unlessconnectis used. - maxconnections
Limit total peer connections (default is usually around 125). Adjust based on bandwidth.
RPC (Remote Procedure Call) Configuration
The RPC interface allows external tools like bitcoin-cli or wallets to interact with your node.
server
Must be set to1to enable JSON-RPC services.server=1rpcuser and rpcpassword
Credentials required for authentication. Never use defaults—always generate strong values.rpcuser=mysecureusername rpcpassword=myverystrongpassword123!
⚠️ Warning: Avoid using weak passwords or sharing credentials. The warning message DONT_USE_THIS_YOU_WILL_GET_ROBBED exists for a reason.
- rpcport
Default port is8332for mainnet,18332for testnet. rpcallowip
Restrict RPC access to specific IPs (e.g., localhost or internal network).rpcallowip=127.0.0.1 rpcallowip=192.168.1.0/24rpcbind
Bind RPC service to a specific interface (recommended for security).rpcbind=127.0.0.1
👉 Access advanced node management features securely through trusted platforms.
Wallet Settings
Even if you're not using Bitcoin Core as a wallet, these settings affect transaction handling.
- txconfirmtarget
Defines how many blocks to wait before considering a transaction confirmed (default: 6). - paytxfee
Set a custom fee rate (in BTC/kB) for outgoing transactions. Useful during high congestion. - keypool
Number of pre-generated keys for new addresses (default: 100). Increase if frequently generating addresses.
Performance & Privacy Optimization
prune
Enable blockchain pruning to save disk space. Value is in MiB; minimum ~550 MiB recommended.prune=550Note: Pruning disables serving historical blocks to other nodes.
- min and minimizetotray
GUI-only options: minimize on startup and hide to system tray (Windows/macOS).
Sample bitcoin.conf File
Below is a secure and functional configuration template. Uncomment and modify values as needed:
# Network Mode
testnet=0
# regtest=0
# Connection Settings
# proxy=127.0.0.1:9050
# addnode=69.164.218.197
listen=1
maxconnections=40
# RPC Access
server=1
rpcuser=your_secure_username
rpcpassword=your_very_strong_password_here
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rpcport=8332
# Wallet Behavior
txconfirmtarget=6
# paytxfee=0.0005
keypool=100
# Storage Optimization
prune=600
# GUI Options (if using Bitcoin-Qt)
# min=1
# minimizetotray=1Save this as bitcoin.conf in your Bitcoin data directory and restart your node for changes to take effect.
Frequently Asked Questions (FAQ)
Q: Do I need to create bitcoin.conf manually?
Yes, Bitcoin Core does not generate the file automatically. You must create it in the correct data directory for your operating system.
Q: Can I run both mainnet and testnet on the same machine?
Yes, but they require separate data directories and configuration files. Use -datadir= startup parameter or organize folders manually.
Q: Is it safe to expose RPC port to the internet?
No—exposing RPC without proper firewall rules or authentication is extremely dangerous and could lead to fund theft or node compromise.
Q: What happens if I lose my bitcoin.conf file?
Your node will run with default settings, but any custom configurations (like RPC credentials or added nodes) will need to be re-entered.
Q: How do I check if my config is working?
Use bitcoind -daemon or check debug logs at $HOME/.bitcoin/debug.log. Look for errors related to config syntax or binding issues.
Q: Should I back up my bitcoin.conf?
While it doesn't store private keys, backing up your config helps preserve settings after reinstallation or migration.
Final Thoughts
Properly configuring your bitcoin.conf file empowers you with full control over your node’s behavior—enhancing security, performance, and usability. Whether you're running a full archival node or a lightweight pruned setup, taking time to understand each option ensures reliability and protects against unintended exposure.
Always prioritize security: use strong passwords, restrict RPC access, keep software updated, and monitor logs regularly.
👉 Explore secure blockchain infrastructure tools designed for developers and advanced users.