How to install Postfix as the SMTP server for applications in Raspbian Stretch Lite to send email

Postfix Raspbian icon

Email is a good medium for the applications that we deploy on our Raspbian Stretch Lite to send us notifications.

By default, a fresh installation of Raspbian Stretch Lite does not include a SMTP server for programs to send email. Thankfully, we can install Postfix as the SMTP server for the applications that we deployed on Raspbian Stretch Lite to send out email when necessary.

This post documents how you can install Postfix as the SMTP server for applications in Raspbian Stretch Lite to send email.

Making sure that your Raspbian Stretch Lite is up to date

We first run the following command for Raspbian Stretch Lite to get the latest updates from the Internet:

sudo apt-get update

Installing Postfix on Raspbian Stretch Lite

Once we are sure that our Raspbian Stretch Lite had gotten the latest updates from the Internet, we can proceed to installing Postfix by running the following command:

sudo apt-get install -y postfix

When the command start, you will need to pass through configuration screens to:

  1. Select the mail server configuration type that best meets your need
    Postfix mail server configuration type on Raspbian Stretch Lite
  2. Indicate a Fully Qualified Domain Name as the "mail" name
    Postfix FQDN configuration example on Raspbian Stretch Lite

Once you had indicated your input to those configuration screens, the applications that you deploy on your Raspbian Stretch Lite will be able to send out email.

About Clivant

Clivant a.k.a Chai Heng enjoys composing software and building systems to serve people. He owns techcoil.com and hopes that whatever he had written and built so far had benefited people. All views expressed belongs to him and are not representative of the company that he works/worked for.