Skip to content

Instantly share code, notes, and snippets.

@gijigae
Created May 24, 2024 08:20
Show Gist options
  • Select an option

  • Save gijigae/5db9f4aa1250ed5d627f138603cda6c3 to your computer and use it in GitHub Desktop.

Select an option

Save gijigae/5db9f4aa1250ed5d627f138603cda6c3 to your computer and use it in GitHub Desktop.
Install Certbot and issue an SSL certificate for a given domain
#!/bin/sh
# Check if a domain is provided
if [ -z "$1" ]; then
echo "Usage: sudo sh certbot.sh <domain>"
exit 1
fi
DOMAIN=$1
# Install certbot and the nginx plugin
apt install -y certbot python3-certbot-nginx
# Run certbot with the provided domain
certbot --nginx -d $DOMAIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment