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.
- 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.
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.
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.
Step 5: Configure Root Name and Postmaster Mail
In this screen, you have to specify the root name and 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.
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).
Step 7: Set up local networks
Now, here, list the network blocks for which you want this server to relay email.
Step 8: Set up the mail size
Set the mailbox size limit to “0” after that, and then press Enter.
Step 9: Set up An Address Extension Character
On this page, Enter “+” as the Local address extension character, then click OK
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.
We have now successfully installed Postfix on our Ubuntu 22.04 system, and the output shown below shows its present parameters
To verify if Postfix is up and running, execute the given command.
$ sudo systemctl status postfix
You can clearly see that Postfix is currently installed and running efficiently on our Ubuntu 22.04 system.
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.