{"id":48334,"date":"2024-05-27T12:30:00","date_gmt":"2024-05-27T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=48334"},"modified":"2025-10-07T06:49:06","modified_gmt":"2025-10-07T11:49:06","slug":"email-server-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/","title":{"rendered":"How to Install and Configure an Email Server on Ubuntu 24.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\" alt=\"How to Install and Configure an Email Server on Ubuntu 24.04\" class=\"wp-image-48407\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we will demonstrate how to install and configure a mail server on Ubuntu 24.04, as large and medium-sized companies can greatly benefit from having a private email server. By utilizing a mail server, it becomes feasible to monitor all email traffic closely. Additionally, the flexibility to customize settings enables the establishment of a clear and organized email service. While there are various options available for setting up a Linux email server, we will specifically concentrate on Postfix and Dovecot.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f00cecd9a98\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f00cecd9a98\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Prerequisites-for-an-Email-Server-on-Ubuntu-2404\" >Prerequisites for an Email Server on Ubuntu 24.04<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-1-Set-Hostname\" >Step 1. Set Hostname<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-2-Install-Dependencies\" >Step 2. Install Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-3-Create-a-System-User\" >Step 3. Create a System User<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-4-Create-a-Database\" >Step 4. Create a Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-5-Install-Postfix\" >Step 5. Install Postfix<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-6-Install-Dovecot\" >Step 6. Install Dovecot<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-7-Install-PostfixAdmin\" >Step 7. Install PostfixAdmin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#Step-8-Install-Webmail\" >Step 8. Install Webmail<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#You-successfully-installed-an-Email-Server-on-Ubuntu-2404\" >You successfully installed an Email Server on Ubuntu 24.04<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-an-email-server-on-ubuntu-24-04\"><span class=\"ez-toc-section\" id=\"Prerequisites-for-an-Email-Server-on-Ubuntu-2404\"><\/span>Prerequisites for an Email Server on Ubuntu 24.04<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu 24.04 VPS<\/a><\/li>\n\n\n\n<li>SSH root access or a user with sudo privileges is required<\/li>\n<\/ul>\n\n\n\n<p>Conventions<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u2013 given commands should be executed with root privileges either directly as a root user or by use of sudo command<br>$ \u2013 given commands should be executed as a regular user<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-set-hostname\"><span class=\"ez-toc-section\" id=\"Step-1-Set-Hostname\"><\/span>Step 1. Set Hostname<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Hostname is a label used to identify a machine and will help you distinguish your servers from the others. You would need to create a DNS A record for your hostname because the server hostname should be an FQDN (Fully Qualified Domain Name). For example, we will use ubuntu.yourdomain.com as the server hostname in this tutorial. Subsequently, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo hostnamectl set-hostname ubuntu.yourdomain.com<\/pre>\n\n\n\n<p>Make sure to replace ubuntu.yourdomain.com with your own subdomain pointing to your server&#8217;s IP address<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-2-install-dependencies\"><span class=\"ez-toc-section\" id=\"Step-2-Install-Dependencies\"><\/span>Step 2. Install Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this step, we will install an <a href=\"https:\/\/www.rosehosting.com\/apache-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Apache web server<\/a>, <a href=\"https:\/\/www.rosehosting.com\/php-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">PHP<\/a> with its extensions, and <a href=\"https:\/\/www.rosehosting.com\/mariadb-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB<\/a> as the database server. Let&#8217;s execute this command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install apache2 git mariadb-server php-{xml,pear,imap,intl,common,json,curl,mbstring,mysql,gd,imagick,zip,opcache,sqlite3} libapache2-mod-php<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-3-create-a-system-user\"><span class=\"ez-toc-section\" id=\"Step-3-Create-a-System-User\"><\/span>Step 3. Create a System User<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this step, we will create a new system user to store the emails on the server. Let&#8217;s invoke the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo useradd -r -u 150 -g mail -d \/var\/vmail -s \/sbin\/nologin -c \"Virtual Mail User\" vmail<br>$ sudo mkdir -p \/var\/vmail<br>$ sudo chmod -R 770 \/var\/vmail<br>$ sudo chown -R vmail:mail \/var\/vmail<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-4-create-a-database\"><span class=\"ez-toc-section\" id=\"Step-4-Create-a-Database\"><\/span>Step 4. Create a Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Next, let&#8217;s create a database. By default, you can log in to MySQL shell without a password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo mysql<\/pre>\n\n\n\n<p>Once logged in, let&#8217;s run these commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MariaDB [(none)]&gt; CREATE DATABASE postfixadmin;<br>MariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON postfixadmin.* TO 'postfixadmin'@'localhost' IDENTIFIED BY 'M0d1fyth15';<br>MariaDB [(none)]&gt; FLUSH PRIVILEGES;<br>MariaDB [(none)]&gt; \\q<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-5-install-postfix\"><span class=\"ez-toc-section\" id=\"Step-5-Install-Postfix\"><\/span>Step 5. Install Postfix<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Install the Postfix mail server from the Ubuntu default repository with this command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install postfix-mysql<\/pre>\n\n\n\n<p>The mail server related data will be stored in a MySQL database. Once the package postfix-mysql installation is completed we need to create several configuration files for Postfix to communicate with the database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo mkdir -p \/etc\/postfix\/sql<\/pre>\n\n\n\n<p>Match the password, database name, and database user with those you created in the earlier step.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_alias_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT goto FROM alias WHERE address='%s' AND active = '1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_domains_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_mailbox_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_alias_domain_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_alias_domain_mailbox_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_mailbox_limit_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/sql\/mysql_virtual_alias_domain_catchall_maps.cf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">user = postfixadmin<br>password = M0d1fyth15<br>hosts = localhost<br>dbname = postfixadmin<br>query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'<\/pre>\n\n\n\n<p>Now, we can run the commands below to edit postfix&#8217;s main.cf file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo postconf -e \"myhostname = $(hostname -f)\"<br>$ sudo postconf -e \"mydestination = localhost\"<br>$ sudo postconf -e \"mynetworks = 127.0.0.0\/8\"<br>$ sudo postconf -e \"inet_protocols = ipv4\"<br>$ sudo postconf -e \"inet_interfaces = all\"<br>$ sudo postconf -e \"smtpd_tls_cert_file = \/etc\/ssl\/certs\/ssl-cert-snakeoil.pem\"<br>$ sudo postconf -e \"smtpd_tls_key_file = \/etc\/ssl\/private\/ssl-cert-snakeoil.key\"<br>$ sudo postconf -e \"smtpd_use_tls = yes\"<br>$ sudo postconf -e \"smtpd_tls_auth_only = yes\"<br>$ sudo postconf -e \"smtpd_sasl_type = dovecot\"<br>$ sudo postconf -e \"smtpd_sasl_path = private\/auth\"<br>$ sudo postconf -e \"smtpd_sasl_auth_enable = yes\"<br>$ sudo postconf -e \"smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination\"<br>$ sudo postconf -e \"virtual_transport = lmtp:unix:private\/dovecot-lmtp\"<br>$ sudo postconf -e \"virtual_mailbox_domains = proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_domains_maps.cf\"<br>$ sudo postconf -e \"virtual_alias_maps = proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_alias_maps.cf, proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_alias_domain_maps.cf, proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_alias_domain_catchall_maps.cf\"<br>$ sudo postconf -e \"virtual_mailbox_maps = proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_mailbox_maps.cf, proxy:mysql:\/etc\/postfix\/sql\/mysql_virtual_alias_domain_mailbox_maps.cf\"<\/pre>\n\n\n\n<p>Once completed, we can continue and edit \/etc\/postfix\/master.cf file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/postfix\/master.cf<\/pre>\n\n\n\n<p>Modify or add the following lines to the file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">smtp      inet  n       -       y       -       -       smtpd<br>#smtp      inet  n       -       y       -       1       postscreen<br>#smtpd     pass  -       -       y       -       -       smtpd<br>#dnsblog   unix  -       -       y       -       0       dnsblog<br>#tlsproxy  unix  -       -       y       -       0       tlsproxy<br># Choose one: enable submission for loopback clients only, or for any client.<br>#127.0.0.1:submission inet n -   y       -       -       smtpd<br>submission inet n       -       y       -       -       smtpd<br>  -o syslog_name=postfix\/submission<br>  -o smtpd_tls_security_level=encrypt<br>  -o smtpd_sasl_auth_enable=yes<br>#  -o smtpd_tls_auth_only=yes<br>#  -o local_header_rewrite_clients=static:all<br>#  -o smtpd_reject_unlisted_recipient=no<br>#     Instead of specifying complex smtpd_&lt;xxx&gt;_restrictions here,<br>#     specify \"smtpd_&lt;xxx&gt;_restrictions=$mua_&lt;xxx&gt;_restrictions\"<br>#     here, and specify mua_&lt;xxx&gt;_restrictions in main.cf (where<br>#     \"&lt;xxx&gt;\" is \"client\", \"helo\", \"sender\", \"relay\", or \"recipient\").<br>#  -o smtpd_client_restrictions=<br>#  -o smtpd_helo_restrictions=<br>#  -o smtpd_sender_restrictions=<br>#  -o smtpd_relay_restrictions=<br>#  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject<br>  -o smtpd_client_restrictions=permit_sasl_authenticated,reject<br>  -o milter_macro_daemon_name=ORIGINATING<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-6-install-dovecot\"><span class=\"ez-toc-section\" id=\"Step-6-Install-Dovecot\"><\/span>Step 6. Install Dovecot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Run this command to install Dovecot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install dovecot-mysql dovecot-imapd dovecot-pop3d dovecot-lmtpd<\/pre>\n\n\n\n<p>Once Dovecot is installed, we can proceed with the following steps and edit some configuration files.<\/p>\n\n\n\n<p>Open the \/etc\/dovecot\/conf.d\/10-auth.conf file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/dovecot\/conf.d\/10-auth.conf<\/pre>\n\n\n\n<p>Then, find this line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">auth_mechanisms = plain<\/pre>\n\n\n\n<p>and replace the line with this one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">auth_mechanisms = plain login<\/pre>\n\n\n\n<p>Then, we need to comment !include auth-system.conf.ext and uncomment the line !include auth-sql.conf.ext<\/p>\n\n\n\n<p>It should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!include auth-system.conf.ext<br>!include auth-sql.conf.ext<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Still in the 10-auth.conf file, we include auth-sql.conf.ext. So, let&#8217;s edit the file so it gets executed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/dovecot\/dovecot-sql.conf.ext<\/pre>\n\n\n\n<p>Insert the following lines into the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">driver = mysql<br>connect = host=localhost dbname=postfixadmin user=postfixadmin password=M0d1fyth15<br>default_pass_scheme = BLF-CRYPT<br>password_query = SELECT username as user, password, '\/var\/vmail\/%d\/%n' as userdb_home, 'maildir:\/var\/vmail\/%d\/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'<br>user_query = SELECT '\/var\/vmail\/%d\/%u' as home, 'maildir:\/var\/vmail\/%d\/%u' as mail, 150 AS uid, 8 AS gid, concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1'<\/pre>\n\n\n\n<p>The lines above contain the database credentials. Make sure they match the ones you created in the previous step. Save the file and exit<\/p>\n\n\n\n<p>Next, open the \/etc\/dovecot\/conf.d\/10-mail.conf file and change the following values:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/dovecot\/conf.d\/10-mail.conf<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">mail_location = maildir:\/var\/vmail\/%d\/%n<br>mail_uid = vmail<br>mail_gid = mail<br>mail_privileged_group = mail<br>first_valid_uid = 150<br>last_valid_uid = 150<\/pre>\n\n\n\n<p>Save the file, then exit. Now, let&#8217;s proceed with editing other dovecot configuration files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/dovecot\/conf.d\/10-master.conf<\/pre>\n\n\n\n<p>There are several changes you need to make in this file.<\/p>\n\n\n\n<p>Find the service lmtp section and change it to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service lmtp {<br>    unix_listener \/var\/spool\/postfix\/private\/dovecot-lmtp {<br>    mode = 0600<br>    user = postfix<br>    group = postfix<br>    }<br>}<\/pre>\n\n\n\n<p>Find the service auth section and change it to:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service auth {<br>unix_listener \/var\/spool\/postfix\/private\/auth {<br>mode = 0666<br>user = postfix<br>group = postfix<br>}<br><br>unix_listener auth-userdb {<br>mode = 0600<br>user = vmail<br><br>}<br>user = dovecot<br>}<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Change the service auth-worker section to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service auth-worker {<br>user = vmail<br>}<\/pre>\n\n\n\n<p>Do not forget to save the file and then exit. And now, it is time to correct the permissions.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo chown -R vmail:dovecot \/etc\/dovecot<br>$ sudo chmod -R o-rwx \/etc\/dovecot<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-7-install-postfixadmin\"><span class=\"ez-toc-section\" id=\"Step-7-Install-PostfixAdmin\"><\/span>Step 7. Install PostfixAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this step, we will download PostfixAdmin from Github and store it in the \/opt directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo cd \/opt<br>$ sudo git clone https:\/\/github.com\/postfixadmin\/postfixadmin.git<br>$ sudo cd \/opt\/postfixadmin<br>$ sudo bash install.sh<\/pre>\n\n\n\n<p>Let&#8217;s correct the permission.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo chown -R www-data: \/opt\/postfixadmin<\/pre>\n\n\n\n<p>Add \/etc\/apache2\/conf-enabled\/postfixadmin.conf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/apache2\/conf-enabled\/postfixadmin.conf<\/pre>\n\n\n\n<p>Insert these lines into that file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Alias \/postfixadmin \/opt\/postfixadmin\/public<br><br>&lt;Directory \"\/opt\/postfixadmin\/public\"&gt;<br>        AllowOverride All<br>        Options +FollowSymLinks<br>        Require all granted<br>&lt;\/Directory&gt;<\/pre>\n\n\n\n<p>Then, we need to reload Apache.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo systemctl reload apache2<\/pre>\n\n\n\n<p>Next, let&#8217;s create config.local.php <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/opt\/postfixadmin\/config.local.php<\/pre>\n\n\n\n<p>and insert the following lines<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>$CONF['database_type'] = 'mysqli';<br>$CONF['database_host'] = 'localhost';<br>$CONF['database_user'] = 'postfixadmin';<br>$CONF['database_password'] = 'M0d1fyth15';<br>$CONF['database_name'] = 'postfixadmin';<br>$CONF['configured'] = true;<br><br>?&gt;<\/pre>\n\n\n\n<p>Save the file, then exit from the editor.<\/p>\n\n\n\n<p>Go to http:\/\/YOUR_IP_ADDRESS\/postfixadmin\/setup.php and create a setup password. If you already have a website on your server, you can also access postfixadmin at http:\/\/yourdomain.com\/postfixadmin\/setup.php<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-1024x467.jpg\" alt=\"Email Server on Ubuntu 24.04 postfixadmin generate setup password\" class=\"wp-image-48339\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-1024x467.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-300x137.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-150x68.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-768x351.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup-1320x603.jpg 1320w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-setup.jpg 1356w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Type your setup password twice and click on Generate setup_password hash button.<\/p>\n\n\n\n<p>You will see a line containing a setup password, and you need to copy it to config.local.php, something like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$CONF['setup_password'] = '$2y$10$YpUXiIQAP47pudUDz0n3leljN2ap5xBq\/O1ntFmgAtU0WArEXy84y';<\/pre>\n\n\n\n<p>After adding the line to config.local.php file, you can refresh the page to log in and create a superadmin.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"988\" height=\"669\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-configure.jpg\" alt=\"Email Server on Ubuntu 24.04 postfixadmin hosting environment check\" class=\"wp-image-48340\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-configure.jpg 988w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-configure-300x203.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-configure-150x102.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-configure-768x520.jpg 768w\" sizes=\"(max-width: 988px) 100vw, 988px\" \/><\/figure>\n\n\n\n<p>Scroll down to create a superadmin account. The setup password you created earlier is required to create a superadmin. In the admin field, it should be filled with an email address, it should look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin-1024x306.jpg\" alt=\"Email Server on Ubuntu 24.04 postfixadmin add superadmin\" class=\"wp-image-48341\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin-1024x306.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin-300x90.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin-150x45.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin-768x230.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfisadmin-add-superadmin.jpg 1040w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Screenshot<\/figcaption><\/figure>\n\n\n\n<p>Now that a superadmin has been created, you can use the credentials to log in to http:\/\/192.168.53.5\/postfixadmin\/login.php and add domains, email address, etc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login-1024x555.jpg\" alt=\"Email Server on Ubuntu 24.04 postfixadmin login\" class=\"wp-image-48342\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login-1024x555.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login-300x163.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login-150x81.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login-768x417.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/04\/postfixadmin-login.jpg 1248w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-8-install-webmail\"><span class=\"ez-toc-section\" id=\"Step-8-Install-Webmail\"><\/span>Step 8. Install Webmail<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>At this point, your server can send emails. To receive emails, make sure your domain&#8217;s DNS MX record points to this server. You can use your favorite email client to send emails or use a webmail instead. Let&#8217;s install Roundcube now.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install roundcube<\/pre>\n\n\n\n<p>Next, let&#8217;s edit rouncube configuration file at \/etc\/apache2\/conf-enabled\/roundcube.conf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/apache2\/conf-enabled\/roundcube.conf<\/pre>\n\n\n\n<p>Uncomment this line<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Alias \/roundcube \/var\/lib\/roundcube\/public_html<\/pre>\n\n\n\n<p>And it should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Alias \/roundcube \/var\/lib\/roundcube\/public_html<\/code><\/pre>\n\n\n\n<p>Save the file, exit then restart apache<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo systemctl restart apache2<\/pre>\n\n\n\n<p>The next step is to edit another Rouncube config file, this one at \/etc\/roundcube\/config.inc.php<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/roundcube\/config.inc.php<\/pre>\n\n\n\n<p>Find this string:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$config['smtp_host'] = 'localhost:587';<\/pre>\n\n\n\n<p>and replace it with this one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$config['smtp_host'] = 'tls:\/\/%n:587';<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-you-successfully-installed-an-email-server-on-ubuntu-24-04\"><span class=\"ez-toc-section\" id=\"You-successfully-installed-an-Email-Server-on-Ubuntu-2404\"><\/span>You successfully installed an Email Server on Ubuntu 24.04<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can now navigate to your http:\/\/YOUR_SERVER_IP_ADDRESS\/roundcube and log in using the credentials you created in the previous step. Once logged in, you can try to send an email.<\/p>\n\n\n\n<p>Of course, you don\u2019t have to install and configure an email server on Ubuntu 24.04 server if you have a server with us, in which case you can simply ask our expert Linux hosting admins to set all of this up for you, quickly and easily. They are available 24\u00d77 and will respond to your request immediately. Our admins will also help you with more complex mail server installation, like using OpenDKIM, SPF, and DMARC.<\/p>\n\n\n\n<p>PS. If you liked this post, please share it with your friends on social networks or simply leave a comment down in the comments section. Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we will demonstrate how to install and configure a mail server on Ubuntu 24.04, as large and &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Install and Configure an Email Server on Ubuntu 24.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#more-48334\" aria-label=\"Read more about How to Install and Configure an Email Server on Ubuntu 24.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":48407,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1706,1698],"tags":[1603,2144,177,59,2143],"class_list":["post-48334","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email-servers","category-ubuntu","tag-how-to-install","tag-install-email-server","tag-linux-vps","tag-ubuntu","tag-ubuntu24-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting<\/title>\n<meta name=\"description\" content=\"Learn how to install and configure an email server on the latest Ubuntu 24.04 server with our easy to follow step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install and Configure an Email Server on Ubuntu 24.04\" \/>\n<meta property=\"og:description\" content=\"How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-27T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-07T11:49:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Install and Configure an Email Server on Ubuntu 24.04\",\"datePublished\":\"2024-05-27T17:30:00+00:00\",\"dateModified\":\"2025-10-07T11:49:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/\"},\"wordCount\":1051,\"commentCount\":39,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\",\"keywords\":[\"how to install\",\"install email server\",\"linux vps\",\"ubuntu\",\"ubuntu24.04\"],\"articleSection\":[\"Email Servers\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/\",\"name\":\"How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\",\"datePublished\":\"2024-05-27T17:30:00+00:00\",\"dateModified\":\"2025-10-07T11:49:06+00:00\",\"description\":\"Learn how to install and configure an email server on the latest Ubuntu 24.04 server with our easy to follow step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp\",\"width\":1024,\"height\":576,\"caption\":\"How to Install and Configure an Email Server on Ubuntu 24.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/email-server-on-ubuntu-24-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install and Configure an Email Server on Ubuntu 24.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting","description":"Learn how to install and configure an email server on the latest Ubuntu 24.04 server with our easy to follow step-by-step guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install and Configure an Email Server on Ubuntu 24.04","og_description":"How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2024-05-27T17:30:00+00:00","article_modified_time":"2025-10-07T11:49:06+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Install and Configure an Email Server on Ubuntu 24.04","datePublished":"2024-05-27T17:30:00+00:00","dateModified":"2025-10-07T11:49:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/"},"wordCount":1051,"commentCount":39,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp","keywords":["how to install","install email server","linux vps","ubuntu","ubuntu24.04"],"articleSection":["Email Servers","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/","url":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/","name":"How to Install and Configure an Email Server on Ubuntu 24.04 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp","datePublished":"2024-05-27T17:30:00+00:00","dateModified":"2025-10-07T11:49:06+00:00","description":"Learn how to install and configure an email server on the latest Ubuntu 24.04 server with our easy to follow step-by-step guide.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/05\/how-to-install-and-configure-an-email-server-on-ubuntu-24-04.webp","width":1024,"height":576,"caption":"How to Install and Configure an Email Server on Ubuntu 24.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/email-server-on-ubuntu-24-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install and Configure an Email Server on Ubuntu 24.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=48334"}],"version-history":[{"count":15,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48334\/revisions"}],"predecessor-version":[{"id":51173,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48334\/revisions\/51173"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/48407"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=48334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=48334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=48334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}