How To Install Postfix on Ubuntu 18.04 & 16.04 LTS


How To Install Postfix on Ubuntu 18.04 & 16.04 LTS – Postfix is a free and open-source mail transfer agent that routes and delivers electronic mail. It is released under the IBM Public License 1.0 which is a free software license. Alternatively, starting with version 3.2.5, it is available under the Eclipse Public License 2.0 at the user’s option.

Postfix Architecture

Postfix Architecture
Postfix Architecture – Wikipedia

Step 1 – Install Postfix

Postfix packages are available under default repositories of Ubuntu operating systems. Simply use the following command to install Postfix SMTP server on your Ubuntu system.

$ sudo apt-get install postfix

The installation process will ask you for some inputs.

Postfix Configuration
Postfix Configuration

Step 2 – Configure Postfix

Let’s start Postfix configuration. Edit Postfix configuration file /etc/postfix/ in your favourite editor and make following changes. Change myhostname, mydomain as per your requirements.

myhostname =
mydomain =
myorigin = $mydomain
mydestination = $myhostname, localhost, $mydomain, localhost.localdomain
mynetworks =, /32
relay_domains = $mydestination
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/

Step 3 – Restart Postfix Service

As we have doneinitial Postfix configuration, So restart Postfix service to read changes of configuration.

$ sudo service postfix restart


Please enter your comment!
Please enter your name here

Share post:



More like this

How to Protect WordPress with Cloudflare

Cloudflare, Inc. is an American content delivery network and...

Facebook Outage

Mike Schroepfer - CTO @ Facebook. *Sincere* apologies to everyone...

Magento 2 One Page Checkout (One Step Checkout)

Magento 2 One Page Checkout - One Page checkout...