How to Set Up a Mail Server with Modoboa on Debian 10

Modoboa is an open-source mail server hosting and management platform for Linux. It is written in Python uses Postfix, and Dovecot to send and receive email. It uses an Nginx webserver and MySQL/PostgreSQL database. It allows you to create unlimited mailboxes and unlimited mail domains. It can be integrated with Let’s Encrypt to encrypt all communications between your email server and the outside network. It comes with a web-based admin panel to manage domains, mailboxes, aliases, and more.

In this tutorial, I will show you how to install Modoboa on Debian 10 server.


  • A server running Debian 10.
  • A valid domain name pointed with your server IP.
  • A root password is configured on the server and you are logged in as root.

Getting Started

Before starting, update your system packages to the latest version with the following command:

apt-get update -y

Next, install other required dependencies with the following command:

apt-get install git curl gnupg2 wget -y

Next, set your system hostname with the following command:

hostnamectl set-hostname

Install Modoboa

Next, download the latest version of Modoboa with the following command:

git clone

Once the download is completed, change the directory to the Modoboa and check the confoguration with the following command:

cd modoboa-installer
./ --stop-after-configfile-check

This will create a new configuration file installer.cfg in your current working directory.

Next, edit the configuration file with the following command:

nano installer.cfg

Change the following lines:

generate = true
type = letsencrypt

email = [email protected]

engine = postgres
host =
install = true

Save and close the file then start the installation with the following command:

./ --interactive

Once the installation has been completed, you should get the following output:

Welcome to Modoboa installer!

Before you start the installation, please make sure the following DNS records exist for domain '':
  mail IN A   
       IN MX

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 (admin:password)

Access the Modoboa Web Interface

Now, open your web browser and type the URL You should see the Modoboa login page:

Modoboa Login

Provide default username: admin, password: password then click on the Log in button. You will be redirected to the Modoboa dashboard on the following page:

Modoboa UI


Currently, there is a BUG in the Modoboa installer which has been introduced after this guide was initially written and tested. The symptom is an 'Internal Server Error' Message after logging into Modoboa GUI. The solution for this issue is to edit the file /srv/modoboa/instance/instance/

nano /srv/modoboa/instance/instance/

and set:

USE_TZ = False

and then restart uwsgi

service uwsgi restart

Reference from Modoboa issue tracker:


In the above post, you learned how to install Modoboa on Debian 10 server. You can now add your first domain and start sending mail to other email addresses.

Share this page:

1 Comment(s)