Skip to content

Instantly share code, notes, and snippets.

@ahmeti
Created February 25, 2023 02:05
Show Gist options
  • Save ahmeti/476b2085a4c437704056147b9ef30184 to your computer and use it in GitHub Desktop.
Save ahmeti/476b2085a4c437704056147b9ef30184 to your computer and use it in GitHub Desktop.
Install Nginx Latest Stable 1.22 Version on Ubuntu 22.04
sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
fingerprint: "573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62" If the fingerprint is different, remove the file.
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| sudo tee /etc/apt/preferences.d/99nginx
sudo apt update
sudo apt install nginx
nginx -v "nginx version: nginx/1.22.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment