2020-05-04 15:20:36 +00:00
---
layout: default
parent: For developers
title: Installation
nav_order: 1
---
2021-06-09 15:07:42 +00:00
# Installation
2020-05-04 15:20:36 +00:00
2019-12-13 16:56:19 +00:00
The application uses [Pipenv][pipenv] to manage Python packages.
2020-06-12 18:58:37 +00:00
While in development, you will need to install all dependencies:
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:37:27 +00:00
# pip install -U setuptools (if any of the modules fails to install, try checking and upgrading your setupTool module)
```
2021-01-02 21:55:52 +00:00
2020-10-02 17:53:55 +00:00
You will need to copy `.env.example` to `.env` , then set variables there.
2019-12-13 16:56:19 +00:00
2020-06-12 18:58:37 +00:00
![Files ](https://i.imgur.com/ri2zOe8.png )
2019-12-13 16:56:19 +00:00
2020-09-03 17:53:22 +00:00
You might also need to install additional packages, depending on the [backend wallet ](../guide/wallets.md ) you use.
2020-10-13 08:31:53 +00:00
E.g. when you want to use LND you have to `pipenv run pip install lndgrpc` and `pipenv run pip install purerpc` .
2020-06-12 18:58:37 +00:00
2020-09-03 17:53:22 +00:00
Take a look at [Polar][polar] for an excellent way of spinning up a Lightning Network dev environment.
2020-05-04 15:20:36 +00:00
2021-06-09 15:07:42 +00:00
## Running the server
2019-12-13 16:56:19 +00:00
2021-11-09 22:45:45 +00:00
LNbits uses [FastAPI][fastapi] as an application server.
Before running the server for the first time, make sure to create the data folder and edit the .env file:
2021-06-20 04:30:32 +00:00
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
2021-06-20 04:30:32 +00:00
To then run the server, use:
2020-06-12 18:58:37 +00:00
2021-11-09 22:44:11 +00:00
pipenv run python -m uvicorn lnbits.__main__:app --reload
2019-12-13 16:56:19 +00:00
2021-06-09 15:07:42 +00:00
**Note**: You'll need to use _https_ for some endpoints and/or extensions. You can use [ngrok ](https://ngrok.com/ ) for that. Follow the installation instructions on the website and when it's all set you can run:
2019-12-13 16:56:19 +00:00
2021-11-09 22:41:24 +00:00
./nrok http 5000
2021-06-09 15:07:42 +00:00
this will give you an _https_ tunnel for the _localhost_ , use that URL for navigating to LNBits.
2020-09-03 17:53:22 +00:00
2021-06-09 15:07:42 +00:00
## Frontend
The frontend uses [Vue.js and Quasar][quasar].
2020-09-03 17:53:22 +00:00
2020-09-14 00:31:05 +00:00
[quart]: https://pgjones.gitlab.io/
2020-09-03 17:53:22 +00:00
[pipenv]: https://pipenv.pypa.io/
[polar]: https://lightningpolar.com/
[quasar]: https://quasar.dev/start/how-to-use-vue