Using RoundCube Webmail With ISPConfig 3 On Debian Wheezy (nginx)

Using RoundCube Webmail With ISPConfig 3 On Debian Wheezy (nginx)

This guide explains how to install the RoundCube webmail application on a Debian Wheezy server running ISPConfig and nginx, and how to enable the ISPConfig 3 plugins for RoundCube so that users can perform actions like changing their email passwords from within RoundCube. Roundcube webmail is a browser-based multilingual IMAP client with an application-like user interface; it comes with functions like MIME support, address book, folder manipulation, message searching and spell checking.if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-box-3-0’)};

I do not issue any guarantee that this will work for you!if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-3-0’)};


1 Preliminary Note

This tutorial assumes you are using nginx as the web server on your ISPConfig 3 server; this tutorial will not work for Apache. I’m going to install RoundCube from the Debian Wheezy repositories – it is a reasonably recent version ( vs 0.9.1 (current stable version)).

I will show how to configure a vhost for RoundCube so that it can be accessed over the alias /webmail (e.g.


2 Creating A Remote User In ISPConfig

The ISPConfig 3 plugins for RoundCube work through ISPConfig’s remote API. To use this API, we need a remote user. To create such a user, go to System > User Management > Remote Users and click on the Add new user button:

Provide a username and password for the user…

if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-4-0’)};

… and enable the following functions:

  • Server functions
  • Client functions
  • Mail user functions
  • Mail alias functions
  • Mail spamfilter user functions
  • Mail spamfilter policy functions
  • Mail fetchmail functions
  • Mail spamfilter whitelist functions
  • Mail spamfilter blacklist functions
  • Mail user filter functions

Then click on Save.


3 Installing RoundCube

We can install RoundCube as follows:

apt-get install roundcube roundcube-plugins roundcube-plugins-extra

You will see the following questions:

Configure database for roundcube with dbconfig-common? <– Yes
Database type to be used by roundcube: <– mysql
Password of the database’s administrative user: <– yourrootsqlpassword (the password of the MySQL root user)
MySQL application password for roundcube: <– roundcubesqlpassword
Password confirmation: <– roundcubesqlpassword

This will create a MySQL database called roundcube with the MySQL user roundcube and the password roundcubesqlpassword.

Next go to your website in ISPConfig. On the Options tab, you will see the nginx Directives field:

Fill in the following directives and click on Save (it does not matter if you have PHP enabled for this vhost or not because this code snippet uses the system’s default PHP which runs under the user and group www-data which is important because RoundCube is installed outside of the vhost’s document root – in /var/lib/roundcube):

client_max_body_size 100M;

location /roundcube {
         root /var/lib/;
         index index.php index.html index.htm;
         location ~ (.+\.php)$ {
                    try_files $uri =404;
                    include /etc/nginx/fastcgi_params;
                    # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    fastcgi_intercept_errors on;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_buffer_size 128k;
                    fastcgi_buffers 256 4k;
                    fastcgi_busy_buffers_size 256k;
                    fastcgi_temp_file_write_size 256k;
         location ~* /.svn/ {
                     deny all;
         location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
                     deny all;
location /webmail {
         rewrite ^ /roundcube last;

With this configuration, RoundCube will be accessible under the URLs and


4 Configuring RoundCube

Open /etc/roundcube/

vi /etc/roundcube/

… and set $rcmail_config[‘default_host’] = ‘localhost’; (or the hostname or IP address of your mail server if it is on a remote machine):

$rcmail_config['default_host'] = 'localhost';

Otherwise RoundCube will ask for a hostname before each login which might overstrain your users – we want to make usage as easy as possible.

Next install the ISPConfig 3 plugins for RoundCube:

cd /tmp
git clone
cd /tmp/ispconfig3_roundcube/
mv ispconfig3_* /usr/share/roundcube/
cd /usr/share/roundcube/
mv ispconfig3_account/config/ ispconfig3_account/config/
ln -s /usr/share/roundcube/ispconfig3_* /var/lib/roundcube/plugins/

Open ispconfig3_account/config/

vi ispconfig3_account/config/

… and fill in the login details of your ISPConfig remote user and the URL of the remote API – my ISPConfig installation runs on, so the URL of the remote API is

$rcmail_config['identity_limit'] = false;
$rcmail_config['remote_soap_user'] = 'roundcube';
$rcmail_config['remote_soap_pass'] = 'Sw0wlytlRt3MY';
$rcmail_config['soap_url'] = '';

Finally open /etc/roundcube/ again…

vi /etc/roundcube/

… and enable the jquerui plugin plus the ISPConfig 3 plugins…

// ----------------------------------
// ----------------------------------

// List of active plugins (in plugins/ directory)
//$rcmail_config['plugins'] = array();
$rcmail_config['plugins'] = array("jqueryui", "ispconfig3_account", "ispconfig3_autoreply", "ispconfig3_pass", "ispconfig3_spam", "ispconfig3_fetchmail", "ispconfig3_filter");

… and change the skin from default to classic (otherwise the ISPConfig 3 plugins will not work):

// skin name: folder from skins/
$rcmail_config['skin'] = 'classic';

That’s it; now you can access RoundCube under the alias /webmail (e.g. Log in with the email address and password of an email account created through ISPConfig:

This is how RoundCube looks:

Under Settings > Account you can use the ISPconfig 3 plugins for RoundCube to modify your settings, for example…

… you can set a new password for your email account without using ISPConfig:


  • RoundCube:
  • ISPConfig 3 Plugins for RoundCube:
  • ISPConfig:
  • Debian:
About the Author

Leave a Reply