A payment processor does more than take a fee. It holds your funds, sees your customers and can freeze your account. BTCPay Server is free, open-source software that lets you accept Bitcoin directly into a wallet you control. It runs on a VPS, and this guide shows the standard Docker-based install.
What you need
- A VPS with 2 vCPU, 4 GB of RAM and 80 GB of disk if you run a pruned Bitcoin node alongside it. Less if you point it at an external node.
- A domain name, for example
pay.example.com, with an A record pointing to the server. - Ubuntu 22.04 or 24.04 with the Docker installed and a hardened SSH setup.
Step 1: point the domain
Create the A record first and wait for it to resolve. The installer requests a Let's Encrypt certificate for the name, and it will fail if the record is missing. Our DNS guide covers it.
Step 2: run the official installer
sudo su -
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
export BTCPAY_HOST="pay.example.com"
export NBITCOIN_NETWORK="mainnet"
export BTCPAYGEN_CRYPTO1="btc"
export BTCPAYGEN_LIGHTNING="clightning"
export BTCPAYGEN_REVERSEPROXY="nginx"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s"
export LETSENCRYPT_EMAIL="you@example.com"
. ./btcpay-setup.sh -i
The opt-save-storage-s fragment prunes the blockchain to save disk. The initial sync can take many hours, and the store works for invoices once the node has caught up. Lightning is optional, so leave out that line if you do not want it.
Step 3: create the admin and a store
Open your domain, register the first account (it becomes the server admin), then disable public registration under Server Settings. Create a store and set its default currency.
Step 4: connect a wallet you control
Generate the wallet on a hardware wallet or your own device, and paste only the public key (the xpub) into BTCPay. Do not generate a hot wallet on the server if you can avoid it, because funds then depend on the server staying safe. Payments go straight to addresses derived from your public key.
Step 5: test and integrate
Create a test invoice and pay a small amount. Then install a plugin for your shop (WooCommerce, Shopify, a custom API key) following the BTCPay documentation.
Keep it safe
- Enable two-factor authentication on the admin.
- Back up the BTCPay data with the built-in backup script and store it off the server and encrypted.
- Update with
btcpay-update.sh, after reading the release notes. - Run the firewall with only SSH, 80 and 443 open.
To learn which coin suits your customers, read the cheapest crypto for payments. Running your own backing node? See run a Bitcoin node.