How to install webmail with Roundcube
Updated 7/20/2026
Roundcube gives you a web interface for email, so you do not depend on a desktop client. It connects to your mail server over IMAP.
Requirements
A web stack with PHP (see LEMP stack), a database and a working mail server (IMAP).
1. Install Roundcube
apt-get update -y
apt-get install -y roundcube roundcube-mysql
2. Configure the IMAP connection
In /etc/roundcube/config.inc.php:
$config['imap_host'] = 'ssl://mail.example.com:993';
$config['smtp_host'] = 'tls://mail.example.com:587';
3. Serve it through Nginx
Add a server block for webmail.example.com pointing to the Roundcube directory, see hosting multiple sites.
4. Secure it
- Serve only over HTTPS, see free SSL certificate.
- Add security headers, see security headers.
Note: if you use Mailcow, it already includes webmail, so you do not need a separate install.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to filter spam with Rspamd
Rspamd is a modern, fast spam filter. Here is how to use it to keep your inbox clean.
Updated 7/20/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 7/20/2026EmailHow to use an SMTP relay for reliable delivery
An SMTP relay sends your emails through a service with good reputation, ideal for apps without their own mail server.
Updated 7/20/2026