[TUTORIAL] Install Roundcube on Cyberpanel (with multiple domains and TLS)

Hello dear community,

first of all, a big thanks to @usmannasir and his team for their time spent, in order to provide for all of us the awesome CP.

I would like to share some instructions on installing Roundcube on Cyberpanel, because I spent a few weeks trying to complete the istallation and get everything working. I am guessing others will benefit from this also, and maybe the community have some interesting feedback to share. So, let’s begin:

Note: Use at your own risk, in terms of security, functionality and any other potential disadvantage.

Introduction: The instructions will be simple and plain, no screenshots, links or detailed instructions. I trust that most of the readers are experienced users and can somehow figure their way through the worklow.

  1. Download latest Roundcube from the official roundcube website
  2. Create a subdomain for your main domain used in this server. For example let’s say you have a VPS server, with primary domain “mycompany”. Create a subdomain named “webmail.mycompany”.
  3. Install Roundcube in this subdomain. Create a database through Cyberpanel and follow the instructions included in Roundcube ReadMe files or around the web. (Be sure to delete installation folder after the installation)
  4. In Rouncube config file, be sure to set smtp_host to your main domain, on port 587, and set your ca_files to those of your server
  5. Create your preferred email accounts for your test domains. E.g. info@mycompany and shop@mycompany from within Cyberpanel
  6. Login to your server using SSH (e.g. with Putty or WinSCP). Locate postfix/main.cf file. Change the lines “smtpd_tls_cert_file” and “smtpd_tls_key_file”. Insert the locations of the Let’s Encrypt cert and key for your main domain, located in /letsencrypt/live/…
  7. (Optional) Check /postfix/vmail_ssl.map. Verify each directory in on one line. If not, break the lines and recompile the vmail_ssl.map.db
  8. When you need emails for a new client website, then create a subdomain “webmail” again under the new website, e.g. “webmail.clientwebsite”. Create the email account through the Cyberpanel, as the other email accounts before.
  9. Go to OpenLiteSpeed WebAdmin and change the Document Root of the subdomain “webmail.clientwebsite” to point to the root of the first subdomain where the Roundcube is installed “webmail.mycompany”
  10. Same for any other domains

After that, check your sending and receiving. If everystep was followed properly, it should work. Feel free to provide any feedback.

PS: I know SNI is supported and that this method sends all the forwarding emails from the main domain, but if I am not wrong (by making a small research) this is not a totally wrong method, in fact it is used a lot.

Thank you for your time everyone! I hope I’ve helped someway, and I will be happy to assist with any other info. Happy coding!


Great short tutorial but for technical persons only as non tech need screenshots and all

If you have a youtube channel and there’s time, I’d suggest you make a vid tutorial of this, Trust me you’ll get a lot of views, I got lost at number 6 and 7, Kindly help a newbie like with a screenshot, Thanks

1 Like

Maybe better to keep it for technical persons if installation creates issues. If person who need youtube and images to install, would be in problems when something goes wrong.

Hello @Kobbe,

thanks a lot for the great feedback and the suggestion. I will sure keep this in mind.

Until then, I will try to edit the post and add some screenshots there in order to help a little bit more. Nonetheless, if you have any specific question about the points that you lost, dont hesitate to bring them up here.

Best regards!

1 Like

I’ve been able to install but i’m having this challenge now:

when i change client webmail **Document Root *** to /home/mycompany.com/webmail.mycompany.com and access the client webmail.client.com the page turns blank but the roundcube favicon loads could be bad records setting from cloudflare because i use cloudflare?

Could you elaborate around the
6th point about changing the file and where is the letsencrypt live folder?
7th point, why put lines there?

Can you use existing emails within cyberpanel instead of creating a new?

Hello @Master3395, sorry for late response,

6th point:
you would want to change the line as following:
smtpd_tls_cert_file = /xxxxxxx/xxx/xxxxx/xxx.cert (default value)
smtpd_tls_key_file = xxxxxxx/xxx/xxxxx/xxx.key (default value)
smtpd_tls_cert_file = /etc/letsencrypt/live/home/mydomain/mydomain.cert (example Centos 7 location)
smtpd_tls_key_file = /etc/letsencrypt/live/home/mydomain/mydomain.key (example Centos 7 location)

7th point:
The file “vmail_ssl.map” is on the same location as above (/etc/postfix/vmail_ssl.map). It includes the certification and key files for each domain, but ONE each line. It has come to my attention that sometimes, the lines get combined together, so you have to seperately them manually by just pressing Enter (new line), and then recompile the file (because after changes, this file needs to be recompiled by running the command “postmap -F hash:/etc/postfix/vmail_ssl.map”). It is explained beautifully by @Hifihedgehog in (How Do I Configure Multiple Domains and SSLs With Postfix? - #6 by Hifihedgehog).

Hope that helps!

Best regards

Do you know if there is a way to support both internal SnappyMail and Roundcube at the same time?

Yes well, by installing Roundcube you don’t uninstall SnappyMail so you can use both.

1 Like

The List-Undubscribe Header, that Snappymail does not have, can RoundCube have it?