How to Install Postfix Mail Server on Ubuntu 22.04

In this post, we will  show you how to Install postfix mail server on Ubuntu 22.04. Also, keep in mind that by the end of this lesson, you won’t have a fully functional email server, but you will have some of the basic building blocks of this tool to help get you started.

Postfix is a popular free and open-source MTA (Mail Transfer Agent) used to route and deliver electronic mail over the Internet.  At the time of writing this article, statistics show that 34% of public mail servers on the internet run Postfix.

Prerequisites

  • A System with Ubuntu 22.04 OS
  • Sudo user with admin rights
  • Internet connectivity

Step 1: Update the local Package index

First, we are required to update the system repositories, and to implement that, right-click on your desktop window and open the terminal; alternatively, you can use the “CTRL+ALT+T” functionality and execute the command as shown

$ sudo apt update

Step 2:  Install Postfix Mail Server on Ubuntu 22.04

You can install Postfix on Ubuntu 22.04 using the APT package manager tool. This is because Postfix is supported by default. We’ll execute the command with the option “DEBIAN_PRIORITY=low” during installation, and as a result, the installation process will prompt us to set up a few extra configurations.

$ sudo DEBIAN_PRIORITY=low apt install postfix

Step 3: Configure General Mail

A postfix configuration window will pop up on your screen once you run the command in step two. To move forward, press ENTER to select the OK option.

Install-Postfix-on-Ubuntu-22-04-Screen

You will still be prompted under Postfix configuration to select the “General mail configuration” type in the newly opened setup window. Press Enter and select the option OK.

Choose-Internet-Site-Postfix-Installation-Ubuntu-22-04

Step 4: Setting System Mail Name

In the next screen, after completing the general mail configuration, change the “System mail name” to your preference and select the default option OK.

Set-System-Mail-Name-During-Postfix-Installation

Step 5: Configure Root Name and Postmaster Mail

In this screen, you have to specify the root name and postmaster mail.

Postfix-Configuration-Root-Postmaster-Mail

Step 6: Add destination domain

In this window, you can list all the web addresses in the bar. The addresses act as destinations for receiving emails.

Add-Destination-Domain-Postfix-Installation-Ubuntu-22-04

A pop-up screen displays while you’re still configuring Postfix, providing the option to choose yes or no if you want to force synchronous updates. You can advance with the default option (no).

Choose-NO-Force-syn-Updates-Mail-Queue-Postfix

Step 7: Set up local networks

Now, here, list the network blocks for which you want this server to relay email.

Networks-Block-For-Postfix-Ubuntu-22-04

Step 8: Set up the mail size

Set the mailbox size limit to “0” after that, and then press Enter.

Mail-Size-limit-Postfix-Ubuntu-22-04

Step 9: Set up An Address Extension Character

On this page, Enter “+” as the Local address extension character, then click OK

Local-Address-Extension-Character-Postfix-Ubuntu-22-04

Step 9: Set up IP (Internet Protocols)

In this step, in order to utilize both IPv6 and IPv4, choose “all” from the available options and hit Enter.

Internet-Protocols-Postfix-Ubuntu-22-04

We have now successfully installed Postfix on our Ubuntu 22.04 system, and the output shown below shows its present parameters

Present-Parameters-for-Postfix-Ubuntu-22-04

To verify if Postfix is up and running, execute the given command.

$ sudo systemctl status postfix

Postfix-Service-Status-Ubuntu-22-04

You can clearly see that Postfix is currently installed and running efficiently on our Ubuntu 22.04 system.

Bottom Line

Your Ubuntu 22.04 server is now set to use Postfix. New system administrators may find it challenging to manage email servers, but with this configuration, you should have enough MTA email capability to get going.

Also Read: How to Install Ansible in Ubuntu 22.04 LTS (Jammy Jellyfish)

Leave a Comment

19 − sixteen =