lnbits/docs/devs/installation.md

45 lines
1.5 KiB
Markdown
Raw Normal View History

---
layout: default
parent: For developers
title: Installation
nav_order: 1
---
# Installation
2022-01-14 10:13:02 +00:00
LNbits uses [Pipenv][pipenv] to manage Python packages.
2022-01-14 09:36:18 +00:00
```sh
git clone https://github.com/lnbits/lnbits-legend.git
cd lnbits-legend/
pipenv shell
# pipenv --python 3.8 shell (if you wish to use a version of Python higher than 3.7)
pipenv install --dev
# pipenv --python 3.8 install --dev (if you wish to use a version of Python higher than 3.7)
2022-01-14 09:38:04 +00:00
# If any of the modules fails to install, try checking and upgrading your setupTool module
# pip install -U setuptools
2022-01-14 09:37:27 +00:00
```
## Running the server
2022-01-14 10:23:02 +00:00
Create the data folder and edit the .env file:
2021-11-09 22:41:24 +00:00
mkdir data
2021-11-09 22:45:45 +00:00
cp .env.example .env
sudo nano .env
2022-01-14 10:23:22 +00:00
To then run the server for development purposes (includes hot-reload), use:
2022-01-18 22:29:15 +00:00
pipenv run python -m uvicorn lnbits.__main__:app --host 0.0.0.0 --reload
2022-01-14 10:16:50 +00:00
For production, use:
2022-01-18 22:29:15 +00:00
pipenv run python -m uvicorn lnbits.__main__:app --host 0.0.0.0
2022-01-14 10:15:31 +00:00
You might also need to install additional packages, depending on the [backend wallet](../guide/wallets.md) you use.
E.g. when you want to use LND you have to `pipenv run pip install lndgrpc` and `pipenv run pip install purerpc`.
Take a look at [Polar][polar] for an excellent way of spinning up a Lightning Network dev environment.
2022-01-14 10:10:52 +00:00
**Note**: We reccomend using <a href="https://caddyserver.com/docs/install#debian-ubuntu-raspbian">Caddy</a> for a reverse-proxy, if you want to serve your install through a domain, alternatively you can use [ngrok](https://ngrok.com/).