- Nikhil Bhaskar
- July 24, 2021
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 https://github.com/modoboa/modoboa-installer
change the directory.
cd modoboa-installer
Check the configuration file.
python3 ./run.py --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.
[certificate]
generate = true
type = letsencrypt
[letsencrypt]
email = [email protected]
[database]
engine = postgres
host = 127.0.0.1
install = true
Start the Modoboa.
python3 ./run.py --interactive domain-name
Here is the command output.
Welcome to Modoboa installer!
Warning:
Before you start the installation, please make sure the following DNS records exist for domain 'linuxbuz.com':
email IN A <IP ADDRESS OF YOUR SERVER>
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 ;)
Starting...
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 ./run.py --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
https://email.domain-name
Here is the output:
- By default,username is admin.
- Password is password.
- Now Modoboa is Ready.