Install and Configure Zimbra Mail Server on Ubuntu 16

The Zimbra Collaboration Suite (ZCS) is a Linux-based Mail Server designed to provide your staff with unified email, calendar, contacts and file-sharing. Both commercial and open source versions are available.

We’ve looked at the open source version as a cost-effective alternative to commercial server-based products such as Microsoft Exchange Server and Software-as-a-Service (SaaS) systems such as Google Apps and Office 365 for Work.

The paid-for version of Zimbra has extra features, most notably ActiveSync for mobile devices and a plugin for Microsoft Outlook. Standard comparative pricing is not available, as the company provides quotes on a per-client basis.

We will explore quickest and easiest way to install Zimbra ( free edition ) mail server along with other components like LDAP, antivirus, antispam, Amavis (amavisd-new) – Content checker, Aspell – Spell checker, MySQL and other collaboration features and a ajax webmail client.

Note: Zimbra recommends to disable firewall in the installation process, once installation has been successfully completed, enable the firewall and add the firewall rules to allow traffic to Zimbra mailserver.

We are using Ubuntu 16.07 for this demo and  below operating systems are also supported.

  • Red Hat® Enterprise Linux® 7 (64-bit)
  • CentOS Linux® 7 (64-bit)
  • SUSE Linux Enterprise Server (SLES) 11

System requirements
Evaluation and Testing

  • Intel/AMD 64-bit CPU 1.5 GHz
  • RAM requirements:
    • For single server installations, a minimum of 8GB of RAM is required.
    • For multi-server installations, contact Zimbra sales for recommendations.
  • 5 GB free disk space for software and logs
  • Temp file space for installs and upgrades*
  • Additional disk space for mail storage

Production environments

  • Intel/AMD 2.0 GHZ+ 64-bit CPU
  • RAM requirements:
    • For single server installations, a minimum of 8GB of RAM is required.
    • For multi-server installations, contact Zimbra sales for recommendations.
  • Temp file space for installs and upgrades*
  • 10 GB free disk space for software and logs (SATA or SCSI for performance, and RAID/Mirroring for redundancy)
  • Additional disk space for mail storage *
  • Temp files space: The zimbra-store requires 5GB for /opt/zimbra, plus additional space for mail storage. The other nodes require 100MB.

General Requirements

  • Firewall Configuration should be set to “No firewall”.
  • RAID-5 is not recommended for installations with more than 100 accounts.

Demo Environment details

  • Ubuntu 16.04 with 4 GB of RAM
  • Ubuntu Server IP –
  • Ubuntu Server FQDN –
  • DNS Server IP – ( Same server , advisable to keep it in a separate server in your network )
  • Gateway IP –
  • Domain name –

Configure hostname

Edit /etc/hosts and add the line mail. Change with the IP you want to use.

itadmin@ubuntu:~$ cat /etc/hosts localhost mail



Also edit /etc/hostname and the line ‘mail’



Reboot the system and test the FQDN of your server with the command hostname -f and hostname.

root@mail:~# hostname -f

root@mail:~# hostname




If you are using any cloud based hosting service then make sure you have set the value of parameter preserve_hostname to true.

Install / Configure BIND DNS

We will install BIND name server in the same system where ZCS will be installed. You are free to install BIND name server in another system in your internal network.

Install bind9 by executing following command in the terminal.


Now edit the file /etc/bind/named.conf and remove ‘//’ from forwarders and add DNS server IP address like below.

root@mail:~#vi /etc/bind/named.conf

root@mail:~# cat /etc/bind/named.conf.options

Create and edit the file /etc/bind/ and add the following. Change the filename according to your domain name.

$TTL 604800
@ IN SOA (
030512 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ); Negative Cache TTL
@          IN          NS          mail
IN         MX        10           mail
IN         A                 
mail     IN           A  

Create and edit the file /etc/bind/db.0.0.127 and add the following.

@           IN       SOA (
2           ; Serial
8H       ; Refresh
2H       ; Retry
4W      ; Expire
1D)      ; Minimum TTL
1           PTR            localhost.

Create and edit the file  /etc/bind/db.1.168.192  and add the following.

@          IN          SOA (
1          ; Serial
8H      ; Refresh
2H      ; Retry
4W     ; Expire
1D)     ; Minimum TTL
10       PTR

Restart bind service

root@mail:~#/etc/init.d/bind9 restart

To configure static IP, Edit /etc/network/interfaces and add the following. Change the values according to your network configuration.

source /etc/network/interfaces.d/*.cfg

auto eth0
iface eth0 inet static

Also edit the file /etc/resolv.conf and add the following.


Now test your nameservers dns record with dig

root@mail:~# dig

; <<>> DiG 9.10.3-P4-Ubuntu <<>>
 ;; global options: +cmd
 ;; Got answer:
 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33646
 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

 ; EDNS: version: 0, flags:; udp: 4096
 ; IN A




;; Query time: 1 msec
 ;; WHEN: Mon Nov 20 02:30:23 UTC 2017
 ;; MSG SIZE rcvd: 95

Up to this point, we have configured FQDN of the server and a nameserver.

Download / Install Zimbra

First disable the firewall by executing the following command in the terminal..

root@mail:~# sudo service ufw disable
root@mail:~# sudo service iptables stop

Download zimbra using wget, extract it and run the installer inside the extracted directory.

root@mail:~# cd ~
root@mail:~# wget
root@mail:~# tar xf zcs-8.7.0_GA_1659.UBUNTU16_64.20160628202554.tgz
root@mail:~# cd zcs-8.7.0_GA_1659.UBUNTU16_64.20160628202554/
root@mail:~# ./

Now the installation will start. Read carefully and answer Yes/No or other values according to your configuration.

Do you wish to continue? [N] y
Do you agree with the terms of the software license agreement? [N] y

Checking for installable packages

Use Zimbra’s package repository [Y] y

Configuring package repository

Select the packages to install

Install zimbra-ldap [Y] y
Install zimbra-logger [Y] y
Install zimbra-mta [Y] y
Install zimbra-dnscache [Y] n
Install zimbra-snmp [Y] y
Install zimbra-store [Y] y
Install zimbra-apache [Y] y
Install zimbra-spell [Y] y
Install zimbra-memcached [Y] y
Install zimbra-proxy [Y] y

Checking required space for zimbra-core
Checking space for zimbra-store
Checking required packages for zimbra-store
zimbra-store package check complete.

The system will be modified. Continue? [N] y

Removing /opt/zimbra
Removing zimbra crontab entry…done.
Cleaning up zimbra init scripts…done.
Cleaning up /etc/security/limits.conf…done.

Finished removing Zimbra Collaboration Server.

Installing packages

DNS ERROR resolving MX for
It is suggested that the domain name have an MX record configured in DNS
Re-Enter domain name? [Yes] yes
Create domain: []
MX: (

In Main menu select Option 6 and Set the admin password and SMTP

Save the Configuration.

Admin URL :
Username    : admin
Password     : <Password>

Webmail URL :
Username   : [email protected]
Password    : <Password>


Although zimbra comes with lot of features, it consumes a lot of server resources. So it is advisable to install it in a server that matches the basic requirements like at least 8GB RAM, 2GHz. processor speed etc.

Please mail me for configuration queries.

About Prasad 58 Articles
Prasad Paul is a Technical Writer, Security Blogger, Network Engineer and IT Analyst. He is a Technology Enthusiast with a keen eye on the Cyberspace and other tech related developments.