Roundcube (Webmail) on CentOS /RHEL 7

Roundcube is a web browser based mail client & also known as webmail. It provides a GUI ( Graphical User Interface ) where end users can check their mails, can create & manage folders, can use address book to search email ids and lot of other webmail features.
To install roundcube on CentOS 7 followings are the prerequisite that should be installed.
In My Case i have already installed Postfix with dovecot on CentOS 7 with
  • Domain name =
  • Hostname =

Follow below Steps to install & configure latest versions of Roundcube :

Step:1 Install PHP , Database & Apache using below command :

[root@hackthesec ~]# yum install httpd php php-common php-json php-xml php-mbstring php-imap php-pear-DB php-mysql mysql mariadb-server
Once the above package list is installed , set the time zone value in PHP .
root@hackthesec ~]# vi /etc/php.ini
date.timezone = Asia/Delhi
Save & exit the file

Step:2 Create & Configure Roundcube Database

Let us first set the Initial settings & root password of Mariadb Server :
[root@hackthesec ~]# systemctl start mariadb
[root@hackthesec ~]# systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/'
[root@hackthesec ~]#
[root@hackthesec ~]# mysql_secure_installation
Above Command “mysql_secure_installation” will allow us to set root password , remove anonymous users , disable remote root login and will remove test database.
Now Create database for Roundube and grant all the permissions to the database

Step:3 Download tar file of Roundcube

Download latest version of Roundcube tar file either from their official site “” or we can use below wget command.
[root@hackthesec ~]# wget
Untar the downloaded file in your web server document root.
[root@hackthesec ~]# tar -zxpvf roundcubemail-1.1.3-complete.tar.gz -C /var/www/html/
Rename the extracted file as Roundcube and set the required permissions
[root@hackthesec html]# mv roundcubemail-1.1.3 roundcube
[root@hackthesec html]# chown apache:apache roundcube
Start the Apache service
[root@hackthesec html]# systemctl start httpd
[root@hackthesec html]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/'
[root@hackthesec html]#

Step:4 Start Roundcube installation using web browser installer.

To start the installation of Rouncube , access the below url in the web browser

click on Next…
Define the Database, Authentication Mechanism, SMTP & IMAP setting in this step. When We click on Create Config option it will ask us to Copy or download the configuration and save it as within the /var/www/html/roundcube/config/ directory of your Roundcube installation.
In my case i am using http based authentication mechanism , so i create one user on my Linux box and set its password using htpasswd command .
Linux box and set its password using htpasswd command .
[root@hackthesec ~]# htpasswd -c /home/hackthsec/.htpasswd hackthsec
New password:
Re-type new password:
Adding password for user hackthsec
[root@hackthesec ~]#

Remove the installer directory from your web server document root (/var/www/html/roundcube )
[root@hackthesec ~]# cd /var/www/html/roundcube/
[root@hackthesec roundcube]# rm -rf installer
[root@hackthesec roundcube]#

Step:5 Now access your account using Roundcube

Open the url in the browser “” , use the credentials that we set using htpasswd command.

About Author:

I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Newer Post
Older Post


Post a Comment