Hosting a Broker Daemon on the Cloud allows the user to offload resources and have a machine that is available 24/7. Although a self-hosted setup is ideal (avoids inherent security risks with 3rd parties managing your infrastructure), some users may prefer to run the Broker Daemon on a Cloud provider such as AWS. Below you will find a guide on how to setup a hosted Broker Daemon on AWS.
WARNING: Hosting the Broker Daemon on third party providers can expose you to risk as they will have access to your wallet/currency.
WARNING: Always examine scripts downloaded from the internet before running them on your server.
AWS setup guide
Launch an EC2 Instance
From your AWS EC2 console:
- Click on "Launch Instance"
- Select "Ubuntu Server 18.04 LTS (HVM), SSD Volume Type" 
- Select the "c5.xlarge" instance 
- Change the Root Volume to 300 GiB of Storage 
- Add any tags you want
- Set your security group  to have the following ports open:
- AWS SSH default (port 22, source of "Anywhere")
- TCP port range "10113-10114" with a source of "Anywhere" for "LND Inbound Connections"
- Launch it! 🚀
To install your pre-requisites, you'll need to be logged into your machine. Once it's running, you can ssh in with:
nvm to manage your node versions with:
curl -o install-nvm.sh https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh bash install-nvm.sh
docker following the Docker CE installation instructions for Ubuntu.
You can also use the convenience script (with Docker Version 18.06.1) with:
curl -fsSL https://get.docker.com -o get-docker.sh VERSION="18.06.1" sh get-docker.sh
docker is installed, you need to make sure you can run the command from the
ubuntu user. To do so, follow the Post-installation instructions, or simply:
sudo usermod -aG docker ubuntu
Then close and re-open your
To verify that your
docker installation worked, run:
docker run hello-world
You can install Docker Compose using the installation instructions, or use the following:
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
To verify that your
docker-compose installation was successful, run:
Install and configure Sparkswap
From here, you can follow the installation instructions for Sparkswap, bearing in mind that you have already opened your ports and installed all pre-requisites.
When running the installation script, your public IP address will be the IP address of your EC2 instance as listed by AWS.
Downgrade your instance type
Once Sparkswap has been installed and all blockchains have been synced (check
docker-compose logs -f bitcoind to see the syncing progress, it should take about 24 hours) you may want to downgrade your instance type to one that is more cost effective.
Before downgrading your instance, you should ensure that you do not have any open orders or any funds committed to the Relayer.
To downgrade, you'll need to:
- Stop your instance (Actions > Instance State > Stop)
- Change your instance type (Actions > Instance Settings > Change Instance Type) "t3.medium" seems to be performant enough on an ongoing basis
- Start your instance (Actions > Instance State > Start)
- Update your public IP address in the
.envfile in your
sparkswapdirectory for keys:
- Re-create your docker-compose stack:
docker-compose up -d
You now have a functional sparkswap node hosted on AWS.
For more advanced help, please ask for assistance on Discord.
If you select a different image, the below steps may still work, but they were tested on the above image. ↩
Yes, it's a lot. We need to store the full blockchain for every chain on which you trade. ↩