Managing your own mail server can be a great way to learn about server administration and email systems. Roundcube Webmail is a popular open-source mail client that provides a simple, browser-based interface for sending, receiving, and managing emails.
This guide will help you install Roundcube Webmail on Ubuntu Linux with a working mail server environment using the LAMP stack (Linux, Apache, MySQL, PHP).
Step 1: Login as Root User
Begin by logging in to your Ubuntu server as the root user. Administrative privileges are essential for installing Roundcube Webmail and related dependencies.
- login: root
- password: your_root_password
- After login, you should see:
root@ubuntu:~#
This means you’re ready to configure your system for Roundcube Webmail installation.
Step 2: Update the System
Before you install Roundcube Webmail, it’s best to update existing system packages to their latest versions.
apt-get update
- Once updation is complete give a prompt: clear
Updating your system ensures that the Roundcube Webmail installation runs smoothly without version conflicts.
Step 3: Install the LAMP Server Stack
The Roundcube Webmail client runs on a web server environment powered by Apache, MySQL, and PHP. To install all of them at once:
apt-get install lamp-server^
- This may take a while, after completion type: clear
Step 4: Install Required PHP Extensions
Roundcube Webmail needs several PHP modules for its graphical interface and backend communication. Install them using:
apt-get install php-xml
- Wait for the completion
- After completion type:
Apt-get installphp7.0-mbstring
Wait for the completion and enter: clear
Step 5: Configure PHP Time Zone
Setting the correct timezone ensures accurate timestamps in your Roundcube Webmail emails.
Navigate to the PHP configuration directory:
cd /etc/php/7.0/apache2
- Open the PHP configuration file:
gedit php.ini
- Find the timezone section and set it:
date.timezone = "Asia/Kolkata"
- Save and type: clear
This ensures Roundcube Webmail reflects the correct time zone for all users.
Step 6: Secure and Configure MySQL Database
To enhance security before creating the Roundcube Webmail database, run, and follow the series of propmts
mysql_secure_installation
- Afterward, provide credentials and press Y for everything
- Afterward, log in to MySQL and create a database and user for Roundcube Webmail:
mysql -u root –p
- Inside MySQL, execute:
CREATE DATABASE roundcubedb;
CREATE DATABASE roundcubedb;
CREATE USER 'mailadmin' IDENTIFIED BY 'mailadmin';
GRANT ALL PRIVILEGES ON roundcubedb.* TO 'mailadmin';
FLUSH PRIVILEGES;
EXIT;
clear
Step 7: Download and Install Roundcube Webmail
Now it’s time to install Roundcube Webmail itself. Move to your web directory and download the package and follow the series of prompts
cd /tmp && wget https://github.com/roundcube/roundcubemail/releases/download/1.2.0/roundcubemail-1.2.0-complete.tar.gz
- Then press clear
- Then put prompt:
tar -xzf roundcubemail-1.2.0-complete.tar.gz –c /var/www
Mv /var/www/roundcubemail-1.2.0/ /var/www/webmail
- Then press clear
- Set the appropriate permissions for Apache:
chown -R www-data:www-data /var/www/webmail/*
chown -R www-data:www-data /var/www/webmail/
This makes the Roundcube Webmail directory accessible for configuration and hosting.
Step 8: Import the Roundcube Webmail Database
To prepare the Roundcube Webmail database, import its SQL schema:
mysql -u mailadmin -p roundcubedb < /var/www/webmail/SQL/mysql.initial.sql
- This creates the necessary tables and relationships that Roundcube Webmail needs to function properly.
- Restart the Apache server
Step 9: Note the IP address and configure
Ifconfig
- Note down the IP Address
- Open the web browser enter the IP Address followed by webmail/installer/
- Scroll down and press Next
- In Database Setup keep database name as roundcubedb, and username and password as mailadmin
All done.
By following these steps, you have successfully set up Roundcube Webmail and a fully functional mail server on Ubuntu Linux.
This tutorial covered everything — from installing the LAMP stack to database creation, PHP configuration, and Apache setup — ensuring your Roundcube Webmail installation runs smoothly.
With its clean interface, strong IMAP support, and easy customization options, Roundcube Webmail is ideal for organizations, students, and developers who want full control over their email environment.
Frequently Asked Questions (FAQs)
1. What is a mail server and why is it important?
A mail server is software that sends, receives, and stores emails. It acts as a post office for electronic communication, handling all mail transfers securely and efficiently.
2. Can I host my own email service on Ubuntu?
Yes. Ubuntu supports full email hosting through open-source software such as Postfix, Dovecot, and Apache or Nginx web servers.
3. What are the prerequisites before setting up a mail system on Linux?
Before installation, ensure your system has an updated package list, root privileges, a stable internet connection, and a domain name configured with proper DNS and MX records.
4. Why is the LAMP stack required in mail setup?
LAMP (Linux, Apache, MySQL, PHP) provides the backend for hosting and managing web-based applications like webmail interfaces and databases that store user data.
5. How can I test if my mail server is working correctly?
You can send a test message using command-line utilities like mail or telnet, or use browser access to verify successful login and message delivery.
6. What should I do if emails are going to spam?
Check SPF, DKIM, and DMARC records of your domain. Proper email authentication and clean server reputation prevent emails from landing in spam folders.
7. Is SSL or TLS required for an email server?
Yes, SSL/TLS ensures that email communication is encrypted between your server and clients, maintaining privacy and preventing data interception.
8. How often should I update my server packages?
Regular updates are essential. Running apt-get update && apt-get upgrade once a week ensures your system remains secure and bug-free.
9. Can I use another webmail interface instead of this one?
Absolutely. There are many open-source webmail clients like RainLoop, SquirrelMail, or Horde that can be integrated with your existing mail setup.
10. What’s the easiest way to back up emails and configurations?
You can automate backups using cron jobs and tools like rsync or duplicity. Back up your /var/mail/, /etc/, and database directories regularly.
Table of Contents
Discover more from Root Learning
Subscribe to get the latest posts sent to your email.