Using Caddy with SSL
Learn how to set up Light Store behind Caddy with automatic SSL certificates.
Overview
This guide will explain how to set up Light Store behind a Caddy reverse proxy with HTTPS.
Caddy automatically obtains and renews SSL certificates for HTTPS support.
If you've used the automatic installation script, you already have Caddy set up — no need to follow this guide. This only applies for pure Docker installs & manual installs.
What this guide covers
We'll configure Caddy to:
- Act as a reverse proxy, forwarding requests to Light Store running on port 8001
- Automatically manage HTTPS certificates
- Redirect HTTP traffic to HTTPS
DNS Configuration
Before setting up Caddy, configure your domain's DNS to point to your server:
- Log in to your domain registrar's control panel (e.g., Cloudflare, GoDaddy, Namecheap)
- Add an A record:
- Type: A
- Name:
@(for root domain) orstore(forstore.yourdomain.com) - Value: Your server's IP address
- TTL: Auto or 3600 (1 hour)
DNS Propagation
DNS changes may take up to 48 hours to propagate, but usually work within a few hours. You can check propagation with dnschecker.org.
Additional Requirements
Make sure you have a working Light Store installation running on port 8001 (from the Docker installation guide).
Installing Caddy
On Ubuntu/Debian, install Caddy from the official repo:
sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddySetting up Caddy Configuration
- Open the Caddyfile:
sudo nano /etc/caddy/Caddyfile- Add this configuration (replace your.domain.com with your domain):
your.domain.com {
reverse_proxy localhost:8001
}- Reload Caddy to apply the config:
sudo systemctl reload caddyAfter doing these steps, the app should be available at https://your.domain.com.