Skip to content

Deploying Extensions

Overview of how LNbits extensions are packaged, distributed, and installed - from local development to the official registry.

LNbits extensions can be deployed in several ways depending on your use case - from dropping a folder on disk during development to publishing on the official registry for the community.

Quick start

  1. Build your extension following the extension structure
  2. Test locally by dropping it into the extensions folder
  3. Publish to a remote manifest or the official registry

Extension lifecycle

Every extension goes through three stages:

Build → Deploy → Activate
  • Build - write the code, config.json, migrations, and templates (Building Extensions)
  • Deploy - make the extension available to an LNbits instance (this section)
  • Activate - users enable the extension in their dashboard

config.json

Every extension must include a config.json at its root:

json
{
  "name": "My Extension",
  "short_description": "A brief description of what it does",
  "tile": "/my_extension/static/image/tile.png",
  "contributors": ["your-github-username"],
  "min_lnbits_version": "1.0.0",
  "payment_hash": ""
}

Required fields

FieldDescription
nameDisplay name shown in the UI
short_descriptionOne-line description shown on the extension tile
tilePath to the tile image (PNG, displayed in the extensions list)
contributorsList of GitHub usernames
min_lnbits_versionMinimum LNbits version required to run this extension

Optional fields

FieldDescription
payment_hashFor paid extensions - the Lightning payment hash required for installation
max_lnbits_versionMaximum compatible LNbits version
iconIcon name from the Quasar icon set

Hard rules

Extension rules

  1. No new Python dependencies - use only packages already in LNbits' pyproject.toml
  2. Database namespace - all tables must be prefixed with ext_<extension_id>. (e.g., ext_my_extension.items)
  3. No core modifications - extensions must not modify LNbits core files
  4. Migrations must be idempotent - they should be safe to run multiple times

Three-state activation

Extensions have three states at the instance level:

StateMeaning
Not installedExtension code is not present on the instance
Installed (disabled)Code is present, but the extension is not active for any user
Installed (enabled)Extension is active and available - individual users can toggle it on/off in their dashboard

Admins control the first two states. Users control whether an enabled extension appears in their own dashboard.

Database namespace

Each extension gets its own database schema/namespace:

python
# In your __init__.py
db = Database("ext_my_extension")

All tables are created under the ext_my_extension schema. This ensures:

  • No table name collisions with core or other extensions
  • Clean uninstall - the namespace can be dropped entirely
  • Clear ownership - you always know which extension owns which data

Data preservation

Uninstalling an extension does not remove its database tables. User data is preserved so it can be restored if the extension is reinstalled.

Deployment methods

MethodBest forDetails
Local filesystemDevelopment and testingDrop the folder into lnbits/extensions/
Remote manifestDistribution to specific instancesHost a JSON manifest with download URLs
Official registryPublic distributionSubmit to the LNbits extension registry
Custom marketplaceEnterprise / white-labelReplace or extend the default manifest list
Auto-installAutomated deploymentsPre-configure extensions via environment variables
Forked distributionBranded / bundled deploysBundle extensions directly into a custom LNbits build

News · Shop · SaaS · Telegram · Released under the MIT License.