pull down to refresh

This guide details the setup of a Bitcoin Core node on a bare-metal Ubuntu server. It is optimized for my specific hardware: an Optiplex with 24GB of RAM, a 2TB NVMe SSD for performance-critical data, and a 4TB HDD for secondary storage.

Phase 1: OS Installation & Storage Configuration

(Check out my guide on getting bare-metal, headless, Ubuntu 24.04 LTS up and running https://expatriotic.me/ubuntu)
  1. Configure the 2TB NVMe: Set it as the "boot device":
    • A 1G fat32 partition mounted at /boot/efi will be automatically created.
    • Then navigate to where it says "free space" and create an ext4 partition mounted at /.
  2. Configure the 4TB HDD: Create one large ext4 partition mounted at /mnt/bigdata.
This ensures your entire OS and all future I/O-intensive work will run from the NVMe.

Phase 2: Initial Server Setup

Once installed, and log in as your satoshis user.
  1. Update System & Install Tools:
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y ufw fail2ban unattended-upgrades tmux gpg ufw
    
  2. Configure Firewall:
    sudo ufw allow ssh
    sudo ufw allow 8333    # Bitcoin P2P
    sudo ufw enable
    

Phase 3: Bitcoin Core v30.0 Installation & Verification

Here we will use your improved, variable-based method to download and verify the latest version.
1. Download the Binaries & Hashes
# Set the version for easy updates in the future
BITCOIN_VERSION=30.0

cd ~
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
2. Verify the Software (Do Not Skip) This cryptographic check ensures the software is authentic.
# Import developers' GPG keys
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys \
  01EA5486DE18A882D4C2684590C8019E36C2E964 \
  F46018499914761321051F335338D04620E89B4B

# Verify the signature on the hash file
gpg --verify SHA256SUMS.asc SHA256SUMS
Look for a "Good signature" message.
# Check your download against the trusted hash
sha256sum --check --ignore-missing SHA256SUMS
You must see the line: bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz: OK
3. Install the Binaries
tar -zxvf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
sudo mv bitcoin-${BITCOIN_VERSION}/bin/* /usr/local/bin/

Phase 4: Configuration (bitcoin.conf)

This file controls your node. We'll use your user's home directory (~/) for all paths.
  1. Create the Bitcoin directory:
    mkdir -p ~/.bitcoin
    
  2. Create and edit the config file:
    nano ~/.bitcoin/bitcoin.conf
    
  3. Paste the following configuration:
    # --- Bitcoin Core Config ---
    # For a node serving Fulcrum and Ashigaru.
    
    [Network]
    server=1
    txindex=1
    
    [Node]
    prune=0
    
    [RPC]
    # Bind to localhost and set credentials for your indexers
    # Fulcrum/Ashigaru are NOT compatible with rpcauth, use rpcpassword
    rpcbind=127.0.0.1
    rpcport=8332
    rpcuser=satoshis
    rpcpassword=REPLACE_THIS_WITH_A_VERY_STRONG_RANDOM_PASSWORD
    
    [ZMQ (ZeroMQ)]
    # Required for real-time updates to indexers
    zmqpubrawblock=tcp://127.0.0.1:28332
    zmqpubrawtx=tcp://127.0.0.1:28333
    
    [Wallet & GUI]
    disablewallet=1
    
    [Performance]
    # Use 4GB (4096MB) of your 24GB RAM as a cache
    # This will dramatically speed up the IBD
    dbcache=4096
    

Phase 5: Launching the IBD with tmux

This phase covers the initial sync, where tmux is essential for session persistence.
Check out my tmux guide: https://expatriotic.me/tmux
  1. Start a New tmux Session:
    tmux new -s bitcoin
    
  2. Launch bitcoind:
    • Run the daemon in the foreground. This will pipe all log output directly to your tmux window (acting just like tail -f).
      /usr/local/bin/bitcoind -datadir=$HOME/.bitcoin
      
    • Or run the daemon in the background if you prefer.
      bitcoind -daemon
      
  3. Monitor and Detach: You will see the node connect to peers and begin downloading blocks.
    To check the sync status, you'll need to open a new SSH terminal (or a new tmux window with Ctrl+b, c). In that new terminal, run:
    bitcoin-cli getblockchaininfo
    
    Look at the verificationprogress field. It will climb towards 1.0 (which is 100%).
    To detach from your logging session (leaving it running), press Ctrl+b then d. You can now safely log out.
  4. Re-attaching and Monitoring (After Detaching): To check on the sync later, SSH back in and run:
    • tmux attach -t bitcoin (to see the live log again)
    • bitcoin-cli getblockchaininfo (to get a clean status report)
    • tail -f ~/.bitcoin/debug.log (if you prefer to watch the log outside of tmux)

Phase 6: Transitioning to a systemd Service (Post-IBD)

tmux is for the initial sync. Once the node is fully synced (which will take days), we will move it to a systemd service so it runs reliably and auto-starts on boot.
Once the IBD is 100% complete:
  1. Stop the Node Gracefully: Re-attach to your session (tmux attach -t bitcoin) and stop the daemon.
    bitcoin-cli stop
    
    Wait for the process to exit, then type exit to close the tmux session.
  2. Create the systemd Service File:
    sudo nano /etc/systemd/system/bitcoind.service
    
  3. Paste the Service Configuration: Note: Inside a systemd unit file, we must use the full, hardcoded path. Variables like $HOME or ~/ will not work because the service runs in a non-interactive context. I have updated all paths to use your correct home directory: /home/satoshis.
    [Unit]
    Description=Bitcoin Daemon
    After=network-online.target
    Wants=network-online.target
    
    [Service]
    # Run as your 'satoshis' user
    User=satoshis
    Group=satoshis
    
    Type=forking
    PIDFile=/home/satoshis/.bitcoin/bitcoind.pid
    
    # Specify the command to start bitcoind in daemon mode
    ExecStart=/usr/local/bin/bitcoind -daemon \
                                -pid=/home/satoshis/.bitcoin/bitcoind.pid \
                                -conf=/home/satoshis/.bitcoin/bitcoin.conf \
                                -datadir=/home/satoshis/.bitcoin
    
    Restart=on-failure
    RestartSec=30
    TimeoutStopSec=600
    
    # Hardening
    PrivateTmp=true
    ProtectSystem=full
    NoNewPrivileges=true
    PrivateDevices=true
    MemoryDenyWriteExecute=true
    
    [Install]
    WantedBy=multi-user.target
    
  4. Launch Your Node:
    sudo systemctl daemon-reload
    sudo systemctl enable --now bitcoind
    
  5. Verify:
    journalctl -fu bitcoind
    
    Press Ctrl+C to stop following the log.
  6. Quick Health Check:
    sudo systemctl status bitcoind
    
  7. Progress Bar:
    bitcoin-cli getblockchaininfo
    
    This will return a block of JSON data. Look for the "verificationprogress" field. Since your node is already synced, this value should be 1.0 (or very close to it), confirming you are at the chain tip.
  8. Raw Log:
    tail -f ~/.bitcoin/debug.log
    
    This shows you the raw, detailed application log from Bitcoin Core itself. You will see it connect to peers, validate transactions, and announce new blocks as they are found. Just like with journalctl, press Ctrl+C to stop following the log.
Ooooh! would you recommend 'Core' to your friends?
reply
I recommend Bitcoin to my friends.
reply
I have to zap you for this good answer
reply
42 sats \ 1 reply \ @ek 8h
Hey, glad you are still around!
reply
Started writing again so yeah, I'm back. 🤠
reply
I love your shill of this on nostr: "Ready to run Bitcoin Core v30 and make the knotzis go wild?". (https://primal.net/e/nevent1qqs2mzrcxv0mveykdr6s0zz3g0wf5yhrvrt02f63x4jx2t7ejscuthsrrqur8) I do wonder. Is it sensible to recommend running a just released version?
reply
That is a philosophical question above my pay-grade. I didn't write an opinion piece.I just made a simple guide. People can change version numbers as they will.
reply