Install Nginx on Windows

Contents
Download
Unpack
Start Nginx
Check that it runs
Stop, reload, reopen logs
Run it from its own folder
Paths in nginx.conf
Port 80 is busy
Start with Windows
Limits of the Windows version

Nginx for Windows is a zip archive with a ready nginx.exe: there is no installer, nothing is written to the registry, and deleting the folder removes it. It suits development and tests on a Windows machine; for a production server see Limits of the Windows version.

The commands are for the Command Prompt (cmd). In PowerShell put .\ in front of the program name, for example .\nginx -s reload: PowerShell does not run programs from the current folder without it.

Download

Open nginx.org/en/download.html. It has a mainline version (new features first) and a stable version (only critical fixes). Each has a link nginx/Windows-1.x.y to a zip archive. On 26 October 2026 the stable version was 1.30.6, so the file was

nginx-1.30.6.zip

Unpack

Unpack the archive to the root of drive C:. It contains one folder named after the version:

C:\nginx-1.30.6

Rename it to nginx, so commands and scripts keep working after the next update:

C:\nginx

Inside are nginx.exe and the folders conf (configuration, with nginx.conf), html (the start page), logs and temp.

Start Nginx

Go to the folder and start Nginx in the background:

cd C:\nginx

start nginx

The prompt returns at once and Nginx keeps running in the background; closing the Command Prompt does not stop it. On the first start Windows Defender Firewall may ask whether nginx may accept connections on private or public networks. For work on this computer only you can cancel: connections to localhost are not filtered. Allow private networks when other devices of your home or office network should reach it.

Check that it runs

Open http://localhost/ in a browser: the page says Welcome to nginx!. In the console list the processes:

tasklist /fi "imagename eq nginx.exe"

There are two nginx.exe lines: the master process and one worker, because the nginx.conf from the zip sets worker_processes 1;. Each start that fails leaves its reason in C:\nginx\logs\error.log.

Stop, reload, reopen logs

Nginx is controlled with signals that you send with -s, from the same folder. Stop at once:

nginx -s stop

Stop after the current requests are answered:

nginx -s quit

Read the changed configuration without stopping. Test it first; a reload with a broken file keeps the old configuration and writes the error to the log:

nginx -t

nginx -s reload

Start new log files, for example after you moved the old ones away:

nginx -s reopen

When logs\nginx.pid is gone and -s stop fails, end the processes by name:

taskkill /f /im nginx.exe

Run it from its own folder

Nginx for Windows reads conf\nginx.conf and writes logs and temp relative to the folder it was started from. If you add C:\nginx to the PATH and type nginx in another folder, it looks for the configuration there and does not start.

So either cd C:\nginx first, as above, or give the folder with -p:

nginx -p C:\nginx\ -s reload

Paths in nginx.conf

Write paths in nginx.conf with forward slashes, as on Unix. Nginx reads a backslash as the start of an escape sequence, with or without quotes: C:\new\test becomes C:, a line break, ew, a tab and est. Relative paths start at the Nginx folder. A site in its own folder:

notepad C:\nginx\conf\nginx.conf

server { listen 8080; server_name localhost; root C:/www/site; index index.html; access_log logs/site.access.log; }

Put the block inside the http { } block of the file, next to the existing server, create C:\www\site\index.html, test and reload as shown above, and open http://localhost:8080/.

Port 80 is busy

If start nginx shows nothing and tasklist finds no nginx.exe, look into logs\error.log. A line with bind() to 0.0.0.0:80 failed means another program holds port 80: often IIS (the World Wide Web Publishing Service), another web server or a local development stack. Find the process ID of the program on port 80:

netstat -ano | findstr :80

The last column is the process ID. Put it into the filter instead of 1234 to see the program name:

tasklist /fi "pid eq 1234"

Stop that program, or let Nginx listen elsewhere: change listen 80; to listen 8080; in conf\nginx.conf.

Start with Windows

nginx.exe cannot run as a Windows service by itself. Two common ways:

Limits of the Windows version

nginx.org calls the Windows version a beta and lists its known issues in nginx for Windows:

For a server that faces the internet use Nginx on Linux. On a Windows computer that can be a Linux virtual machine, for example in VirtualBox.

Article author: Klavdiya Kondakova

Related articles
Install Nginx
Install Nginx on Linux
Install Nginx on Debian
Install Nginx on Ubuntu
Install Nginx on FreeBSD, OpenBSD and macOS
Nginx

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: