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

Back to top button