Skip to content

Instantly share code, notes, and snippets.

@higebu
Created March 5, 2024 23:54
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 higebu/1165bd9b321a802b8339ade2bb4d58e6 to your computer and use it in GitHub Desktop.
Save higebu/1165bd9b321a802b8339ade2bb4d58e6 to your computer and use it in GitHub Desktop.
Install Nginx on Debian
#!/bin/bash
codename=$(lsb_release -c -s)
sudo wget https://nginx.org/keys/nginx_signing.key -O /etc/apt/keyrings/nginx_signing.key
cat <<EOF | sudo tee /etc/apt/sources.list.d/nginx.list
deb [signed-by=/etc/apt/keyrings/nginx_signing.key] https://nginx.org/packages/debian/ $codename nginx
deb-src [signed-by=/etc/apt/keyrings/nginx_signing.key] https://nginx.org/packages/debian/ $codename nginx
EOF
sudo apt-get update
sudo apt-get install -y nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment