How to Setup a Modoboa Mail Server on Ubuntu 20.04.

Modoboa is a free & open-source mail server written in Python. Python allows to setup mail server. We can create a number of mailboxes and domains from a web-based interface.

Setup a Modoboa Mail Server

Update the System.

apt-get update

Install Required packages

apt-get install python3-virtualenv python3-pip git curl gnupg2

Set he hostname.

hostnamectl set-hostname email.domain-name

Install Modoboa

git clone

change the directory.

cd modoboa-installer

Check the configuration file.

python3 ./ --stop-after-configfile-check domain-name

Here is the command output.

Welcome to Modoboa installer!

Configuration file installer.cfg not found, creating new one.

 Open a configuration file.

vim installer.cfg

Modify the following lines,provide email-address.

generate = true
type = letsencrypt

email = [email protected]

engine = postgres
host =
install = true

Start the Modoboa.

python3 ./ --interactive domain-name

Here is the command output.

Welcome to Modoboa installer!

Before you start the installation, please make sure the following DNS records exist for domain '':
       IN MX  email.domain-name.

Your mail server will be installed with the following components:
modoboa automx amavis clamav dovecot nginx razor postfix postwhite spamassassin uwsgi radicale opendkim
Do you confirm? (Y/n) Y
The process can be long, feel free to take a coffee and come back later ;)
Generating new certificate using letsencrypt
Installing amavis
Installing spamassassin
Installing razor
Installing clamav
Installing modoboa
Installing automx
Installing radicale
Installing uwsgi
Installing nginx
Installing opendkim
Installing postfix
Installing postwhite
Installing dovecot
Congratulations! You can enjoy Modoboa at https://email.domain-name (admin:password)

If we get any error during the  installaltion so run the following command:

python3 ./ --interactive --debug domain-name

Open the nginx config file:

vim /etc/nginx/nginx.conf

Add the following line:

server_names_hash_bucket_size 64;

Restart the Nginx service.

systemctl restart nginx

Access Modoboa Web-interface



Here is the output:

  • By default,username is admin.
  • Password is password.


  • Now Modoboa is Ready.


Fig. 3


Leave a Reply