Introduction
VestaCP is a web hosting control panel that provides an easy-to-use interface for managing websites, domains, email accounts, databases, and other server services.
By default, accessing webmail may require navigating to the Roundcube URL directly. To make webmail easier for users to access, administrators can configure a webmail alias such as :
http://webmail.domainname.tld
This can be configured by adding an Apache VirtualHost entry that points the webmail subdomain to the Roundcube installation directory.
This article explains how to configure a webmail alias in VestaCP on Ubuntu 16.04 using Apache2.
Prerequisites
Before implementing this configuration, ensure that the following requirements are available:
- VestaCP installed and configured.
- Ubuntu 16.04 server.
- Apache2 web server.
- Root or sudo access.
- Roundcube Webmail installed on the server.
- A valid domain configured in VestaCP.
- DNS configured for the
webmailsubdomain.
In this example, Roundcube is located at:
/usr/share/roundcube
Implementation
Step 1: Edit the Apache Configuration
Open the Apache configuration file for the required VestaCP user:
vi /home/admin/conf/web/apache2.conf
Add the following VirtualHost configuration at the bottom of the file:
<VirtualHost xx.xx.xx.xx:8080>
ServerName webmail
ServerAlias webmail.*
DocumentRoot /usr/share/roundcube
<Directory /usr/share/roundcube>
AllowOverride All
</Directory>
</VirtualHost>
Replace:
xx.xx.xx.xx
with the appropriate server IP address.
The DocumentRoot points Apache to the Roundcube installation directory:
/usr/share/roundcube
The ServerAlias allows the webmail hostname to be used for domains hosted on the server.
Step 2: Verify Apache Configuration
Before restarting Apache, verify that the configuration syntax is valid:
apachectl -t
A successful configuration should return:
Syntax OK
If Apache reports an error, review the configuration file and correct the issue before restarting the service.
Step 3: Restart Apache
Restart Apache to apply the changes:
service apache2 restart
You can verify the Apache service status using:
service apache2 status
Step 4: Access Webmail
Once Apache has restarted successfully, open the following URL in a browser:
http://webmail.domainname.tld
Replace:
domainname.tld
with the actual domain name.
If the configuration and DNS records are correct, the Roundcube webmail interface should be displayed.
Architecture Diagram

Conclusion
Configuring a webmail alias provides users with a simple and convenient URL for accessing Roundcube Webmail.
By adding the appropriate Apache VirtualHost configuration, verifying the Apache syntax, and restarting Apache, users can access webmail using:
http://webmail.domainname.tld
This approach can simplify webmail access for domains managed through VestaCP.
Note: Ubuntu 16.04 is an end-of-life operating system release. For production environments, consider migrating to a currently supported Ubuntu release and use the corresponding Apache/VestaCP configuration for that environment.
FAQ
1. What is a webmail alias?
A webmail alias provides an easy-to-remember hostname that users can use to access the webmail application.
For example:
http://webmail.domainname.tld
2. Where is the VestaCP Apache configuration located?
For the configuration described in this article, the Apache configuration file is:
/home/admin/conf/web/apache2.conf
3. Where is Roundcube installed?
In this example, Roundcube is installed at:
/usr/share/roundcube
4. How can I verify the Apache configuration?
Run:
apachectl -t
A successful configuration should return:
Syntax OK
Related Articles
- Install SSL Certificate in VestaCP Panel
- VestaCP BIND: Loading Master File Failed – Permission Denied
Talk to our experts
Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team here.