
How to Set Up BTCPay Server on a VPS and Accept Bitcoin With Zero Fees
Step-by-step guide to deploying BTCPay Server on a VPS, connecting your wallet, enabling Lightning, and accepting Bitcoin payments with no processor fees.
A merchant processing $50,000 monthly through Stripe pays roughly $1,450 in fees. With BTCPay Server, that processing fee drops to zero. You still pay for hosting (about $8-30 per month) and Bitcoin network fees, but the payment processor itself takes nothing.
This guide walks through every decision point for setting up BTCPay Server on a VPS, from choosing your provider to accepting your first payment. No developer background required, though you'll need to be comfortable with basic command-line work.
What You're Actually Building
BTCPay Server is open-source software that turns your rented server into a complete payment processor. When a customer pays, funds go directly to your wallet, not to an intermediary who sends them to you later. You control the infrastructure, the keys, and the data.
The standard deployment uses Docker, which bundles everything (Bitcoin node, Lightning node, web interface, database) into containers that the setup script manages automatically. This is the approach BTCPay's documentation recommends for production use.
Choosing Your VPS Provider
You need a Linux server with:
- At least 2 GB RAM (4 GB is better for Lightning)
- 80 GB SSD minimum (the Bitcoin blockchain grows over time)
- Ubuntu 22.04 LTS
- KVM virtualization, not OpenVZ (OpenVZ doesn't work with Docker properly)
Common providers include LunaNode, DigitalOcean, and Hetzner. Expect to pay $10-30 monthly for adequate specs. LunaNode offers a semi-automated option through launchbtcpay.lunanode.com if you want to skip some manual steps, though following the full process gives you better understanding of what's running.
One decision to make early: are you running the Bitcoin node on this same VPS, or connecting to an external node you already operate? Running everything on one server is simpler but requires more storage. Using an external node reduces VPS requirements but adds network configuration complexity.
Setting Up Your Domain
Before touching the server, point a domain (or subdomain) to your VPS. You'll need the VPS's IP address, which you get after provisioning.
In your DNS settings, create an A record:
- Host: `btcpay` (or `@` for root domain)
- Points to: your VPS IP address
- TTL: 300 seconds (or lowest available)
DNS propagation can take minutes to hours. You can check progress with `dig yourdomain.com` or online DNS checkers.
Initial Server Configuration
SSH into your VPS as root:
```
ssh root@your-vps-ip
```
Update the system first:
```
apt update && apt upgrade -y
```
Open the required ports in your firewall. BTCPay needs:
- Port 80 (HTTP, for Let's Encrypt certificate issuance)
- Port 443 (HTTPS, for the web interface)
- Port 9735 (Lightning peer connections, if you're enabling Lightning)
If you're using UFW:
```
ufw allow 80
ufw allow 443
ufw allow 9735
ufw enable
```
Running the BTCPay Setup Script
Create a directory and clone the BTCPay Docker repository:
```
mkdir BTCPayServer
cd BTCPayServer
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
```
Now set your environment variables. This is where you configure what gets installed:
```
export BTCPAY_HOST="btcpay.yourdomain.com"
export NBITCOIN_NETWORK="mainnet"
export BTCPAYGEN_CRYPTO1="btc"
export BTCPAYGEN_REVERSEPROXY="nginx"
export BTCPAYGEN_LIGHTNING="clightning"
```
Let's break down what each does:
BTCPAY_HOST: Your domain. The setup script uses this to configure nginx and obtain an SSL certificate.
NBITCOIN_NETWORK: Use "mainnet" for real money, "testnet" for testing without financial risk.
BTCPAYGEN_CRYPTO1: Which cryptocurrency to support. "btc" is Bitcoin. You can add more with BTCPAYGEN_CRYPTO2, etc.
BTCPAYGEN_REVERSEPROXY: "nginx" handles HTTPS and routes traffic. This is the standard choice.
BTCPAYGEN_LIGHTNING: Your Lightning implementation. "clightning" (Core Lightning) and "lnd" are the main options. Core Lightning uses slightly fewer resources. If you don't want Lightning initially, omit this line entirely.
Run the setup:
```
. ./btcpay-setup.sh -i
```
This script installs Docker and Docker Compose, downloads the necessary containers, configures everything to start on boot via systemd, and adds BTCPay utilities to your path. Depending on your VPS speed, initial setup takes 10-30 minutes.
The Sync Wait
Here's where patience matters. BTCPay runs a full Bitcoin node, which needs to download and verify the entire blockchain. As of 2026, that's several hundred gigabytes of data to process.
You can check sync progress at your BTCPay URL (https://btcpay.yourdomain.com). The interface will show sync status. Initial sync on a modest VPS typically takes 24-72 hours, sometimes longer.
Don't skip this. Your server can't verify payments until the node is fully synced.
Creating Your Account and Store
Once sync completes, visit your BTCPay URL and register the first account. The first account automatically gets server administrator privileges.
After logging in, create a store:
- Click "Create Store"
- Give it a name
- Set your default currency (for displaying prices)
- Choose your pricing source for exchange rates
Connecting Your Wallet
This is crucial: BTCPay generates payment addresses, but funds go to a wallet you control. You have two main approaches.
Option 1: Hot Wallet (Keys on Server)
BTCPay can generate a wallet for you. Go to Store > Wallets > Bitcoin > Setup > Create new wallet. This is convenient but means your private keys live on the VPS. If the server is compromised, funds are at risk.
Option 2: Watch-Only Wallet (Keys on Hardware Wallet)
The safer approach for meaningful amounts. You provide your hardware wallet's extended public key (xpub), and BTCPay derives receiving addresses from it. Funds arrive directly in your hardware wallet.
To extract your xpub from a Ledger:
- Open Ledger Live
- Go to your Bitcoin account settings
- Find "Extended public key" or export xpub
In BTCPay, go to Store > Wallets > Bitcoin > Setup > Connect existing wallet > Enter xpub. Paste your extended public key.
BTCPay will now generate unique addresses for each invoice, all controlled by your hardware wallet.
Setting Up Lightning (Optional but Recommended)
If you included BTCPAYGEN_LIGHTNING in your setup, Lightning is already installed. But it's not yet usable.
Go to Store > Lightning > Settings. You'll see your Lightning node information.
Lightning requires channel funding:
- Find your Lightning node's on-chain address in the settings
- Send Bitcoin to this address (start small, maybe 100,000-500,000 sats)
- Wait for confirmations
Once funded, you need to open channels. You can:
- Connect to specific peers manually (you'll need their node URI)
- Use BTCPay's suggested connections
- Open channels through services like Lightning Terminal
Channel management is its own skill. Start with one or two channels to well-connected nodes. Each channel ties up capital but enables payments up to that capacity.
Lightning payments typically cost under one cent, compared to variable on-chain fees that can spike during network congestion. For high-frequency or small payments, Lightning dramatically reduces costs.
Creating Your First Invoice
Test everything before going live. In your store, click "Create Invoice." Set an amount, and BTCPay generates a payment page with:
- Bitcoin address (for on-chain payment)
- Lightning invoice (if enabled)
- QR codes for both
- Countdown timer
- Real-time exchange rate
Pay this invoice from another wallet. Watch it confirm. Verify funds arrived where expected.
Connecting to Your E-commerce Platform
BTCPay integrates with major platforms.
WooCommerce
- Install the "BTCPay for WooCommerce" plugin from WordPress
- In BTCPay, go to Account > Manage Account > API Keys
- Create a new API key with appropriate store permissions
- In WooCommerce, go to Settings > Payments > BTCPay Server
- Enter your BTCPay URL, store ID, and API key
Shopify
Shopify integration requires adding the Shopify fragment to your BTCPay deployment. SSH back into your VPS:
```
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="shopify"
. ./btcpay-setup.sh -i
```
Then configure the BTCPay Shopify app within your Shopify admin to connect the two systems.
Simple Payment Links
For simpler setups, BTCPay's Point of Sale app or payment buttons work without full e-commerce integration. You can embed payment buttons on any website or share direct payment links.
Ongoing Maintenance
Self-hosting isn't set-and-forget. Plan for:
Monitoring: Check periodically that your node stays synced and services are running. BTCPay shows node status in the dashboard.
Updates: BTCPay releases updates regularly. From your server:
```
cd BTCPayServer/btcpayserver-docker
./btcpay-update.sh
```
Backups: Back up your wallet seed (stored in BTCPay for hot wallets) and channel state (for Lightning). Lightning channel backups are particularly important; losing them can mean losing channel funds.
Security: Keep Ubuntu updated. Consider fail2ban for SSH protection. Review logs periodically.
Understanding the Real Costs
BTCPay's zero-fee claim is accurate for processor fees, but not for total cost of acceptance:
- VPS hosting: $10-30/month
- Domain: $10-15/year
- Bitcoin on-chain fees: Variable, paid by you when consolidating UTXOs or by customers when paying (depending on invoice settings)
- Lightning fees: Minimal (fractions of a cent) but channel opening/closing costs on-chain fees
- Your time: Initial setup takes several hours; ongoing maintenance takes maybe an hour monthly
Compare that to card processing at 2.9% plus $0.30 per transaction. At low volumes, card processing might actually be cheaper when you factor in your time. At higher volumes, BTCPay savings become substantial.
When This Makes Sense
BTCPay Server on a VPS fits best when:
- You process enough volume that percentage fees hurt
- You value payment privacy (no third party sees your transactions)
- You want direct settlement to your own wallet
- You're comfortable with basic server maintenance or have someone who is
If you want Bitcoin acceptance without the operational overhead, third-party BTCPay hosts exist where someone else manages the infrastructure while you still avoid percentage-based processor fees. You trade some control for convenience.
Moving Forward
Your BTCPay Server is now a complete payment processor. Customers can pay in Bitcoin, funds go directly to your wallet, and no intermediary takes a cut. You're responsible for the infrastructure, but you also control it completely.
Start with small amounts. Get comfortable with the flow. Then expand. The same server that handles a few payments monthly can scale to handle thousands.