Web hosting, VPS hosting and dedicated servers built for websites, apps and online businesses.
CybroHost Client Area
CybroHost
Browse by Topic All Blogs Business & Marketing Hosting & Servers Security & Performance Tutorials Website & WordPress Tips
CybroHost Blog

How to Set Up Dovecot IMAP and Secure Mailbox Access on an Ubuntu SMTP VPS

Learn how to install Dovecot IMAP on an Ubuntu SMTP VPS, connect Postfix Maildir delivery, configure TLS certificates, open port 993, and test secure mailbox access.

By December 1, 2026 3 min read SMTP Linux VPS
Dovecot IMAP on Ubuntu SMTP VPS showing encrypted Linux mail server, secure Maildir storage, and synchronized desktop and mobile inboxes.

Dovecot IMAP on Ubuntu VPS lets users read and synchronize mail across Outlook, phones, and other clients. Postfix handles email delivery, while Dovecot provides secure mailbox access. This guide uses Ubuntu 24.04 with Dovecot 2.3; newer Dovecot 2.4 releases use different configuration names.

Dovecot IMAP on Ubuntu VPS: Before You Start

Prepare a working Postfix server, a mail domain, sudo access, and a hostname such as mail.example.com. Point its DNS record to the VPS. Obtain a trusted TLS certificate for that hostname before enabling client access. Back up existing mailboxes and settings.

CybroHost SMTP VPS Hosting provides Linux root access and controls for self-managed mail infrastructure. However, an SMTP-only setup does not automatically include IMAP mailboxes.

Step 1: Install Dovecot IMAP

Update packages and install the IMAP service:

sudo apt update
sudo apt install dovecot-core dovecot-imapd -y
dovecot --version

For this guide, confirm the installed version is 2.3.x. Use the matching Dovecot 2.4 documentation on Ubuntu 26.04 rather than copying these settings unchanged.

Step 2: Match Your Mailbox Format

For a simple local-user setup, configure Postfix to deliver new mail into each user’s Maildir:

sudo postconf -e 'home_mailbox = Maildir/'
sudo postfix reload

In /etc/dovecot/conf.d/10-mail.conf, set:

mail_location = maildir:~/Maildir

Create a test mailbox using sudo adduser mailtest. Confirm your Postfix domain routing actually delivers to that local account. Changing to Maildir does not migrate existing mbox messages; plan that conversion separately.

Step 3: Require TLS for IMAP

In /etc/dovecot/conf.d/10-ssl.conf, configure the certificate paths for Dovecot 2.3:

ssl = required
ssl_cert = </etc/letsencrypt/live/mail.example.com/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.example.com/privkey.pem

Replace the example hostname and paths with your actual certificate. Keep private-key permissions restricted. The official Ubuntu Dovecot guide explains the configuration files and encrypted IMAP service.

Step 4: Open Only the Needed Mail Ports

If UFW is enabled, allow TCP 993 for implicit TLS; also check your provider firewall:

sudo ufw allow 993/tcp
sudo doveconf -n
sudo systemctl restart dovecot

Keep port 143 closed if unencrypted IMAP access is unnecessary. Do not confuse IMAP port 993 with authenticated SMTP submission on port 587.

Step 5: Test Mailbox Access and Security

From another system, verify the TLS certificate:

openssl s_client -connect mail.example.com:993 -servername mail.example.com -verify_return_error

Configure your mail client with the hostname, IMAP 993, SSL/TLS, and the correct mailbox credentials. Test login, new-message synchronization, and deletion. Review journalctl -u dovecot for failures. Add login-rate protection, updates, and encrypted backups.

FAQs

Does Dovecot send outgoing email?

No. Dovecot provides mailbox access. Postfix or another SMTP service handles sending and delivery.

Can I use Dovecot without port 143?

Yes. Clients can use encrypted IMAP on port 993 without opening 143.

Can I copy Dovecot 2.3 settings to Ubuntu 26.04?

No. Dovecot 2.4 renamed TLS, authentication, and mailbox settings. Follow version-specific instructions.

Final Recommendation

Use matching Postfix and Dovecot mailbox paths, require valid TLS, and test IMAP access before production. Protect accounts with monitoring, restricted permissions, and reliable backups.

Ethan Collins

CybroHost editorial team sharing hosting, VPS, security, and performance knowledge.