Caddy

Page content

Run Simple Secure Webserver in 20 sec

assuming you have Docker Instance and wanna run a Secure Webserver in a few Seconds ? Here is an Example how todo it …

Fireup Docker

start a fresh and empty Container with Alpine Linux. Get a Shell. Docker will be removed when you leave the shell (–rm)

docker run -it --rm -p 80:80 -p 443:443 --name alpine-ssl alpine /bin/sh

Set FQDN

this should point to your ip address …

fqdn='host.your.domain.de'

Add Caddy

Caddy 2 is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go

apk add caddy

Config Website

replace ‘host.your.domain.de’ with your fqdn

cat << EOF > Caddyfile
${fqdn}

respond "Hello, privacy!"
EOF

Run Server

Start the Server, wait until the Cert was fetched via Let’s Encrypt (needs a few Seconds)

caddy run

or

All-in-One

apk add caddy
cat << EOF > Caddyfile
${fqdn}

respond "Hello, privacy!"
EOF
caddy run

Open a Browser and enter http://host.yourdomain.de. You will be redirected to HTTPS and you have a Valid Cert.


Any Comments ?

sha256: 02abfcfcef422e8aa85de18f75a1178003f385414349a04d1560c862ad5ae164