Roundcube is the most popular open-source webmail client. It connects to any IMAP server and provides a Gmail-like interface in the browser.
Prerequisites
- Ubuntu 20.04 with Nginx and PHP 7.4+
- MySQL or MariaDB
- An IMAP server (Dovecot, Exchange etc.)
Step 1 — Install Dependencies
sudo apt install php7.4-{fpm,mysql,curl,gd,mbstring,xml,zip,intl} -y
Step 2 — Download Roundcube
cd /var/www
sudo wget https://github.com/roundcube/roundcubemail/releases/download/1.6.0/roundcubemail-1.6.0-complete.tar.gz
sudo tar -xzf roundcubemail-1.6.0-complete.tar.gz
sudo mv roundcubemail-1.6.0 roundcube
sudo chown -R www-data:www-data roundcube
Step 3 — Create Database
sudo mysql -u root -p
CREATE DATABASE roundcube CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL ON roundcube.* TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;
Step 4 — Configure Nginx
sudo nano /etc/nginx/sites-available/roundcube
server {
listen 443 ssl;
server_name webmail.yourdomain.com;
root /var/www/roundcube;
index index.php;
ssl_certificate /etc/letsencrypt/live/webmail.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/webmail.yourdomain.com/privkey.pem;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Security — block sensitive files
location ~* /(config|temp|logs)/ { deny all; }
location ~ /\. { deny all; }
}
Step 5 — Run Installer
https://webmail.yourdomain.com/installer
Complete the web installer — enter IMAP server, database credentials and SMTP settings.
Step 6 — Remove Installer
sudo rm -rf /var/www/roundcube/installer
Conclusion
Roundcube provides a professional webmail interface for any IMAP server. Our team installs and configures complete mail server stacks including webmail.
Comments