Prerequisites
Launched a CentOS 8 instance on DigitalOcean. Setup a sudo privileged account and apply initial security by following initial server setup Login to instance via SSH as root account
Step 1 – Install LAMP Server
Roundcube webmail application is written in PHP programming language. It uses MySQL as the database server. So we required to set up a LAMP server on your server. All the packages are available in default repositories, to install them type: Once the installation finished. enable and start the Apache and MySQL database service. Next, you need to set MySQL root account password and apply security. Run the post-installation script to secure the database server. First set a strong password for the root account and complete the wizard steps. Your CentOS system is ready for the Roundcube installation.
Step 2 – Create Roundcube Database
We are using MySQL as the database server for Roundcube webmail. So first, log in to your MySQL server via the command line. Then create database and a user for authentication:
Step 3 – Download Roundcube
Roundcube webmail official releases can be downloaded from its github repository. At the time of writing this tutorial, Roundcubemail 1.4.4 is the latest available version for the installation. You can download it using the below command. After downloading the archive file, extract it. Then move the directory to the proper location to configure as webroot. And set the proper username and permissions to run on web server. The default Apache server runs with user and group named “apache”. The Nginx users can use “www-data” as username and group.
Step 4 – Configure Apache Web Server
You can deploy Roundcube either as a subdirectory URL (like: https://example.com/webmail), or you can deploy directly on a domain or subdomain. For this tutorial, we will deploy it directly to a subdomain like https://mail.tecadmin.net. Let’s configure Apache server to host the Roundcubemail application. Create an Apache virtual host configuration file and add the following values.
Save your file and restart the Apache service.
Step 5 – Run Roundcube Web Installer
The Roundcube webmail is configured with Apache. You can access the application in your web browser. Here you need to complete the web installer wizard, Which you can access as follows: Open the below URL in browser. Change domain with your domain name: On the first page, you will see the server environment. Make sure there is no error message showing. All the required PHP extensions are properly installed.
Once you verify that all the required extensions are installed. Slide down to bottom of page and click “Next” to continue wizard. Enter the product name as per your requirements. This will be an identification of your webmail. Generally, You will see this in page titles.
Slide down to the “Database Setup” section. Update the details as per created database and user in the above steps.
Again slide down to the bottom of the page and click on “CREATE CONFIG” button. You will see a message like the below screenshot. Once the configuration file created successfully, click on “Continue” button.
In the final page of wizard, click on “Initialize database” button. If you don’t see any button, make your the database details you entered in the previous step are correct.
The installation wizard has been completed now.
Step 6 – Access Roundcube Webmail
As the installation has been completed. The wizard will show you a message to remove the installer directory. You need to remove it manually. Do it with the below command All done. Access the webmail interface in another tab with the domain you configured. You will see the login page. Enter the login details here:
If you see any error, make sure the user is able to access the mailbox with IMAP protocol on the terminal. To verify connection connect IMAP using mutt. After successful login to the Roubcube webmail, you will see the dashboard like the screenshot below. This will also show you the email from your account here.
If you are not seeing any emails here, you need to check the Dovecot configuration. Most probably the Mailbox location configured on the email server (Postfix or Sendmail) is not matching the location on the Dovecot server.
Conclusion
In this tutorial, you learn about the installation and configuration of the Roundcube webmail interface on a CentOS 8 Linux system. Let’s use webmail for the emailing.