Passionate about Bitcoin and convinced that education is the key, I wish to share with you the little knowledge I have and thus contribute to the adoption of Bitcoin. Otherwise, I'm a big fan of Pink Floyd, I'm learning to code, and I make memes. Looking forward to meeting you at the next meet-up! I am the creator of the training course BTC 205 - Non-KYC Purchase Solution.
What is Phoenixd?
Operating principle
- Lightning** channels: Open, close and manage automatically as needed
- Incoming/outgoing liquidity**: Automatic provisioning via splicing and channel opening
- Fee credit** : Small payments insufficient to justify a channel are stored as a provision for future charges
Phoenixd benefits
Installing Phoenixd
Prerequisites
- Linux server**: VPS or local machine with stable connection
- OpenJDK 21** : Java runtime environment
- Stable Internet connection**: For synchronization with the Lightning network
- Domain name** (optional) : For secure HTTPS access to the API
Download and installation
# For Linux x86_64 # Replace with the latest release wget https://github.com/ACINQ/phoenixd/releases/download/v0.6.1/phoenixd-0.6.1-linux-x64.zip unzip -j phoenixd-0.6.1-linux-x64.zip chmod +x phoenixd phoenix-cli
./phoenixd
This software is self-custodial, you have full control and responsibility over your funds. Your 12-words seed is located in /home/<user>/.phoenix, make sure to do a backup or you risk losing your funds. Do not share the same seed with other phoenix instances (mobile or server), it will cause issues and channel force closes.
Continuous liquidity Liquidity management is fully automated. When receiving a Lightning payment that doesn't fit in your existing channel: - If the payment amount is large enough to cover mining fees and service fees for automated liquidity, then your channel will be created or enlarged right away. - If the payment is too small, then the full amount is added to your fee credit, and will be used later to pay for future fees. The fee credit is non-refundable.
I understand for each confirmation.sudo nano /etc/systemd/system/phoenixd.service
[Unit] Description=Phoenixd - Minimalist Lightning node After=network.target [Service] User=your_user WorkingDirectory=/home/your_user ExecStart=/home/your_user/phoenixd Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload sudo systemctl enable phoenixd sudo systemctl start phoenixd
auto-liquidity at 2m satConfiguration and security
Configuration file
~/.phoenix/phoenix.conf with the essential parameters:# Network (mainnet by default) chain=mainnet # Size of automatic channels and requested liquidity amount (in satoshis) auto-liquidity=2000000 # API configuration http-bind-address=127.0.0.1 http-bind-port=9740 http-password=auto_generated_password http-password-limited-access=limited_password
auto-liquidity: Size of automatically opened channels (default: 2M Sats)- http-password`: Admin password for API (invoice creation AND payment dispatch)
- http-password-limited-access`: Restricted password (invoice creation only)
Secure access with HTTPS
http://127.0.0.1:9740). To use your node from outside (mobile applications, other servers, web integrations), you need to configure secure HTTPS access.Internet → nginx (port 443 HTTPS) → Phoenixd (port 9740 HTTP local)
- Prove your server's identity** (prevents man-in-the-middle attacks)
- Enables HTTPS** encryption: all data, including your API passwords, is encrypted during transport
- Issued free of charge** by Let's Encrypt via the certbot tool
- Secure access to the API from the Internet**
- Encrypt your API** passwords during transport (to prevent them being transmitted in clear text)
- Integrate Phoenixd** into external applications requiring HTTPS
- Compliance with security standards** for financial APIs
sudo apt install nginx certbot python3-certbot-nginx sudo nano /etc/nginx/sites-available/phoenixd.conf
server { listen 80; server_name phoenixd.your-domain.com; location / { proxy_pass http://127.0.0.1:9740; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; } }
sudo ln -s /etc/nginx/sites-available/phoenixd.conf /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d phoenixd.your-domain.com
Function test
./phoenix-cli getinfo ./phoenix-cli getbalance
Using the API
First reception test
curl -X POST http://localhost:9740/createinvoice \ -u :your_password \ -d description='First test' \ -d amountSat=100000
Understanding the automatic liquidity mechanism
# Payment received: 100,000 sats # Channel created: 2,115,000 sats total capacity # Liquidity fee: 24,439 sats # Final balance: 75,561 sats
- Service charge**: 1% of channel capacity (2,115,000 Sats) = 21,150 Sats
- Mining fees**: ~3,289 Sats (for On-Chain transaction)
- Total**: 24,439 Sats automatically deducted
# View details of all channels ./phoenix-cli listchannels # Important output: # "toLocal": 75561000 (your balance in milli-sats) # "toRemote": 2039439000 (ACINQ's balance) # Total channel: 2,115,000 sats
journalctl -u phoenixd -f
./phoenix-cli listchannels
Complete API operations
# Create an invoice curl -X POST http://localhost:9740/createinvoice \ -u :your_password \ -d description='Test payment' \ -d amountSat=100000 # Send a payment (routing fee 0.4%) curl -X POST http://localhost:9740/payinvoice \ -u :your_password \ -d invoice='lnbc...' # Check balance curl http://localhost:9740/getbalance \ -u :your_password # Send on-chain funds (in case of channel closure) ./phoenix-cli sendtoaddress \ --address bc1q... \ --amountSat 50000 \ --feerateSatByte 12
- Receipt**: 1% + mining fee for automatic liquidity
- Shipping**: 0.4% routing fee on the Lightning network
phoenix.conf :webhook-url=https://your-app.com/webhook-phoenixd webhook-secret=votre_secret_de_verification
Advanced applications
LNURL integrations
curl -X POST http://localhost:9740/lnurlpay \ -u :your_password \ -d lnurl=LNURL1DP68GURN8GHJ7MRWW4EXCTN... \ -d amountSat=100
curl -X POST http://localhost:9740/lnurlwithdraw \ -u :your_password \ -d lnurl=lightning:LNURL1DP68GURN8GHJ7MRW...
curl -X POST http://localhost:9740/lnurlauth \ -u :your_password \ -d lnurl=lnurl1dp68gurn8ghj7um5v93kket...
Integration with LNbits
LNBITS_BACKEND_WALLET_CLASS=PhoenixdWallet PHOENIXD_API_ENDPOINT=http://localhost:9740/ PHOENIXD_API_PASSWORD=your_password_phoenixd
Custom applications
Safety and best practices
Access protection
Essential backups
Monitoring and maintenance
journalctl -u phoenixd -f # Real-time logs ./phoenix-cli getinfo # Node status
Comparison with alternatives
Phoenixd vs Phoenix standard
- ✅ Immediate installation, zero configuration
- ✅ Interface mobile intuitive
- ✅ Same auto-save as Phoenixd
- ❌ No API for developers
- ❌ No access to detailed logs
- ✅ HTTP API for integrations
- ✅ Full access to logs
- ✅ Personal infrastructure
- ❌ Requires technical skills
- ❌ Server maintenance required
Phoenixd vs LND/Core Lightning
- ✅ Total control, full Lightning protocol
- ✅ Large community, mature ecosystem
- ❌ Complex manual liquidity management
- ❌ Large learning curve
- ✅ Automatic liquidity management (like Phoenix mobile)
- ✅ API for developers
- ✅ Simplified configuration
- ❌ Uses ACINQ as LSP (no independent routing)
- ❌ Less flexible than complete nodes
Solving common problems
API access problems
-
Check the password in the file
~/.phoenix/phoenix.conf -
Check authentication format
-u:password -
Make sure Phoenixd is running (
./phoenix-CLI getinfo)
- Check that Phoenixd is listening on the correct port (9740)
- Test local access before configuring HTTPS
- Check logs:
journalctl -u phoenixd -f
Liquidity problems
-
Check that the amount exceeds the minimum threshold (~30k Sats)
-
Consult logs to identify channel errors
-
Restart Phoenixd if necessary
Conclusion
- Integrate Bitcoin Lightning into your applications
- Avoid the complexity of Lightning channel management
- Benefit from a self-hosted infrastructure
- A simple, reliable API
Useful resources
Official documentation
- GitHub Phoenixd** : github.com/ACINQ/phoenixd - Source code and releases
- Phoenix Server** site: phoenix.acinq.co/server - Full documentation
- FAQ Phoenixd** : phoenix.acinq.co/server/faq - Frequently asked questions
Community support
- GitHub Issues** : github.com/ACINQ/phoenixd/issues - Technical support
- Twitter ACINQ** : @ACINQ_co - News and announcements
Author
This tutorial has been written by Pierre
You can say thanks by tipping the professor.
Credits
This tutorial has not been proofread yet
The original content has been translated by AI, but human review is necessary to ensure its accuracy.
3 419 sats1 710 sats855 satsEvery content on the platform is the result of a collaborative effort: each lesson, translation, and revision is made possible by the work of contributors. For this reason, we are always looking for proofreaders who can review our content in many languages. If you want to participate in the proofreading process, please reach out in our Telegram group and read our tutorial. We remind you that this content is open-source - licensed under CC BY-SA - so it can be freely shared and used, as long as the original source is credited.
