Skip to content

Instantly share code, notes, and snippets.

@marianocordoba
Last active February 1, 2023 20:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianocordoba/cea09031a25d55365811f54aebd4bbef to your computer and use it in GitHub Desktop.
Save marianocordoba/cea09031a25d55365811f54aebd4bbef to your computer and use it in GitHub Desktop.
Caddy server user data for AWS EC2
#!/bin/bash
sudo su
yum update -y
yum install yum-plugin-copr -y
yum copr enable @caddy/caddy -y
yum install caddy -y
printf ":80\nrespond \"Hello from $HOSTNAME\"" > /etc/caddy/Caddyfile
caddy start --config /etc/caddy/Caddyfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment