How to Install PostfixAdmin on a Bitnami LAMP Stack

I was been searching for this topic myself but didn’t find a good post/ tutorial, hence again I will provide you with a short briefing of my own findings while researching how to install PostfixAdmin on a Bitnami Ubuntu setup on AWS.

Credit is due where credit is deserved, and to be honest the following post on Linuxize has helped me a lot, although it had some challenges:

Some things to bear in mind are:

  • Check which version is the latest. The article says 3.1 while the latest PostfixAdmin release is 3.2.
  • All PostfixAdmin PHP files have moved to the postfixadmin/public/ directory, including upgrade.php, so make sure to update your path as follows:
/var/www/postfixadmin/public/upgrade.php
  • And finally, the PostfixAdmin-CLI has another add admin command, so I suggest you use the following which walks you through the configuration for adding a super user:
sudo bash /var/www/postfixadmin/scripts/postfixadmin-cli admin add

To make it work, you will have to set-up your VirtualHost configuration as follows:

<VirtualHost _default_:443>
  ServerName mail.domain.com
  DocumentRoot "/var/www/postfixadmin/public"

  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"

  <Directory "/var/www/postfixadmin/">
    Options Indexes
    AllowOverride None

    <IfVersion < 2.3 >
      Order allow,deny
      Allow from all
    </IfVersion>
    <IfVersion >= 2.3 >
      Require all granted
    </IfVersion>
  </Directory>
</VirtualHost>

And finally, you can access the PostfixAdmin configuration panel on the subdomain you configured, which is mail.domain.com in the example given.