Skip to content

Instantly share code, notes, and snippets.

@cesarferradas
Created October 17, 2021 09:55
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 cesarferradas/ae1f95b987cfbbb0d2bf21238629c0fd to your computer and use it in GitHub Desktop.
Save cesarferradas/ae1f95b987cfbbb0d2bf21238629c0fd to your computer and use it in GitHub Desktop.
Script to expose Plausible analytics via SSL
custom_domain=yourdomain.com
certbot_email=user@yourdomain.com
sudo apt -qqy update
sudo apt -qqy install nginx
sudo apt -qqy install certbot python3-certbot-nginx ufw
sudo systemctl enable nginx
sudo systemctl start nginx
ufw allow ssh && ufw allow http && ufw allow https && ufw allow 8000 && ufw --force enable
sudo wget https://raw.githubusercontent.com/plausible/hosting/master/reverse-proxy/nginx/plausible -O /etc/nginx/sites-available/plausible
sudo sed -i "s/example.com/$custom_domain/" /etc/nginx/sites-available/plausible
sudo ln -s /etc/nginx/sites-available/plausible /etc/nginx/sites-enabled/plausible
sudo systemctl reload nginx
sudo certbot --nginx -d $custom_domain --email $certbot_email --agree-tos --no-eff-email
echo "Installation complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment