# How to setup Nginx on Webmin?

URL: https://sohaib.com/blog/how-to-setup-nginx-on-webmin
Author: Sohaib Khan
Published: Jan 30, 2018
Updated: Sep 8, 2026
Category: Web Servers & DevOps

> Installing Virtualmin wget http://software.virtualmin.com/gpl/scripts/install.sh Run the script to install Virtualmin. sh /root/install.sh Follow on-screen guide to install this. systemctl stop apache2.service…

**Installing Virtualmin**

```bash
wget http://software.virtualmin.com/gpl/scripts/install.sh
```

**Run the script to install Virtualmin.**

```plaintext
sh /root/install.sh
```

**Follow on-screen guide to install this.**

```plaintext
systemctl stop apache2.service
```

**Installing Nginx** Now that the Apache is not running, you’ll be able to install Nginx. The following command will install it on your Debian 9.x

```bash
apt-get install nginx
```

**Now install Virtualmin modules to support Nginx and Nginx SSL,**

```bash
apt-get install webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl
```

**Installing PHP 7 Modules** I installed bunch of modules as I am running Magento 2.x

```bash
apt-get -y install php-fpm php-cli php-gd php-imagick php-mysql php-mcrypt php-pear php-curl php-intl php-xsl php-zip php-mbstring php-soap php-imap memcached php7.0-mysql php7.0-curl php7.0-gd php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php7.0-zip
```

**Configuring Virtualmin to enable Nginx** The next and final step is to disable Apache and few other features. Go to System Settings -> Features and Plugins from your Virtualmin dashboard and, **Enable** Nginx website Nginx SSL website Disable Apache website SSL website DAV Login Mailman Protected web directories AWstats reporting Subversion repositories
