How To Install Nginx On Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS?

How To Install Nginx On Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS?

nginx

Nginx web server.
Homepage: .

Maintainer: Debian Nginx Maintainers



Section: httpd

Install nginx

  • Debian apt-get install nginx-extras Click to copy
  • Ubuntu apt-get install nginx-extras Click to copy
  • Alpine OS apk add nginx Click to copy
  • Arch Linux pacman -S nginx Click to copy
  • Kali Linux apt-get install nginx-extras Click to copy
  • Fedora dnf install nginx-extras Click to copy
  • Raspbian apt-get install nginx-extras Click to copy
  • macOS brew install nginx Click to copy

Nginx web server. Homepage: .

How to use nginx?

Below are few example commands for nginx that you can use in the terminal.

Start server with the default config file:
nginxClick to copy
Start server with a custom config file:
nginx -c config_fileClick to copy
Start server with a prefix for all relative paths in the config file:
nginx -c config_file -p prefix/for/relative/pathsClick to copy
Test the configuration without affecting the running server:
nginx -tClick to copy
Reload the configuration by sending a signal with no downtime:
nginx -s reloadClick to copy
Installing nginx command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of nginx 2026 package in your OS.