Skip to content

Instantly share code, notes, and snippets.

@abhishek77in
Last active September 23, 2022 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishek77in/7eac0dd2b2fb6a6d57113828a1ab27cb to your computer and use it in GitHub Desktop.
Save abhishek77in/7eac0dd2b2fb6a6d57113828a1ab27cb to your computer and use it in GitHub Desktop.
Script to install caddy on ubuntu 22.04 aws ec2
#!/bin/bash
sudo apt update
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
caddy version
sudo systemctl status caddy
sudo systemctl enable caddy
sudo systemctl restart caddy
sudo systemctl reload caddy
sudo ufw allow proto tcp from any to any port 80,443
sudo ufw status
sudo ufw enable
sudo ufw app list
sudo ufw allow OpenSSH
sudo ufw allow ssh
sudo ufw allow 22
sudo ufw show added
sudo timedatectl set-timezone Asia/Calcutta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment