This guide provides instructions for building and running the MostroP2P application using Docker and Docker Compose.
Ensure you have Docker and Docker Compose installed on your machine. You can download Docker from here and Docker Compose from here.
You need to have a LND node running locally. We recommend using Polar for this.
The compose.yml
sets up the following services:
mostro
: the MostroP2P servicenostr-relay
: the Nostr relay
To build and run the Docker container using Docker Compose, follow these steps:
-
Clone the repository:
git clone https://github.com/MostroP2P/mostro.git
-
Ensure you have the
settings.toml
configuration file and themostro.db
SQLite database in aconfig
directory (acording to thevolumes
section in compose.yml file). If you don't have those files from a previous installation, then the first time they will be created as follows:mkdir docker/config cp docker/settings.docker.toml docker/config/settings.toml cp docker/empty.mostro.db docker/config/mostro.db
Don't forget to edit
lnd_grpc_host
,nsec_privkey
andrelays
fields in theconfig/settings.toml
file. -
Set the
LND_CERT_FILE
andLND_MACAROON_FILE
to the paths of the LND TLS certificate and macaroon files on thedocker/.env
file. These files will be copied to thedocker/config/lnd
directory. For example:LND_CERT_FILE=~/.polar/networks/1/volumes/lnd/alice/tls.cert LND_MACAROON_FILE=~/.polar/networks/1/volumes/lnd/alice/data/chain/bitcoin/regtest/admin.macaroon
-
[Optional] Set the
MOSTRO_RELAY_LOCAL_PORT
to the port you want to use for the local relay on thedocker/.env
file. For example:MOSTRO_RELAY_LOCAL_PORT=7000
-
Build the docker image:
make docker-build
-
Run the docker compose file:
make docker-up
To stop the Docker container, run:
make docker-down
-
Run the following command to start the Nostr relay:
make docker-relay-up
-
Stop the Nostr relay:
make docker-down