Skip to content

Instantly share code, notes, and snippets.

@HairAndBeardGuy
Forked from Jamesits/caddy.sh
Last active April 18, 2017 21:58
Show Gist options
  • Save HairAndBeardGuy/6a04f24fa2eca8b0ed0babe92c5c2ba7 to your computer and use it in GitHub Desktop.
Save HairAndBeardGuy/6a04f24fa2eca8b0ed0babe92c5c2ba7 to your computer and use it in GitHub Desktop.
Install Caddy Server on Ubuntu
apt install curl
curl https://getcaddy.com | bash -s cors,expires,filemanager,git,hugo,ipfilter,jsonp,jwt,locale,mailout,minify,multipass,prometheus,ratelimit,realip,search,upload
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir /etc/caddy
chown -R root:www-data /etc/caddy
mkdir /etc/ssl/caddy
chown -R www-data:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
touch /etc/caddy/Caddyfile
mkdir /var/www
chown www-data:www-data /var/www
chmod 555 /var/www
curl -L https://github.com/mholt/caddy/raw/master/dist/init/linux-systemd/caddy.service -o /etc/systemd/system/caddy.service
chown root:root /etc/systemd/system/caddy.service
chmod 744 /etc/systemd/system/caddy.service
systemctl daemon-reload
sudo systemctl enable caddy.service
@HairAndBeardGuy
Copy link
Author

I updated the curl command on line 15, as per @slobo's comment on the original.

@lpalmes
Copy link

lpalmes commented Apr 18, 2017

Thanks for this, i've been looking for this script for a while!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment