BILLYSOFTACADEMY

How to Install Roundcube Email Client on Linux Ubuntu 22.04 LTS

Introduction

Installing Roundcube Email Client on Linux Ubuntu 22.04 LTS is a simple process that requires minimal effort. Roundcube is an open-source webmail application that provides users with an intuitive and easy-to-use interface for managing their emails. With Roundcube, users can quickly and easily send, receive, organize and store emails from multiple accounts in one place. This guide will walk you through the steps of installing Roundcube on Linux Ubuntu 22.04 LTS so you can begin using it right away.

What is Roundcube and Why Should You Install it on Linux Ubuntu 22.04 LTS?

Roundcube is a free and open-source webmail application that makes it easy for users to access their emails with any device. It is highly configurable and provides a rich set of features such as address book, calendar, tasks, file storage, and more. With its intuitive user interface, Roundcube can be installed on Linux Ubuntu 22.04 LTS in minutes and offers an excellent platform for managing emails. 

It also provides users with the ability to customize their email experience by adding plugins or themes to make it look more personal and unique. With its powerful search capabilities, users can quickly find the emails they need without having to scroll through long lists of messages. If you would like to set up your own private email server then Linux Ubuntu 22.04 LTS is a stable server that can work well run Roundcube Email Client. 

Requirements

Below is a list of items that may be needed to complete this setup successfully:
1) A cloud-hosted VPS or self-hosted server running Linux Ubuntu 22.04 LTS
2) An SSH client such as Putty for Windows or Terminal for macOS
3) A public IP address and domain name pointing to the public IP
4) For self-hosted setup –  you can use Cloudflare Zero Trust if you do not have a public IP (optional)

Overview

Below is an overview of the steps you need to take to install Roundcube:
1) Download and install the LAMP stack
2) Create a MySQL database for Roundcube and configure an Apache virtual host
3) Download and install Roundcube
4) Complete the post installation setup and configure Gmail on Roundcube

1. Download and install the LAMP stack

Roundcube is a web-based application and as such, it needs the LAMP stack. The LAMP stack is a set of software packages usually used to host and run websites and web-based applications. LAMP stands for Linux Apache MariaDB and PHP. Run the command below to install Apache and MariaDB:

When the installation completes, execute the command below to start Apache and MariaDB and configure them to run at system startup.
We recommend running the mysql_secure_installation script to secure the MariaDB database server. Run the command below to start the script
The script will ask a series of question that allow you to set a password for the mysql root account, remove test databases, remove anonymous users, reload the privileges table and more. Respond to each prompt as desired.

Install PHP and needed extensions

The third critical component that needs to be installed is php 8 and needed php extensions that extend the functionality of php. Roundcube is written in PHP and that is one of the reasons why you need to install it. Execute the commands below to install PHP
Run the command below to install needed PHP 8 extensions
Verify the version of php you have installed using the command:

2. Create a MySQL database for Roundcube and configure an Apache virtual host

Roundcube needs a database to save all user generated data and application related settings. Connect to the MariaDB shell and create a new blank database:
Enter your MySQL password if you have configured any then run the command below to create the database:
Now that you have a database for Roundcube set up and ready to go, the next thing you need to do is to create an Apache virtual host. The virtual host tells Apache how to load the Roundcube web-based email client. Run the command below to create the virtual host configuration file:
Copy and paste the configuration below into the file:

Ensure to replace yourdomain.com with your actual domain name. To save changes made to the file, press CTRL + O, hit ENTER then press CTRL + X to exit the file. Enable the virtual host and restart the apache2 system service

3. Download and install Roundcube

In this step you will learn how to download and install the Roundcube web based mail client. Open a new browser window and go to https://roundcube.net/download. Right click on the download link for complete package and click Copy link address. Return to your terminal application and execute the command below to start the download.

Extract the rouncube zip file and move it to the vh_roundcube directory.

Change the owner of the vh_roundcube directory to www-data and set the permissions on all files in the directory to 755

Finally initialise the Roundcube database using the command

4. Complete the post installation setup

Open a new browser window and go to https://mail.yourdomain.com/installer. You will see a Roundcube Webmail Installer page. Check ensure that all components are marked as OK, scroll down and click Next.
Open a new browser window and go to https://mail.yourdomain.com/installer. You will see a Roundcube Webmail Installer page. Check ensure that all components are marked as OK, scroll down and click Next.

Scroll down to the database setup section and enter your database name, username, and password. Click Next and scroll down to the Plugins section. Select any plugins that you would like and click the Create Config button. Click Continue and you will see a page notifying you that the installer directory needs to be removed. Return to your terminal app and run the following command in the public/ directory to remove the installer directory

Return to your web browser and load the domain pointing to the Roundcube Ubuntu Server. You will see a Roundcube login page. However, notice that the connection is marked as not secure. This indicates that you need to install an SSL certificate.

5. Install Certbot and configure a Let's Encrypt SSL certificate

The most common way to setup a Let’s Encrypt SSL certificate on an Apache-hosted site is to use the certbot utility. Run the command below to install certbot and the python3-certbot-apache addon.
When the installation completes, run the command below to initiate the SSL certificate request process:
You will be prompted to enter a valid email address, agree to the terms of service and select the domain that you would like to configure SSL on. Make appropriate selections and when the request process completes, you will see the message: Successfully deployed certificate for yourdomain.com