How to Deploy BTCPay Server: Accept Bitcoin Payments with Zero Platform Fees
BTCPay Server lets you accept Bitcoin and Lightning payments with no platform fees. Only standard Bitcoin network fees apply. Here is how to deploy it with Docker Compose.
BTCPay Server is the most popular self-hosted Bitcoin payment processor. It is non-custodial (you control the keys), charges zero platform fees (network fees still apply) (beyond Bitcoin network fees), and includes built-in point-of-sale, crowdfunding, and donation apps. Here is how to deploy it with Docker Compose on your own server.
Prerequisites
- A server with at least 4GB RAM, 100GB SSD (Bitcoin blockchain requirements)
- A domain name pointed at your server
- Ports 80 and 443 open
- Docker and Docker Compose installed
Step 1: Clone the BTCPay Server Docker Repository
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-dockerStep 2: Configure Your Environment
export BTCPAY_HOST="btcpay.yourdomain.com"
export NBITCOIN_NETWORK="mainnet"
export BTCPAYGEN_CRYPTO1="btc"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage"
export BTCPAYGEN_LIGHTNING="lnd"
export BTCPAY_ENABLE_SSH=true
. ./btcpay-setup.sh -iThe setup script generates a docker-compose file and environment variables. It downloads and starts the Bitcoin full node, Lightning Network node (LND), and the BTCPay Server web interface. Initial blockchain sync takes several hours on a fast connection and up to a day on slower connections. The server is functional during sync but only processes payments once the blockchain is fully synced.
Step 3: Access the Dashboard
Open https://btcpay.yourdomain.com. Create the admin account on first visit. The dashboard shows your store, wallet balance, recent transactions, and the status of your Bitcoin and Lightning nodes.
Step 4: Create a Store and Connect WooCommerce
In BTCPay Server, go to Stores, Create Store. Name your store. Go to Settings, Access Tokens. Create an API key with the required permissions. Install the BTCPay Server plugin for WooCommerce. Enter the BTCPay Server URL and API key. Your WooCommerce store now accepts Bitcoin and Lightning Network payments.
Step 5: Configure Lightning Network
Lightning Network enables near-instant Bitcoin payments with negligible fees. In the BTCPay Server dashboard, go to Lightning, Internal Node. Fund your Lightning node with a small amount of Bitcoin. Open channels to well-connected peers. Your customers can now pay with Lightning: instant confirmation, pennies in fees.
For businesses processing many small transactions (coffee shops, digital goods, tips), Lightning is transformative. On-chain Bitcoin fees can be several dollars. Lightning fees are a fraction of a cent. The customer experience is identical: they scan a QR code, pay, and receive instant confirmation.
Resource Management
The Bitcoin blockchain is over 600GB and growing. Set prune=55000 in your bitcoin.conf to keep the blockchain pruned to 55GB. This is sufficient for BTCPay Server to function. If disk space is a concern, use opt-save-storage as shown above, which prunes aggressively and disables unnecessary services.
VPS1 deploys BTCPay Server with Bitcoin full node, Lightning Network, and WooCommerce integration. We handle the blockchain sync, the wallet security, and the payment processing setup. You start accepting Bitcoin with zero platform fees. Standard Bitcoin network fees apply.
More articles
Self-Hosted Crypto Payment Processors: BTCPay Server, Bitcart, and SHKeeper Compared
Accept Bitcoin and cryptocurrency payments directly with no platform fees, no intermediaries, and no KYC. Here is how BTCPay Server, Bitcart, and SHKeeper compare.
How to Deploy SHKeeper: Accept Crypto Payments with WooCommerce in 30 Minutes
SHKeeper supports Bitcoin, Ethereum, USDT, USDC, and 19+ cryptocurrencies with a free WooCommerce plugin. Zero platform fees -- only standard network fees apply.
How to Automate Server Setup with cloud-init: Never Manually Configure a VPS Again
cloud-init automates server provisioning on first boot. Here is how to use cloud-config YAML to install Docker, create users, and secure your VPS before you even SSH in.