How to Install RainLoop Webmail on Ubuntu 16.04

RainLoop Webmail is an Open Source Web Application software written in PHP. It is a simple, fast and web-based email client. It provides a fast web interface to access your emails on almost all major mail providers like Yahoo, GMail, Outlook and many others as well as your own mail servers. These are some of the main features of this Email client.

1. Modern user interface with efficient memory use which can work on low-end webservers.
2. Provides complete support of IMAP and SMTP protocols including SSL and STARTTLS.
3. Minimum resource requirements.
4. Provides interface to set filters.
5. Direct access to the mail server, no storing of emails locally on webservers
6. It allows adding multiple domain accounts.
7. Really simple and fast installation.
8. It can be integrated with Facebook, twitter, Dropbox and Google.
9. Built-in caching system allows for improving overall performance and reducing load on web and mail servers.

In this article, I'm providing the guidelines on how to install RainLoop Webmail on Ubuntu 16.04. Let's see the pre-requisites for the installation.


This application requires a LAMP setup prior to the installation.

  • This works with any of these Web servers: Apache, nginx, lighttpd, MS IIS or other with PHP support
  • PHP Support: 5.3 and above recommended
  • Required PHP extensions: CURL, iconv, json, libxml, dom, openssl, DateTime, PCRE, SPL
  • Supported Browsers: Internet Explorer 9+, Firefox, Opera 10+, Safari 3+, Google Chrome
  • Optional: PDO (MySQL/PostgreSQL/SQLite) PHP extension (for contacts)

As mentioned in the context, RainLoop Webmail is based on PHP, so it is recommended to have a Webserver installed with fully functional PHP to make it working. I've installed Apache, PHP and MySQL on my server prior to the installation. I'll brief the installation steps one by one here.

root@ubuntu:/var/#apt-get install python-software-properties  *//Install the Python Software packages//*
root@ubuntu:/var/#apt install software-properties-common
root@ubuntu:/var# add-apt-repository ppa:ondrej/php
root@ubuntu:/var#apt-get update  *//Update the Softwares//*
root@ubuntu:/var#apt-get install -y php7.0 *// Install PHP //*
Processing triggers for man-db (2.7.5-1) ...
Setting up php7.0-common (7.0.4-7ubuntu2.1) ...
Setting up php7.0-mcrypt (7.0.4-7ubuntu2.1) ...
Setting up php7.0-imap (7.0.4-7ubuntu2.1) ...
Setting up php7.0-xml (7.0.4-7ubuntu2.1) ...
Setting up php7.0-readline (7.0.4-7ubuntu2.1) ...
Setting up php7.0-opcache (7.0.4-7ubuntu2.1) ...
Setting up php7.0-odbc (7.0.4-7ubuntu2.1) ...
Setting up php7.0-mysql (7.0.4-7ubuntu2.1) ...
Setting up php7.0-json (7.0.4-7ubuntu2.1) ...
Setting up php7.0-curl (7.0.4-7ubuntu2.1) ...
Setting up php7.0-cli (7.0.4-7ubuntu2.1) ...
Setting up php7.0-fpm (7.0.4-7ubuntu2.1) ...
Setting up php7.0 (7.0.4-7ubuntu2.1) ...

root@ubuntu:/var# add-apt-repository ppa:ondrej/apache2 *// Add the latest packages for Apache2 //*
root@ubuntu:/var/#apt-get update
root@ubuntu:/var/#apt-get install apache2 *//Install Apache2 //*
root@ubuntu:/var/#add-apt-repository -y ppa:ondrej/mysql-5.6 *//Add the packages for MySQL 5.6 //*
root@ubuntu:/var/# apt-get update
root@ubuntu:/var/# apt-get install mysql-server-5.7 *//Install MySQL 5.6 //*
root@ubuntu:/var/#apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json

Confirming the Installations

After the installation, we need to confirm the installed Apache, PHP and MySQL versions.

root@ubuntu:~# apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-04-15T18:00:57

root@ubuntu:~# php -v
PHP 7.0.4-7ubuntu2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

root@ubuntu:~# mysql -v
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.12-0ubuntu1 (Ubuntu)

Adding to the hosts file

We need to add proper hosts file entry to make it resolve as required.

cat /etc/hosts

Creating the Virtual Host

Now we can create the virtual host for the domain. In addition, make sure to create the document root folder and error log folder mentioned in the virtual host, if it's not created before.

root@ubuntu:/etc/apache2/sites-enabled# cat rainloop.conf

<VirtualHost *:80>
DocumentRoot "/var/www/rainloop/"
ErrorLog "/var/log/httpd/rainloop-error_log"
TransferLog "/var/log/httpd/rainloop-access_log"

<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order deny,allow
Allow from all
Require all granted


