How to install Proxmox Mail Gateway



Proxmox Mail Gateway is one of the leading open-source email security solution which helps to protect mail server against many email threats from the moment they emerge []. There are several ways of installing Proxmox Mail Gateway in your node but what we explain here is how it is installed on Debian 10 platform.


OS : Debian 10 (Buster)
RAM : 4GB (Recmmend)
Hostname : (It is very Important to set host name before the installation begins)

STEP 01 - Setting up the installation environment

  • First add the host name to "hosts" file.

root@pmg:~vim /etc/hosts

x.x.x.x pmg 
  • Then configure the Package repositories. (Required repositories are available in the PMG documentation.

root@pmg:~# vi /etc/apt/sources.list

deb buster main contrib
# PMG pmg-no-subscription repository provided by
# NOT recommended for production use
deb buster pmg-no-subscription

In PMG documentation there is another repository which is used for security updates. This security update related repository is available in the source file of Debian 10 by default.

# security updates
deb buster/updates main contrib

If this repository is not available in your source file please add it too. Otherwise do not add it as it gives a warning regarding the duplicate repositories when you run the "apt update" command. 

  • After configuring the Package repositories, you need to update the system.

root@pmg:~# apt update 

At this point you may get the below mentioned errors:

Error 01:
Err:6 buster InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7BF2812E8A6E88E0


Add the key which is given in the error. You can use the below command to add the given key.

root@pmg:~# apt-key adv --keyserver --recv-keys 7BF2812E8A6E88E0

When you run the above command it may gives the below error too.  

Error 02:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for   this operation


Install the required packages.

root@pmg:~# apt install gnupg gnupg1 gnupg2     

After installing the above packages you can add the key without any issue.

Then run "apt update" command and it will be completed successfully.

  • Once update completed then you need to do a Upgrade.

    root@pmg:~# apt upgrade 



STEP 02 - Install Proxmox Mail Gateway

  • Now install the proxmox mail gateway.   

root@pmg:~# apt install proxmox-mailgateway

At this point you may get the below mentioned errors

Error 01:
hostname lookup 'pmg' failed - got local IP address ''
dpkg: error processing package pmg-api (--configure):
installed pmg-api package post-installation script subprocess returned error exit status 22
dpkg: dependency problems prevent configuration of proxmox-mailgateway:
proxmox-mailgateway depends on pmg-api; however:
Package pmg-api is not configured yet.

Error 02:
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


If you didn't add the host name to your hosts file before the installation you may get this error. So the solution is to add the IP and host name to the hosts file as mentioned in the STEP 01.

Error 03:

The following packages have unmet dependencies:
proxmox-mailgateway : Depends: pmg-api but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


For the above error, solution is to install pmg-api.

root@pmg:~# apt install pmg-api 

If the installation completed without errors  you can continue to mail gateway installation again.

root@pmg:~# apt install proxmox-mailgateway


Error 04:

The following packages have unmet dependencies:
pmg-api : Depends: postfix (>= 2.5.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


Install postfix

root@pmg:~# apt install postfix

Ones you start postfix installation it will pop up the postfix configuration. select Internet Site from it. If you need to configure your server to work as Smart host you need to select Internet with smart host.

 Then add the system mail name. (ex:

 After the postfix installation continue the mail gateway installation again.

root@pmg:~# apt install proxmox-mailgateway

STEP 03 - Web Logging 

  • Further configurations need to be done via the Proxmox web interface.

Just point your browser to the IP address given during installation with the port.

URL :-  https://youripaddress:8006

root login is having the server's root password


For more Proxmox configurations, refer the below link.