Table of Contents
Download Nginx and NSSM
Nginx is an free, open-source HTTP server characterized by its small footprint, exceptional performance and efficient use of resources. It hosts over 7% of all domains worldwide!
Non-Sucking Service Manager (NSSM) is a service helper program that assists in installing an application as a service, monitoring the application’s state and handling failures as it runs.
1. To run Nginx as a Windows Service you need download:
- Nginx for Windows: http://nginx.org/en/download.html
- Download NSSM: https://nssm.cc/download
2. Extract downloaded files then copy nssm.exe in win64 folder and src folder to extracted nginx folder.
![Bg860](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg860.png)
3. Now, in the nginx folder, we have nginx source and nssm source.
![Bg859](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg859.png)
4. Copy all files and folders in nginx folder to C:/nginx ( create nginx folder in C drive if it not exists).
![Bg861](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg861.png)
5. Right click on the Start icon then open Windows PowerShell as administrator.
![Pw](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/05/pw.png)
6. Navigate to nginx folder then run this command .\nssm.exe install to open NSSM service installer.
PS C:\Users\mpnadmin> cd /
PS C:\> cd .\nginx\
PS C:\nginx> .\nssm.exe install
Service "Nginx" installed successfully!
7. In the NSSM service installer window:
- Application Path: Browse to nginx.exe in C:\nginx.
- Service name: Enter service name as you need.
- Click button.
![Bg862](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg862.png)
8. Now, open Windows Services (services.msc) then start the Nginx service. As you can see, Startup Type is Automatic, it means nginx service will load on boot.
![Bg863](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg863.png)
Finally, open any web browser then visit localhost to verify it works.
![Bg864](https://bonguides-1e199.kxcdn.com/wp-content/uploads/2022/06/bg864.png)
Not a reader? Watch this related video tutorial: