How to Configure Postfix and Dovecot with Roundcube (Part 2)

This is the second part of the article, How to Configure Postfix and Dovecot with Roundcube.

Configure Roundcube

Roundcube WebMail is a browser-based IMAP client with an application-like user interface, It provides full functionality you expect from an email client, including MIME support, address book, folder manipulation, message searching, and spell checking.

RoundCube is for users who need a user-friendly web interface with some additional features available.

Install LAMP

Firstly you have to configure LAMP stack in your managed VPS server for that run the following command:

# yum install -y httpd php php-fpm php-mcrypt php-cli php-gd php-curl php-xml php-mysql php-mbstring php-pspell php-imagick mariadb-server

Configure PHP settings

Open /etc/php.ini file with the vi editor by using the following command:

# vi /etc/php.ini

Search for date.timezone and edit the line, also remove “;” comment from the below line:

→ date.timezone = “Asia/Kolkata”

Configure MariaDB server

Run mysql_secure_installation in terminal and configure the basics settings of MariaDB.

Now create database for roundcube by using the following command:

# mysql -u root -p

Enter your root password

MariaDB [(none)]> CREATE DATABASE roundcubemail

MariaDB [(none)]> CREATE USER ’roundcube’@’localhost’ IDENTIFIED BY ‘=213@!#webL’;

MariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcubemail.* TO ’roundcube’@’localhost’;


MariaDB [(none)]> exit

Next import the roundcube table layout to the newly created database.

# cd /var/www/html/roundcubemail/

Configure Roundcube

Firstly, download the latest stable version (1.3.7 at the time of this writing) of Roundcube from thedownload page to get it, and upload the files into your web server document root.

# wget -c

# mysql -u root -p roundcubemail < SQL/mysql.initial.sql

# tar xzf roundcubemail-1.3.7-complete.tar.gz

# mv roundcubemail-1.3.7 /var/www/html/roundcubemail

Now set the appropriate permission on the roundcube web root files by using the following command:

# chown -R apache:apache /var/www/html/roundcubemail

Last step to restart the apache and mariaDB server by using the following command:

# systemctl restart httpd mariadb;

Now open browser and use the address

The configurations page allows you to set up your Roundcube instance. We will only explain the important options for the scope of this guide.

Under the General Configuration, set a product_name for example Webmail.

Roundcube Product Name

Go to Database setup, enter the database host, name, user, and password to connect to the MySQL server.

Roundcube Database Settings

Roundcube Database Settings

Then scroll down to IMAP and SMTP settings and enter the IP address of your IMAP and SMTP server, if it’s the same server on which you are running Roundcube, leave it as “localhost” and also specify other necessary parameters.

You can specify other settings according to your needs, once you are done, click on Create Config.

  1. You should now see a message saying ”The config file was saved successfully into /var/www/html/roundcubemail/config directory of your Roundcube installation.” Click on Continue.Roundcube Configuration File Created

Roundcube Configuration File Created

You can review your configuration from the Test config page as shown in the following screenshot.

Test Roundcube Configuration

Test Roundcube Configuration

Next, remove the whole installer folder (which contains files that may expose sensitive configuration data like server passwords and encryption keys to the public) from the roundcube root directory (or make sure that enable_installer option in is disabled).

# rm -rf /var/www/html/roundcubemail/installer

Finally, use the URL to access the roundcube login page. Enter your user name and password to view your mails.

Roundcube Webmail Login


After the above installation, you will be able to use Postfix for SMTP, Dovecot for IMAP, Roundcube for IMAP web client.


Learn how to scale, manage, and optimize your applications with a SLB. Read our solution brief "Get More from Your Enterprise Network".


Get started with CloudMinister Today