Creating the folders specified in the Virtual host

root@ubuntu:~#mkdir /var/www/rainloop/
root@ubuntu:/#mkdir -p /var/log/httpd/

Enabling SSL for the host

For adding an SSL, we need to first generate a self signed certificate for our hostname "" and then add it in the Virtual host to enable the SSL support. Let's see how to create a self signed certificate.

root@ubuntu:/var/#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/conf/ssl/ -out /etc/httpd/conf/ssl/
Generating a 2048 bit RSA private key
writing new private key to '/etc/httpd/conf/ssl/'
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:K-----A
Locality Name (eg, city) []:C-----N
Organization Name (eg, company) [Internet Widgits Pty Ltd]:VIP
Organizational Unit Name (eg, section) []:VIP
Common Name (e.g. server FQDN or YOUR name) []
Email Address []

As seen here, you can provide the details required to generate the certificate. Once it is created, you can add those to our Apache configuration file, as below:

root@ubuntu:/etc/apache2/sites-available# cat rainloop-ssl.conf
<VirtualHost *:443>
ServerName rainloop.lan
DocumentRoot "/var/www/rainloop/"
ErrorLog "/var/log/httpd/rainloop-ssl-error_log"
TransferLog "/var/log/httpd/rainloop-ssl-access_log"

SSLEngine on
SSLCertificateFile "/etc/httpd/conf/ssl/rainloop.lan.crt"
SSLCertificateKeyFile "/etc/httpd/conf/ssl/rainloop.lan.key"

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars

BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

CustomLog "/var/log/httpd/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order deny,allow
Allow from all
Require all granted


Enabling SSL for the Vhost

We can use this command a2ensite in Ubuntu to enable SSL for the enabled domain VirtualHost.

root@ubuntu:/etc# a2ensite rainloop-ssl
Site rainloop-ssl already enabled

Modify the open_basedir value in the PHP configuration file

I've installed PHP 7 in my server, the PHP configuration file is located at /etc/php/7.0/fpm/php.ini. You need to modify the open_basedir value in the PHP configuration file to limit our file operations.

root@ubuntu:~# grep open_basedir /etc/php/7.0/fpm/php.ini
; open_basedir, if set, limits all file operations to the defined directory
open_basedir = /var/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/srv/www/_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/var/www/

After modifying the PHP configuration file, we need to restart the Apache service to make it effective.

Confirm ths status of required PHP modules

This webmail application requires some of the PHP modules to be enabled on the server. Please confirm whether these modules are enabled on your server.

root@rainloop:~# php -m | egrep 'odbc|mcrypt|mysqli|iconv|imap|openssl|pdo|SPL'

Also confirm whether the required SSL protocols are enabled on PHP


Download/Install the RainLoop Webmail application

You can go to the Official RainLoop site and download the latest version available from their website.

root@ubuntu:~# wget
--2016-05-26 06:10:42--
Resolving (,
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4794510 (4.6M) [application/zip]
Saving to: ‘’ 100%[==================================================================>] 4.57M 1.52MB/s in 3.0s

2016-05-26 06:10:46 (1.52 MB/s) - ‘’ saved [4794510/4794510]

root@ubuntu:~# unzip -d /var/www/rainloop/

Once extracting the folder, you can fix the files/folder permissions and ownerships as per the URL here.

root@ubuntu:/var/www/rainloop# chown -R www-data:www-data .

Configure RainLoop via Web Interface

You can manage the Webmail interface either from the Web interface or by modifying the variables in the file /var/www/rainloop/data/_data_dc70aaa98299c32ee3d3ee747f40c63b/_default_/configs/application.ini.

Web interface provides a user-friendly access to modify the settings. We can access the Admin interface from the URL >> with default user/password. The default admin password is "12345".


After login, you need to update your user password to secure one. You can further modify your admin password at Security tab.

security_password reset

If you don't have a database, you can create one named rainloop and provide the required access. All your email contacts and filters will be saved in this database.


By default, this webmail includes GMail, yahoo, qq and outlook mail servers. We can even include as many mail servers domains to this as required.


As you can see all the mail server settings for GMail are added to this system by default.



The plugin tab displays the available plugins and their purpose. You can install any available plugins as per your purpose from the Plugins tab.

rainloop plugin

I installed the plugin called POPPASSD which provided me an option to change my email account password. After enabling the required settings. You can access your mail server domain in the browser from the URL >>


You can give the required email/password to access your email. I accessed one of my test yahoo account with my credentials.


You can get more information regarding the Rain Loop Webmail here.  Howdy! your new advanced email client is ready to use now. Thank you for reading this. I hope you enjoyed reading this article. I would appreciate your valuable comments and suggestions on this.

Have a Good Day!


Share This :

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.