{"id":33834,"date":"2020-10-17T13:20:15","date_gmt":"2020-10-17T18:20:15","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=33834"},"modified":"2022-06-03T03:32:35","modified_gmt":"2022-06-03T08:32:35","slug":"how-to-install-roundcube-webmail-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-roundcube-webmail-on-ubuntu-20-04\/","title":{"rendered":"How to Install Roundcube Webmail on Ubuntu 20.04"},"content":{"rendered":"
In this tutorial, we will be showing you how to install the Roundcube Webmail email client on our latest Ubuntu 20.04 VPS<\/a>, LTS release (Focal Fossa). Roundcube is a free and open source webmail client. <\/p>\n\n\n\n Roundcube has an intuitive and user-friendly interface translated in more than 80 languages. Its excellent UX makes Roundcube one of the most popular webmail solutions in the world. The installation of Roundcube is pretty easy and it can run on any Linux server with either a LAMP or LEMP stack. It can also run on almost all web servers and database servers. With all of this, let’s start our installation process.<\/p>\n\n\n\n\n\n\n\n Roundcube comes with lots of handy features out of the box, such as:<\/p>\n\n\n\n Login to your Ubuntu 20.04 VPS via SSH as user root<\/p>\n\n\n\n Where Now, the first thing we should do is to make sure that all installed packages are updated to the latest available version:<\/p>\n\n\n\n We also suggest restarting your server so that all configuration files being used are the latest version.<\/p>\n\n\n\n Roundcube needs a database where it will store its preferences, users, contacts and email messages (if caching is enabled). So for this purpose we will install MariaDB server. MariaDB is an open-source variant of MySQL. The MariaDB package is available in the official Ubuntu 20.04 repository, so the installation is pretty easy.<\/p>\n\n\n\n Once the database server is installed, start it and enable it to automatically start after a server reboot.<\/p>\n\n\n\n Additionally, you can run the We have the database server up and running, so we can proceed and create a database and user for Roundcube. Login to the database server as the root user, enter your password if you set one on the previous step, then run the following SQL commands:<\/p>\n\n\n\n Don’t forget to replace ‘ Roundcube is a PHP-based application, therefore we need to install PHP along with some PHP extensions that are required by Roundcube.<\/p>\n\n\n\n Once all packages are installed, you can check the installed PHP version with the following command:<\/p>\n\n\n\n Roundcube is webmail solution, so we have to install web server to serve the Roundcube file. It supports almost all of the major web servers, but in this tutorial we will use Apache. It can be easily installed with the following command<\/p>\n\n\n\n Once the APT package manager completes the installation, start the web server and enable it to start upon a reboot<\/p>\n\n\n\n Next, create Apache virtual host directory, so you can access Roundcube with a domain or subdomain, instead of your server’s IP address.<\/p>\n\n\n\n Save the file and run the following command to enable the virtual host:<\/p>\n\n\n\n Finally, reload the web server for the changes to take effect:<\/p>\n\n\n\n We have all of our prerequisites configured on the server, so we can go ahead and download the most recent release of Roundcube. At the moment of writing the article, it is version 1.4.6. Go to the Download page of Roundcube’s official website, copy the URL, and download the complete package:<\/p>\n\n\n\n The next command will unpack the downloaded tarball archive and rename the directory:<\/p>\n\n\n\n Change the permissions of the Roundcube content directory to Initiate the Roundcube database:<\/p>\n\n\n\n Next, go to Before going any futher, don’t forget to remove the Finally, visit Congratulations! You now have Roundcube Webmail installed on your Ubuntu 20.04 VPS.<\/p>\n\n\n\n<\/figure><\/div>\n\n\n\n
Features<\/h2>\n\n\n\n
Prerequisites<\/h2>\n\n\n\n
Step 1. Connect to and Update The Server<\/h2>\n\n\n\n
ssh root@IP_Address -p Port_Number<\/pre>\n\n\n\n
IP_Address<\/code> and
Port_Number<\/code> are the actual IP address of your server and SSH port number.<\/p>\n\n\n\n
apt update && apt upgrade<\/pre>\n\n\n\n
Step 2. Install MariaDB server<\/h2>\n\n\n\n
apt install mariadb-server<\/pre>\n\n\n\n
systemctl start mariadb\nsystemctl enable mariadb<\/pre>\n\n\n\n
mysql_secure_installation<\/code> post installation script, to strengthen the security of the MariaDB server as well as set a password for the MariaDB root user. It’s optional, but we strongly recommend securing your database server properly.<\/p>\n\n\n\n
Step 3. Create a MariaDB database and User<\/h2>\n\n\n\n
mysql -u root -p\n\nMariaDB [(none)]> CREATE DATABASE IF NOT EXISTS `roundcube` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcube.* TO roundcubeuser@localhost IDENTIFIED BY 'PASSWORD<\/strong>';\nMariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> quit<\/pre>\n\n\n\n
PASSWORD<\/strong><\/code>‘ with an actual strong password.<\/p>\n\n\n\n
Step 4. Install PHP and its Dependencies<\/h2>\n\n\n\n
apt install php7.4 php7.4-gd php7.4-common php7.4-json php-imagick php7.4-imap php7.4-xml php7.4-opcache php7.4-mbstring php7.4-curl php7.4-zip php7.4-bz2 php7.4-intl<\/pre>\n\n\n\n
php -v<\/pre>\n\n\n\n
PHP 7.4.3 (cli) (built: May 26 2020 12:24:22) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies<\/pre>\n\n\n\n
Step 5. Install Apache and Create a Virtual Host<\/h2>\n\n\n\n
apt -y install apache2<\/pre>\n\n\n\n
systemctl start apache2\nsystemctl enable apache2<\/pre>\n\n\n\n
vim \/etc\/apache2\/sites-available\/roundcube.domain.com.conf<\/pre>\n\n\n\n
<VirtualHost *:80>\n ServerName roundcube.domain.com<\/strong>\n DocumentRoot \/var\/www\/roundcube\/\n\n ErrorLog ${APACHE_LOG_DIR}\/roundcube.domain.com<\/strong>_error.log\n CustomLog ${APACHE_LOG_DIR}\/roundcube.domain.com<\/strong>_access.log combined\n \n Options FollowSymLinks\n AllowOverride All\n \n Options FollowSymLinks MultiViews\n AllowOverride All\n Order allow,deny\n allow from all\n<\/VirtualHost><\/pre>\n\n\n\n
a2ensite roundcube.domain.com<\/pre>\n\n\n\n
systemctl reload apache2<\/pre>\n\n\n\n
Step 6. Download and Install Roundcube<\/h2>\n\n\n\n
wget https:\/\/github.com\/roundcube\/roundcubemail\/releases\/download\/1.4.6\/roundcubemail-1.4.6-complete.tar.gz<\/pre>\n\n\n\n
tar -xzf roundcubemail-1.4.6-complete.tar.gz -C \/var\/www\/html --transform s\/roundcubemail-1.4.6\/roundcube\/<\/pre>\n\n\n\n
www-data<\/code>, the owner for the web server:<\/p>\n\n\n\n
chown www-data: -R \/var\/www\/html\/roundcube<\/pre>\n\n\n\n
mysql -u roundcubeuser -p roundcube < \/var\/www\/html\/roundcube\/SQL\/mysql.initial.sql<\/pre>\n\n\n\n
http:\/\/roundcube.domain.com<\/strong>\/installer<\/code> enter all the necessary details. The installation wizard will create the Roundcube configuration file and then webmail will be ready to use.<\/p>\n\n\n\n
installer<\/code> directory:<\/p>\n\n\n\n
rm -rf \/var\/www\/html\/roundcube\/installer<\/pre>\n\n\n\n
http:\/\/roundcube.domain.com<\/strong><\/code> and login to Roundcube with your email account.<\/p>\n\n\n\n
<\/figure><\/div>\n\n\n\n
\n\n\n\n<\/figure><\/div>\n\n\n\n