How to setup a LNbits instance on your own machine
I've seen lately many people that want to start play with LNbits.
And many are noobs in running nodes, or don't have already channels open, their nodes are not well prepared, running behind Tor etc.
So here is a quick guide how to install, configure and run a LNbits instance ON ANY PC WITH LINUX.
- If you do not have a LinuxOS machine ready, I suggest to take whatever old laptop or PC with min 4GB RAM and install DebianOS on it (or whatever other Linux you want). I prefer Debian because is pure linux, clean, fast, no bullshit and is the most compatible with all repositories. Set a static local IP for that machine. Install ufw firewall and open the port 443 in it.
- Install LNbits using poetry method. Are just few lines copy/paste, no need to be a super linux coder to use them. Any windoze user could do it :) Do not start yet the lnbits! Must be configured first.
- Use caddy option to configure the https access to your LNbits. Is the most easier method and clean. Use a subdomain for your LNbits instance like lnbits.mydomain.com or bank.mydomain.com
- Open port 443 (https) on your router and forward it to your local machine IP that host your LNbits instance.
- Go to your domain admin web and edit DNS records to contain A record for your lnbits.mydomain.com for the IP you have on your router. If you have dynamic IP, you could use any DynDNS app to configure it using CNAME in your DNS.
- Edit LNbits .env file and activate the adminUI extension so you could manage it directly in browser.
- Start LNbits with the siomple command "poetry run lnbits" (run in lnbits-legend folder) and in the startup console you will see the link to the adminUI. Copy and paste into your browser and start configuring your LNbits.
- You will have to setup: funding source, users, authorized users to access your LNbits. Is good to limit the public access only to the users you create them.
- As funding source, if you do not run your own LN node (that you can link it to your LNbits), you can use many simple funding sources like: lntxbot, lntipbot, lnpay.co, openNode.com etc. With https://www.lnpay.co/ is very easy to setup and they have good servers, you can open a free account if you do not have too much traffic.
- If you do not want to keep the funds in these custodial funding sources, you can setup the LNbits extension scub and forward all the sats automatically to an external address. Or do it manually when you consider is the proper time. But anyways, use these custodial funding sources as testing playground, not for production cases. You can change the funding source anytime from adminUI, without any other changes in your LNbits.
More about getting started with LNbits, here is a detailed guide (in 3 languages).