Control PanelUbuntuVesta CP

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

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-*
wget https://github.com/roundcube/roundcubemail/releases/download/1.4.2/roundcubemail-1.4.2-complete.tar.gz

**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/
mv config.inc.php.sample config.inc.php

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
<!--?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.
##
$dbuser='roundcube';
$dbpass='m50p2Hp1J23h';
$basepath='';
$dbname='roundcube';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';

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/config.inc.php

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 :
mysql
DROP DATABASE roundcube;
CREATE DATABASE roundcube; 
quit

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 domain.com/webmail oe ip/webmail

Sandeep B.

I'm a system admin and php developer and currently working as System Admin In CWP Control panel, expertise in Linux and Windows administration RHEL certified admin.

Related Articles

19 Comments

  1. 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?

    1. 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 🙂

  2. 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!

  3. 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.

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

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

    1. 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

    1. 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

  6. I get this message:
    DATABASE ERROR: CONNECTION FAILED!
    Unable to connect to the database!
    Please contact your server-administrator.

Leave a Reply

Your email address will not be published.

Back to top button