How to Install Roundcube Webmail on Ubuntu 18.04

r00t August 12, 2018

Install Roundcube Webmail on Ubuntu 18.04

In this tutorial we are going to learn how to install Roundcube Webmail on Ubuntu 18.04. We will also install and configure its prerequisites. Roundcube is a web-based IMAP email client with a very intuitive and modern user interface written in PHP. To use Roundcube you only need a Web browser. RoundCube includes all the features which you need in an email client such as richtext/HTML message composing, address book, support for MIME/HTML emails, multiple sender identities, spell checking, three colum View, drag and drop message management and more.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 Bionic Beaver minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Roundcube Webmail on Ubuntu 18.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing LEMP on Ubuntu 18.04.

You should check out this LEMP stack install tutorial for Ubuntu 18.04, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on.

Step 3. Installing Roundcube Webmail on Ubuntu 18.04 Bionic Beaver.

First, download stable complete version from Roundcube official:

tar xvf roundcubemail-1.3.7-complete.tar.gz 
mv roundcubemail-1.3.6 /var/www/html/webmail

Set the correct directory and file permissions:

sudo chown -R www-data:www-data /var/www/html/webmail

Step 4. Create a database for Roundcube webmail.

Next, we need to create a database for the Roundcube installation:

mysql -uroot -p

Run the following command to create a database for Roundcube:

MariaDB> create database roundcubemail;
MariaDB> create user roundcubeuser@localhost;
MariaDB> set password for roundcubeuser@localhost= password("your-password");
MariaDB> grant all privileges on roundcubemail.* to roundcubeuser@localhost identified by 'your-password';
MariaDB> flush privileges;
MariaDB> exit

Once you have created the database and user, we can initialize Roundcube database using the command below:

cd /var/www/html/webmail
mysql -u roundcubeuser -p roundcubemail < SQL/mysql.initial.sql

Step 5. Configure Apache web server for Roundcube webmail.

For this you can take the default config as a template:

cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/webmail.conf

Now edit the currently created Config as follows:

nano /etc/apache2/sites-available/webmail.conf

Modify the virtual host file for your Magento site to resemble the example below:

<VirtualHost my-domain.tld:80>

ServerName my-domain.tld
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/webmail
<Directory /var/www/html/webmail/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All

ErrorLog ${APACHE_LOG_DIR}/error-magento.log
CustomLog ${APACHE_LOG_DIR}/access-magento.log combined

To load all the settings above, restart Apache2 by running the commands below:

sudo a2ensite webmail.conf
sudo a2enmod rewrite
sudo systemctl restart apache2.service

Step 6. Accessing Roundcube Web Installation.

Now you can access the Magento web install wizard in your browser by entering http://domain_name/installer or http://your_ip/installer to continue your Roundcube installation.

Congratulation’s! You have successfully install and configured Roundcube on your Ubuntu 18.04 LTS server. Thanks for using this tutorial for installing Roundcube Webmail on Ubuntu 18.04 LTS (Bionic Beaver) system.

Leave a Comment

Comments are closed.