Virtualmin installation with nginx and postgresql – guide for Debian

Nginx nor postgresql wont install automatically when installing virtualmin so they need to be installed separated and then activated within virtualmin/webmin installation.

Installing Virtualmin / Webmin

The easiest way to get the install script onto your server, is to login to your server and use wget or curl. For example:
# wget and then runing the install script sudo /bin/sh

If you are not satisfied with default installation, different flags can be used for a a minimal installation mode or specific installation bundles:
--uninstall|-u - Removes all Virtualmin packages (do not use on a production system)
--help|-h - This message
--force|-f - Skip confirmation message
--hostname|-h - Set fully qualified hostname
--verbose|-v - Verbose
--setup|-s - Setup software repositories and exit (no installation or configuration)
--minimal|-m - Install a smaller subset of packages for low-memory/low-resource systems
--bundle|-b <name> - Choose bundle to install (LAMP or LEMP, defaults to LAMP)

Reset Webmin root password

After Virtualmin / Webmin installation we need to reset the root password for webmin. That is easy done with the following command:

sudo /usr/share/webmin/ /etc/webmin root newpassword

Installing and configure PostgreSQL on Virtualmin / Webmin

On Webmin initial configuration we will be required to choose the database servers we need. If we need PostgreSQL we cant activated unless it is installed on the server and that is being done with the following approach:

  1. Begin by updating the local package index: sudo apt update
  2. Install the PostgreSQL server and PostgreSQL contrib package which provides additional features for the PostgreSQL database: sudo apt install postgresql postgresql-contrib
  3. Check version of PostgreSQL installation: sudo -u postgres psql -c "SELECT version();"

Moving from LAMP to LEMP : Nginx on Virtualmin / Webmin installation

If you installed default Virtualmin but you changed your mind and want an Nginx instead of default Apache installation that can be done.

  • Shutdown Apache: /etc/init.d/apache2 stop ; update-rc.d apache2 remove
  • Install Nginx: apt-get install nginx
  • Start the Nginx webserver: /etc/init.d/nginx start
  • Install Virtualmin’s Nginx plugin: apt-get install webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl

Now we got everything installed and all we need to do is to configure the Virtualmin / Webmin :

  1. Login to Virtualmin as root, and go to Webmin -> Servers -> Nginx Webserver and make sure that Nginx and its configuration files are found.
  2. If not, click on the Module Config link and set the config and command paths correctly.
  3. Return to Virtualmin, and go to System Settings -> Features and Plugins.
  4. Un-check the “Apache website” , “SSL website” and “DAV Login”, “Mailman”, “Protected web directories”, “AWstats
  5. reporting” and “Subversion repositories” features.
  6. Check the “Nginx website” and “Nginx SSL website” features, then click “Save”.
  7. If Virtualmin reports that any other features cannot be used without Apache, go back and de-select them too.
  8. Go to the System Information page and click Refresh system information in the top right.
  9. Verify that Nginx is shown as running in the “Status” section.

And this pretty much does it.

You may also like...

Leave a Reply