Install/Update Roundcube Latest Version on Ubuntu 18.04/16.04/VestaCP

by Sandeep B.

In this tutorial we’ll Updating Roundcube mail client to latest version in Ubuntu, Under Ubuntu the old vesion of Roundcube mail client is installed and you want to use latest version with new theme and features including plugins to work too. This guide will go through complete update/Install process of roundcube.

Roundcube Webmail is a browser-based multilingual IMAP client with an application-like user interface. It provides full functionality you expect from an email client, including MIME support, address book, folder management, message searching and spell checking. Roundcube Webmail is written in PHP and requires the MySQL, PostgreSQL or SQLite database. With its plugin API it is easily extendable and the user interface is fully customizable using skins.

You need to login in to SSH/terminal.

Step 1 :

Backup current installation :

mv /var/lib/roundcube /var/lib/roundcube.bak

And roundcube DB :

cd /home
mysqldump roundcube > roundcube.sql

Step 2 :

Downloading latest Roundcube file :

cd /var/lib
rm -rf roundcubemail-*

**you can find the latest download link here

Extract it :

tar zxvf roundcubemail-*-complete.tar.gz

Renaming the Directory and fixing some permission :

mv roundcubemail-1.4.2 roundcube
chown -R www-data:www-data /var/lib/roundcube/temp

Step 3 :

Configuration of roundcube :

Restart apache2 and nginx service :

service apache2 restart
service nginx restart

Renaming roundcube config file :

cd /var/lib/roundcube/config/

Now we’ll configure roundcube db :

Save the current roundcube db name, db user and db password from this file :

cat /etc/roundcube/debian-db.php

for 16.04

cat /etc/roundcube/debiand-db-roundcube.php

output will be like this :

root@mysterydata# cat /etc/roundcube/debian-db.php
## database access settings in php format
## automatically generated from /etc/dbconfig-common/roundcube.conf
## by /usr/sbin/dbconfig-generate-include
## by default this file is managed via ucf, so you shouldn't have to
## worry about manual changes being silently discarded.  *however*,
## you'll probably also want to edit the configuration file mentioned
## above too.

you need to save dbuser, dbpass and dbname

Now edit you can use SFTP/Filezilla to edit the file or via command line with “nano

apt install nano -y
nano /var/lib/roundcube/config/

Find this line :

$config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

**Here –
dbuser: roundcube
dbpass : pass
dbname : roundcubemail

and replace information dbuser, dbpass and dbname from above file /etc/roundcube/debian-db.php i.e.

After editing Final line will look like :

$config['db_dsnw'] = 'mysql://roundcube:m50p2Hp1J23h@localhost/roundcube';

And save it.

Step 4

(you can skip this step if you’re updating from 1.3.x):

This step will install fresh roundcube Database.

Now you need to use command line mysql its easy just follow the commands one by one :
DROP DATABASE roundcube;

Now we’ll import Roundcube DB

mysql roundcube < /var/lib/roundcube/SQL/mysql.initial.sql

Step 5 :

Now we need to disable roundcube update from Ubuntu repository :

apt-mark hold roundcube

Troubleshoot :

If you get 500 internal server error or blank white screen Restart apache2 and nginx service :

service apache2 restart
service nginx restart

Done You’ve upgraded roundcube client you can access new roundcube via oe ip/webmail

If this post helps you in any way please consider a donation

Donate with PayPal :


You may also like


Mario February 23, 2020 - 4:57 pm

Amazing friend!!! Thank you so much!!!

Gwyneth Llewelyn April 1, 2020 - 7:43 pm

O-kay… but this pretty much destroys the existing data. It works, though, if that’s what one wants to do…

Sandeep B. April 1, 2020 - 7:45 pm

Can you elaborate more about what data was destroyed?

Alex April 19, 2020 - 4:50 pm

I get this message:
Unable to connect to the database!
Please contact your server-administrator.

Sandeep B. April 19, 2020 - 10:33 pm

you can update the password for roundcube user via phpmyadmin or you didn’t followed the steps correctly.

kelly May 11, 2020 - 6:31 am

didnt work for me. i tried all the steps. i stil get database error.

Sandeep B. May 11, 2020 - 8:24 am

Hi kelly, did you followed the step 4 correctly ? and try login with roundcube db username and roundcube db username password via phpmyadmin if password is wrong you’ll not able to login, then you need to reset the password for roundcube db username

kelly May 11, 2020 - 12:31 pm

i followed it carefully. also, there is no roundcube db in my phpmyadmin. also, vesta make use of admin prefix before the database.

Sandeep B. May 11, 2020 - 12:35 pm

Don’t know what you’re talking about .. if there is no roundcube db then you didn’t followed the tutorial carefully

You can always create roundcube db and user from phpmyadmin

kelly May 11, 2020 - 1:05 pm

what about the sql? to import on the DB

kelly May 11, 2020 - 1:21 pm

now dont know what i did but i think it works now. had to edit via sftp and ssh thanks.

kelly May 11, 2020 - 1:31 pm

help. another problem i faced is connection to server failed. any advice or suggestion?

Sandeep B. May 11, 2020 - 1:40 pm

Its better to create a topic in our forum.with detailed information doesn’t seems to be related with this tutorial

JD August 11, 2020 - 2:03 am

Worked a treat. Thanks for this, I would have spent ages researching what needed to be trashed and what needed to be saved.

Richard October 6, 2020 - 8:21 am

This worked perfectly.

It must be pointed out that the db error is caused by the “new” database name (roundcubemail) should be renamed to “roundcube” in the config file. This was the problem for me.

Marco Arroyo October 16, 2020 - 9:18 pm

Gracias me ayudó mucho.

Michael November 16, 2020 - 9:29 am

worked great. had the database connect error.. but that was only because I got the password from the debian-db.conf file and not the debian-db-roundcube.php. Not sure why it has both files. .But the second one had the right password in it.

Thanks much!

wisiena December 10, 2020 - 7:57 pm

Is it correct to do db dump to “mysqldump roundcube > roundcube.sql” and after installation importing new structure from new installation “mysql roundcube < /var/lib/roundcube/SQL/mysql.initial.sql".
What about importing previous data from roundcube.sql to new initial database?

Sandeep B. December 11, 2020 - 4:04 am

you can upload/create/import old db (backup sql dump you’ve taken “mysqldump roundcube > roundcube.sql”) by creating a new db with any name then open it in phpmyadmin (as root user) there you’ve option to copy-send the data from one db to another, you can easily migrate your required data from there to new roundcube db.
simple as pie :)


Leave a Comment