Post Date: February 22, 2019
Last Updated: October 08, 2026
Introduction
When users log in to Roundcube Webmail, the login page may display a Server field that requires them to enter or select the mail server.
If your Roundcube installation uses a single mail server, displaying this field may be unnecessary and can make the login process less convenient for users.
In this guide, we will explain how to configure Roundcube so that the server field is no longer required and the default mail server is automatically set to localhost.
Prerequisites
Before making this configuration change, make sure you have the following:
Roundcube Installed
Roundcube Webmail should already be installed and configured on your mail server.
Server Access
You need SSH access with sufficient privileges to modify the Roundcube configuration file.
Roundcube Configuration File
Depending on your installation, the Roundcube configuration file is commonly located at:
/etc/roundcube/config.inc.php
The exact location may vary depending on the operating system and installation method.
Implementation
Step 1: Open the Roundcube Configuration File
Open the Roundcube configuration file using your preferred text editor:
sudo nano /etc/roundcube/config.inc.php
Step 2: Set the Default Mail Server
Add or update the following configuration:
$config['default_host'] = 'localhost';
This tells Roundcube to use localhost as the default IMAP server.
Step 3: Save the Configuration
Save the configuration file and exit the editor.
For nano, you can use:
Ctrl + O Enter Ctrl + X
Step 4: Verify the Roundcube Login Page
Open the Roundcube Webmail login page in your browser and verify that the server field is no longer presented as a field that users need to enter manually.
Users should now be able to log in without entering localhost themselves.
Conclusion
Configuring the default_host setting in Roundcube allows you to define the default IMAP server and simplify the webmail login experience.
For installations where all users connect to the same mail server, setting the default host to localhost can eliminate the need for users to manually enter the server information during login.
Frequently Asked Questions
What does $config['default_host'] do in Roundcube?
The default_host configuration specifies the default IMAP server that Roundcube uses for user authentication and mailbox access.
Why does Roundcube show a Server field on the login page?
The Server field may be displayed when Roundcube is configured to allow users to specify different IMAP servers or when no fixed default host has been configured.
Can I use a hostname instead of localhost?
Yes. You can specify the appropriate IMAP server hostname instead of localhost, for example:
$config['default_host'] = 'mail.example.com';
Use the hostname that matches your mail server configuration.
Where is the Roundcube configuration file located?
A common location is:
/etc/roundcube/config.inc.php
However, the location can vary depending on how Roundcube was installed and packaged.
Do I need to restart Roundcube after changing this setting?
Normally, changing the Roundcube PHP configuration does not require restarting Roundcube itself. However, if your environment uses PHP-FPM or another caching mechanism, you may need to clear or reload the relevant service depending on the configuration.
Related Articles
- How to Find the Roundcube Version Provided by cPanel and Upgrade Roundcube
- HOW TO EXPORT/IMPORT EMAILS IN CPANEL WEBMAIL
Need Help with Roundcube Configuration?
Need help configuring Roundcube Webmail or your mail server environment? Our team can assist with Roundcube installation, configuration, IMAP and SMTP setup, authentication, email security, troubleshooting, and ongoing mail server administration. Get in touch with our team here.