Deployment on Linux with Docker
Requirements
- A VPS or VM publically accessible
- A domain name
- DNS hosted on Cloudflare
- A cup of coffee (or your favourite beverage)
DNS Setup
- Update and configure your VPS/VM how you prefer. Hardening and configuration are out of the scope for this guide.
- Ensure ports 80 and 443 (TCP) are open via IPTables, NFTables, or UFW, however you choose to open them.
- Visit Cloudflare panel and point
salty.yourdomain.com
to the public-routable IP address of your system, ensure proxy is checked. - Grab your API key from the Cloudflare interface, you’ll need this shortly.
- Add an SRV record for Salty service discovery
- Type:
SRV
- Name:
yourdomain.com
- Service:
_salty
- Protocol:
TCP
- TTL:
3600
(One hour) - Priority:
0
(highest) - Weight:
0
- Port:
443
- Target:
salty.yourdomain.com
- Type:
- And another for Salty avatar discovery
- Type:
SRV
- Name:
yourdomain.com
- Service:
_avatars
- Protocol:
TCP
- TTL:
3600
(One hour) - Priority:
0
(highest) - Weight:
0
- Port:
443
- Target:
salty.yourdomain.com
- Type:
- Grab a coffee (or your favourite beverage) and wait a few minutes as DNS can take a bit.
Infrastructure Setup
- Install docker on your VPS/VM.
- Create an operator user with
wheel
orsudo
group as well asdocker
group. - Run:
docker swarm init
, you’ve now created a single node Docker Swarm cluster. - Run:
docker network create -d overlay traefik
, this will create the network needed for Traefik and Salty to communicate. - Run:
docker stack deploy -c traefik.yml traefik
, this will deploy the traefik stack. - Give Traefik a few minutes to warm up. Tail the logs with
docker logs -f traefik_traefik.1.someid
to ensure there are no errors - Run:
docker stack deploy -c salty.yml salty
- Run:
watch docker stack ps salty --no-trunc
to ensure the stack comes up and reaches running state - Run:
docker logs -f salty_salty.1.someid
to verify the service is up - If there are no issues, you should be able to visit
https://salty.yourdomain.com
and view the PWA - Grab another cup
You will find example Docker Swarm stacks (docker-compose yaml) in stacks