How to Set Up Roundcube Webmail on Your Breeze
Roundcube is a feature-rich, open-source webmail client that provides a modern browser-based interface for reading and sending email. Installing Roundcube on your Breeze instance gives your users a convenient way to access their mailboxes from anywhere without a desktop email client.
Prerequisites
- A Breeze server with a working mail server (Postfix + Dovecot recommended)
- Apache or Nginx web server with PHP 8.x installed
- MySQL or MariaDB for the Roundcube database
- A valid SSL certificate for secure access
Step 1: Install Dependencies
sudo apt update
sudo apt install -y php-cli php-mysql php-xml php-mbstring php-intl \
php-zip php-gd php-curl php-imagick php-ldap composer unzip
Step 2: Download Roundcube
cd /var/www
sudo wget https://github.com/roundcube/roundcubemail/releases/download/1.6.6/roundcubemail-1.6.6-complete.tar.gz
sudo tar xzf roundcubemail-1.6.6-complete.tar.gz
sudo mv roundcubemail-1.6.6 roundcube
sudo chown -R www-data:www-data /var/www/roundcube
sudo chmod -R 750 /var/www/roundcube/temp /var/www/roundcube/logs
Step 3: Create the Database
sudo mysql -u root -p
CREATE DATABASE roundcubemail CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'StrongPassword123';
GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Import the initial schema:
mysql -u roundcube -p roundcubemail < /var/www/roundcube/SQL/mysql.initial.sql
Step 4: Configure Roundcube
Copy the sample config and edit it:
cd /var/www/roundcube/config
cp config.inc.php.sample config.inc.php
nano config.inc.php
Set the key configuration values:
$config['db_dsnw'] = 'mysql://roundcube:StrongPassword123@localhost/roundcubemail';
$config['imap_host'] = 'ssl://localhost:993';
$config['smtp_host'] = 'tls://localhost:587';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['support_url'] = '';
$config['product_name'] = 'Breeze Webmail';
$config['des_key'] = 'your-24-char-random-key!!';
$config['plugins'] = ['archive', 'zipdownload', 'managesieve'];
$config['language'] = 'en_US';
$config['skin'] = 'elastic';
Step 5: Configure the Web Server
Create an Nginx server block for Roundcube:
server {
listen 443 ssl http2;
server_name mail.yourdomain.com;
root /var/www/roundcube;
index index.php;
ssl_certificate /etc/letsencrypt/live/mail.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.yourdomain.com/privkey.pem;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\. { deny all; }
location ~ ^/(config|temp|logs)/ { deny all; }
}
sudo ln -s /etc/nginx/sites-available/roundcube.conf /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
Step 6: Run the Installer
Navigate to https://mail.yourdomain.com/installer/ in your browser to verify the installation. Once confirmed, remove the installer directory:
sudo rm -rf /var/www/roundcube/installer
Security Hardening
- Remove the installer — always delete it after setup
- Restrict config permissions —
chmod 640 config/config.inc.php - Enable rate limiting — set
$config['login_rate_limit']to prevent brute force attempts - Use fail2ban — monitor
/var/www/roundcube/logs/errors.logfor failed logins - Keep updated — regularly apply Roundcube security patches