Take Bitcoin Payments on Your Own Site with BTCPay Server and DuckDNS
This is how I make BTCPay Server reachable on the public internet with a DNS name. Someone on your site picks an item, pays in Bitcoin, and the payment lands in the wallet on your BTCPay Server. Then you move those sats off the server into cold storage.
I am doing this on a Start9 plug-and-play node and a Start9 router running StartWRT. Both of those have their own guides: router setup, guest VPN, inbound VPN, and Bitcoin port 8333.
The DNS part is not only for BTCPay. If you want any service on the Start9 server reachable from the public internet, dynamic DNS is the easy path. You could host your own email on a subdomain, a SimpleX server for private messages, or Jitsi for video calls. Later videos will cover those. If you watch this one, you can swap BTCPay for another service. The app settings change. The DNS and router steps stay the same.
A public server that holds Bitcoin is a target. Older BTCPay installs have been hit because people know there can be a wallet behind the checkout. Keep BTCPay updated. Do not leave a balance sitting on the hot wallet. Withdraw to cold storage. If you run this yourself, you own that risk.
1. Install BTCPay Server
On the Start9 server, open the Marketplace and the Start9 registry. Install BTCPay Server and let it finish. You will come back to it after the name and the router are ready.
2. Claim a DuckDNS name
Go to duckdns.org and sign in. Pick a subdomain and add the domain. I used a name along the lines of mybtcpayserver.duckdns.org. DuckDNS gives you an API token. That token stays private. Do not paste it into a screenshot or a chat.
3. Point dynamic DNS at your home connection
Open router.lan and sign in to StartWRT. Go to WAN settings, then Dynamic DNS.
- Enable dynamic DNS.
- Select DuckDNS.
- Paste the API token.
- Set the hostname to the DuckDNS name you just created.
- Save.
Your home IP can change. DuckDNS is what keeps that name pointed at the connection you actually have.
4. Let the Start9 server open its own ports
Start9 can talk to the router and open the ports a service asks for. On the router, open connected devices and select the Start9 server. Enable allow automatic port forwarding and save. You are not hand-publishing every port. BTCPay will request the one it needs when you attach the public name.
5. Create the store and a wallet
Back on the Start9 server, open the BTCPay UI once it is running and synced.
- Create an account.
- Name the store. I called the demo store test.
- Set the default currency. I used USD.
- Set the price source. Kraken is fine.
- Create the store.
- Set up a wallet. For the demo I created a new hot wallet on the server and pressed done.
A hot wallet is convenient for a test payment. It is a bad place to store a balance. When you are done testing, send the coins out. BTCPay can also build a PSBT so a hardware wallet signs the withdrawal instead of the server.
6. Attach the public domain
In BTCPay, open Interfaces and the web UI button. At the top right, press Add domain.
- Choose a public domain.
- Leave the certificate authority on Let's Encrypt.
- Paste the DuckDNS hostname and save.
- Turn the domain on, press Test, then Done.
The port shows up on the router by itself. Go back to that device on StartWRT and you should see the check mark. Press done.
7. Build a point of sale
In BTCPay, open Plugins. You can use a pay button, a point of sale, or crowdfunding. I used Point of Sale.
- Create one. A generic service is enough to test.
- Add the items you actually sell and adjust how the page looks. I left taxes off and did not request customer information.
- Save.
The admin page still has a local address. The DuckDNS name is the public one. If you open that name while signed out, BTCPay asks you to log in. That is the dashboard, just reached over the internet instead of the LAN.
The page customers should see is different. Open the point of sale and press View. Copy that URL. In a private window it loads the shop, not a login. Mine was a public page where someone could buy tea.
8. Take a payment
I picked green tea. BTCPay showed a QR code, a $1 amount, the exchange rate, a recommended fee, and a Bitcoin address. I scanned it with a wallet on my phone and sent. Payment received showed up immediately. The invoice was not settled yet, because it had no confirmations, but the payment was there.
Back in the admin dashboard, the invoices are listed. Open one and you get the invoice ID, which site it came from, the transaction ID, and the address. You can mark it settled or invalid. Both of my test payments were sitting there, including one I forgot to film the first time.
9. Withdraw it
Go to Wallets, open Bitcoin, and use the Send tab.
- Paste a destination address. For the recording I used an address from another hot wallet. For real money, that destination should be cold storage.
- Enter the amount, or take the entire balance.
- I subtracted the fee from the amount and set the fee rate to 2 sat/vB for the demo.
- Sign the transaction and broadcast it.
The other path is the one I want for anything that matters. Create a PSBT, download it or show the QR code, and sign it on a hardware wallet before it is broadcast. The server should not be the thing holding the keys long term.
After broadcast, the wallet shows the outgoing transaction as pending. Mine was about 3,200 sats. That is the loop: public checkout, Bitcoin in, then off the server.
Keep it updated and empty
People attack public BTCPay servers because they know a wallet can be sitting behind the checkout. Keep the app updated. Sweep the balance to cold storage. A server on the internet that holds funds is a real risk, and running your own infrastructure means you are the one who has to be careful.
Hardware: The router is at store.start9.com, and the Start9 server is in the same store. Code BNC5 takes 5% off. The link is in the video description.
Want a hand putting a checkout on your own node?
I do private one-on-one sessions for Bitcoin and digital security. Reach me through pathtobitcoin.xyz.
Book a 1:1 Coaching SessionWatch the Video Walkthrough
DuckDNS, the StartWRT dynamic DNS setting, a public point of sale, a $1 tea payment, and the withdrawal.