How to install postfix mail server on ubuntu 18.04

Postfix is a free and open-source mail transfer agent(MTA) that routes and delivers electronic mail.

If you are running a website on a unix server and you want to send mails from your server, this article may be helpful to you. In this article we will learn how to install and configure postfix on ubuntu 18.04

Step 1: Login to the SSH or simply open/access the terminal and run the below command

sudo apt-get update

Step 2: Now, we will install the postfix software on ubuntu machine

sudo apt-get install postfix

During the installation you will be asked a few questions such as to choose mail server configuration type, please choose “Internet Site”

Then you will be asked to enter system mail name. Please enter the fully qualified domain name(FQDN) that you want to use to send mails.

After that fqdn setup, the postfix installation will be completed.

Note: You can also change the above postfix configuration later. To reconfigure it, run the below command

sudo nano /etc/postfix/

Don’t forget to save the file after editing and to restart the postfix.

Step 3: To restart the postfix, run

sudo service postfix restart

The other commands that might be helpful to you, are

sudo service postfix start
sudo service postfix status
sudo service postfix stop

About the Author: magechamp

Leave a Reply

Your email address will not be published. Required fields are marked *