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-*
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

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

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

13 comments

Mario February 23, 2020 - 4:57 pm

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

Reply
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…

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

Can you elaborate more about what data was destroyed?

Reply
Alex April 19, 2020 - 4:50 pm

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

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

Reply
kelly May 11, 2020 - 6:31 am

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

Reply
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

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

Reply
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

Reply
kelly May 11, 2020 - 1:05 pm

what about the sql? to import on the DB

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

Reply
kelly May 11, 2020 - 1:31 pm

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

Reply
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 https://forum.mysterydata.com

Reply

Leave a Comment