This brief tutorial is going to show students and new users how to install and configure Postfix on Ubuntu 16.04 / 17.10 and 18.04 LTS servers. To set up Postfix to work in a public environment, you’ll have to configure Postfix with a qualified domain name pointed to your server. ex. mail.example.com pointing to your Ubuntu servers. Don’t forget to point your MX records to the servers as well. Once you’re done with the initial setup, continue below to get Postfix installed and configured on Ubuntu.

Install Postfix on Ubuntu

To install Postfix on Ubuntu, simply run the commands below. During the installation, you’ll be prompted how you’d like to configure Postfix. for this tutorial, we’ll choose ‘No configuration‘. this will allow us to manually configure Postfix settings to suit your environment. This gives you more control over how Postfix functions in your environment. When prompted to choose Postfix configuration, select the ‘No configuration‘ option. We’re going to manually configure Postfix. After installing continue below to configure.

Configure Postfix

Now that Postfix is installed, run the commands below to create its default configuration file from the distribution template. Now that the Postfix configuration file is created. run the commands below to open it. Then use these settings to make it work in most environments. After editing the lines above, save the file. Next, run the commands below and restart Postfix. Postfix is now installed and ready to use. If you want to use SMTP authentication, you may want to use Dovecot. Dovecot is an open-source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It’s fast, simple to set up, requires no special administration and it uses very little memory. When using Dovecot add the highlighted configuration lines to the end of the Postfix main.cf file. Then restart Postfix and you’re done. You may also like the post below: