Web and Email server with NGINX

Posted August 27, 2021 369 views
NginxEmailUbuntu 20.04

Currently I am running webserver with NGINX, MYSQL, PHP (Current version) on Ubuntu 20.04.
I am trying to setup email server as well on the same Ubuntu server.
Can someone help me with the HOW to and where I can find a documents for this and also which email server is best. For ssl I am using certbot with let’s encrypt.
I am very new to ubuntu OS.
Thanks in Advance.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


You could use Postfix as your SMTP server. Here is a step by step tutorial on how to set it up on Ubuntu 20.04:

However, I would personally use an SMTP service like SendGrid rather than running my own email server on the same server where I run my web application. Running your own email server could be quite challenging and if you only need it to send a few emails per day, it would be more convenient to use an SMTP service like SendGrid.

Hope that this helps.

by Mark Drake
by Hanif Jetha
Postfix is a popular open-source Mail Transfer Agent (MTA) that can be used to route and deliver email on a Linux system. It is estimated that around 25% of public mail servers on the internet run Postfix. In this guide, you'll learn how to install and configure Postfix on an Ubuntu 20.04 server.