Linux

Where Does LNbits Store Data?

LNbits keeps env config with a SQLite database or Postgres plus extension data. Backup set and migration.

Last updated

LNbits splits deployment config from wallet data. The hidden env file in the install root holds funding sources and admin switches, with many values migrating into the database settings table after first run. Wallet and extension data live in the data folder or Postgres depending on setup.

That split decides the backup. The env file plus the database file or dump plus the data directory move as one set. SQLite filenames shifted across versions, so confirm the live name rather than trusting old guides. Docker runs as a fixed UID, so fix ownership after host copies.

Where LNbits stores this, by platform

Linux
<install-root>/data/database.sqlite3

SQLite wallet store with extension data in the data tree; older builds used sqlite.db or data.sqlite3 names. Env at <root>/.env with funding and admin settings. Postgres setups dump instead. Superuser ID in .super_user beside it.

Frequently asked questions

What do I back up for LNbits?

Copy the .env file with the data directory or a Postgres dump. Wallets, extensions and settings travel in that set. Test restores on a spare host before trusting a single copy with real funds.

Where is the LNbits database file?

In the data folder as database.sqlite3 on current builds; older ones used different SQLite names. Check the data folder listing on your install. Postgres deployments hold the same content server side instead.

How do I move LNbits SQLite to Postgres?

With the bundled conversion script from the project tools directory. Stop the app first, convert, then point the database URL at Postgres. Keep the SQLite file until the new backend verifies.

Notice an outdated path? Let us know.