Roundcube and Google Contacts

The Roundcube logo

The Roundcube logoOne of the reasons I use Roundcube is that when I was shopping for a webmail client, there was a plugin that provided Google Contacts integration. Unfortunately, that plugin hasn’t been updated for over a year and it has rate limiting issues. So, when upgrading my Roundcube installation to 0.8.4 I decided it had to be replaced. Updated for Roundcube 0.9.

Great. Another Roundcube-adventure.

Fortunately, Google Contacts supports CardDAV. Having a standard protocol makes the odds of finding a working plugin a lot bigger. Unfortunately, setting up CardDAV for Google Contacts takes a bit more effort. Fortunately, I decided to write those steps down, so you don’t have to figure out how to do it.

I’ve used the RCMCardDAV plugin. I could not get the latest release at the time of this writing (0.7.0) to work. YMMV, since I did change some configuration settings after seeing the better error messages provided by trunk. In any case, I used the latest SVN revision (rev 261). The repository is at Update October 9th, 2013: RCMCardDAV now has a GitHub repository:

The installation instructions are pretty clear (refer to INSTALL for the latest instructions):

  • Unpack to <roundcube>/plugins
  • Add the name of the plugin folder to the $rcmail_config[‘plugins’] in <roundcube>/config/
  • Run <carddav-plugin>/dbinit/<yourdatabase>.sql in your database-tool of choice

Now all we need to do is configure a CardDAV address book in our account. First, create an application-specific password in your Google Account if you use two-step verification. Then log in to Roundcube:

  • Go to Settings → Preferences → CardDAV
  • Fill in the fields with the following information:
    • Name of the addressbook: any name you want. I used the very original “Google Contacts”. The address book should not need to exist yet. It will be created.
    • Activate CardDAV-Addressbook: keep checked.
    • Username: the full email-address for your Google Account, e.g.
    • Password: if you use two-step verification, your application-specific password. If you don’t, the password to your Google Account.
    • URL: (This is notably different from the iOS CardDAV setup. Google will simply instruct you to use “”. That value does not work here.) Update October 9th, 2013: If you use the latest revision of RCMCardDAV (here), you can simply enter “”. RCMCardDAV now has service discovery. (Tested with Roundcube 0.9.)
    • Update interval (hours): I kept it at “1”. Do as you like.
  • Save

And that’s it. If you go to Address Book, you will see a new address book called “Google Contacts (default)”. Give it a moment if your contacts haven’t shown up yet.

RCMCardDAV stores two log files in your Roundcube log directory (<roundcube>/logs): carddav and carddav.warn. If you have any problems, those two files should be the first place to look if you have any problems. If the files don’t exist, no log messages have been written to it.

Update October 9th, 2013: Updated for Roundcube 0.9 and latest revision of RCMCardDAV.

Update June 17th, 2014: Larry Rosenman writes: “if you have a lot of contacts (I have 4600+), you may need to adjust the timeout in carddave_common.php from 10 to something bigger. I used 120.”

Update August 7th, 2017: John Simmonds writes:

I thought you might like some information for updating your page with reference to Roundcube v1.2-beta using 2.0.4. of carddav on Ubuntu 16.04LTS.

I’ve installed Roundcube using “apt-get install roundcube rounndcube-plugins, roundcube-plugins-extra“, so Ubuntu has spread the installation around the file system a bit.

First it seems we can’t get any joy until we login to google, select My Account, Sign-in & security and then and enable less secure apps from the bottom of the page.

We now no longer need to create a database for carddav, that’s done for us when a user logs into Roundcube.

So the procedure I followed was:

cd /tmp;


Ubuntu puts roundcube plugins in /usr/share/roundcube, then links to them from /var/lib/roundcube

cd /usr/share/roundcube/plugins;

tar jxvf /tmp/carddav-2.0.4.tar.bz2;

chown -R root:root /usr/share/roundcube/plugins/carddav;

ln -s /usr/share/roundcube/plugins/carddav /var/lib/roundcube/plugins/carddav;

Configuration files on Ubuntu live in /etc/roundcube, so we’ll copy the file there, and then link to it.

mkdir /etc/roundcube/plugins/carddav;

cp /usr/share/roundcube/plugins/carddav/ /etc/roundcube/plugins/carddav/;

ln -s /etc/roundcube/plugins/carddav/ /usr/share/roundcube/plugins/carddav/;

Now edit /usr/share/roundcube/plugins/carddav/, add the following line in the appropriate place to make passwords more secure:

$prefs['_GLOBAL']['pwstore_scheme'] = 'encrypted';

Then edit /etc/roundcube/ and find the $config['plugins'] section and add the following to it


And that’s it.

Then login to Roundcube as you describe, click on settings, then select CardDAV section, and configure:

  • Name of addressbook: Google Contacts
  • Username: <google email address>
  • Password: <google password>
  • URL:

Click save.

Update March 28th, 2020: This plugin doesn’t seem to work any longer with Google’s CardDAV, and using it with Google is not supported. So I have switched to stwa/google-addressbook.

Important detail about google-addressbook is to use master, not the release. The latest release doesn’t work.

The only configuration you’ll need to do is in the user settings (under Preferences → Contacts). Just enable it there and authorize the application. You don’t need to register your application with Google, just ignore the ugly warning.