docs(deploy): improve VPS/reverse-proxy guidance and fix deploy.sh#713
docs(deploy): improve VPS/reverse-proxy guidance and fix deploy.sh#713vivek-tiwari-vt wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Lago’s self-host deployment guidance to better support VPS and reverse-proxy setups, and refactors deploy/deploy.sh to improve Docker Compose detection and compose-file selection for different deployment modes.
Changes:
- Expanded
deploy/README.mdto documentQuickstart,Local,Light, andProductionmodes, plus a VPS/reverse-proxy checklist and safer.envchange guidance. - Updated
deploy/deploy.shto detectdocker composevsdocker-compose, centralize compose execution, and download mode-specific compose files. - Updated the root
README.mdto point users to the deployment templates for VPS/reverse-proxy setups.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| deploy/deploy.sh | Adds compose detection/helpers and mode-specific compose file handling for scripted deployments |
| deploy/README.md | Reworks self-host docs for VPS/reverse-proxy + mode-specific instructions |
| README.md | Reframes deployment section and links to deploy/README.md for non-localhost setups |
Comments suppressed due to low confidence (2)
deploy/deploy.sh:282
- The DNS check runs before loading values from the existing
.envfile (and before prompting the user). In most runsLAGO_DOMAINwill only be present in.env, socheck_domain_dnswill be skipped and invalid domains won't be caught. Load.env(or prompt forLAGO_DOMAIN) before running the DNS check, or re-run the check after collecting the variable.
# Check Env Vars depending on the deployment
if [[ "$selected_key" == "Light" || "$selected_key" == "Production" ]]; then
mandatory_vars=("LAGO_DOMAIN" "LAGO_ACME_EMAIL")
if [[ "$selected_key" == "Production" ]]; then
mandatory_vars+=("PORTAINER_USER" "PORTAINER_PASSWORD")
fi
external_pg=false
external_redis=false
if [[ -n "$LAGO_DOMAIN" ]]; then
check_domain_dns "$LAGO_DOMAIN"
if [[ $? -eq 1 ]] && ! ask_yes_no "No valid DNS record found. Continue anyway?"; then
deploy/deploy.sh:252
- In the
Light/Productiondownload steps, the success check ($?) only reflects the exit code of the lastcurl(the.envdownload), so the script may proceed even if the compose file download failed. Also, usingcurl -swithout-fcan still return success on HTTP errors (e.g., 404). Check both downloads explicitly and usecurl -fS(or-fsSL) so HTTP failures are detected.
echo "${CYAN}${BOLD}🚀 Downloading Light deployment files...${NORMAL}"
COMPOSE_FILE="docker-compose.light.yml"
curl -s -o "$COMPOSE_FILE" https://deploy.getlago.com/docker-compose.light.yml
curl -s -o .env https://deploy.getlago.com/.env.light.example
if [ $? -eq 0 ]; then
echo "${GREEN}✅ Successfully downloaded Light deployment files${NORMAL}"
else
echo "${RED}❌ Failed to download Light deployment files${NORMAL}"
exit 1
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Local) | ||
| echo "${CYAN}🚧 Running Local Docker Compose deployment...${NORMAL}" | ||
| docker compose -f docker-compose.local.yml up -d || docker-compose -f docker-compose.local.yml up -d &>/dev/null | ||
| run_compose up -d | ||
| ;; |
There was a problem hiding this comment.
run_compose up -d in the Local branch does not enable the all profile. In docker-compose.local.yml, core services like db/redis/rsa-keys are under the all (and related) profiles, so running without --profile all will skip them and the stack will not come up correctly. Update the Local execution path to include the appropriate profile (e.g., --profile all) or set profile="all" for Local as well.
| echo "${CYAN}${BOLD}🔍 Checking DNS A record for ${domain}...${NORMAL}" | ||
|
|
||
| if command -v dig &> /dev/null; then | ||
| if dig +short A "$domain" | grep -q '^[0-9]'; then | ||
| echo "${GREEN}✅ Valid A record found for ${BOLD}${domain}${NORMAL}" |
There was a problem hiding this comment.
check_domain_dns only checks an IPv4 A record (dig ... A) but the docs and many VPS setups rely on IPv6 (AAAA) as well. Consider checking for both A and AAAA (and adjusting the message) so valid IPv6-only domains don't fail the preflight check.
| 1. Docker engine installed | ||
| 2. Docker Compose (`docker compose` plugin or `docker-compose`) | ||
| 3. For `Light` and `Production`: a public domain with valid DNS A/AAAA records | ||
| 4. For `Light` and `Production`: ports `80` and `443` reachable from the internet |
There was a problem hiding this comment.
The prerequisites state that ports 80 and 443 must be reachable for Light/Production, but the provided Traefik configuration in these compose files uses the TLS-ALPN challenge on :443 and does not expose an :80 entrypoint. Update the docs to reflect the actual port requirements (or update the compose files to also bind 80 if that's intended).
| 1. Point DNS to your VPS (`A`/`AAAA` record for `LAGO_DOMAIN`) | ||
| 2. Open inbound ports `80` and `443` | ||
| 3. Use `Light` or `Production` mode (both ship with Traefik) | ||
| 4. Set `LAGO_DOMAIN` and `LAGO_ACME_EMAIL` in `.env` |
There was a problem hiding this comment.
The checklist says to open inbound ports 80 and 443, but the current Light/Production Traefik setup only binds 443 (TLS challenge). Either remove 80 from the checklist or explain when/why 80 is needed (e.g., if adding an HTTP->HTTPS redirect entrypoint).
| ### Apply `.env` changes safely | ||
|
|
||
| When changing public URL variables (`LAGO_DOMAIN`, `LAGO_API_URL`, `LAGO_FRONT_URL`, `API_URL`), recreate the impacted services so runtime config is regenerated: | ||
|
|
||
| ```bash | ||
| docker compose up --profile all-no-keys | ||
| docker compose down | ||
| docker compose up -d --profile all | ||
| ``` |
There was a problem hiding this comment.
The “Apply .env changes safely” commands use docker compose down/up without specifying the compose file. Earlier in this doc the files are saved as docker-compose.light.yml / docker-compose.production.yml, so these commands won’t affect the running stack unless the user renamed the file to docker-compose.yml. Update the example to include -f <compose-file> (or instruct users to use the default filename).
Summary
Local,Light, andProductiondeployment modes.envchange/recreate flowdeploy/deploy.shcompose detection/execution and compose file selection bugsWhy
Issue #444 highlights a documentation gap for users deploying Lago outside localhost, especially on VPS environments behind a proxy.
Validation
bash -n deploy/deploy.shcloses #444