// personal

AWS Hosting with Terraform

The infrastructure behind these PHP projects: an AWS Lightsail server defined in Terraform, running the three Laravel apps behind Caddy with automatic HTTPS.

Company
XLANT SOFT · Self-employed
Role
Solo developer
Period
2023 – present
Platform
AWS (eu-central-1)

What I built

  • Terraform for a Lightsail instance, a static IP, firewall rules (SSH, HTTP, HTTPS including HTTP/3) and the SSH key pair. One terraform apply builds it all.
  • A first-boot script that installs Docker and swap, generates each app's secret key on the server so no secrets reach Terraform state or git, then clones and starts the apps.
  • Docker Compose running the three Laravel apps behind Caddy, which serves php., api. and tennis.xlant.pro with automatic Let's Encrypt certificates.
  • A one-command deploy script that pulls every repository and rebuilds only what changed, with SQLite data on Docker volumes that survive rebuilds.
  • Production fixes documented in the README: Lightsail's /bin/sh launch scripts, empty directories lost in git, and trusting proxy headers so Laravel generates HTTPS URLs.

Built solo. Terraform runs in Docker, so the only local requirements are Docker and an AWS CLI profile.