Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Ubuntu 24.04 LTS
SSL/TLS
Postfix & Dovecot

Mail Server Installation on VPS (2026 Production Guide)

Set up your own corporate mail server from scratch. Step-by-step technical documentation for a highly reputable and fully controlled email infrastructure that does not get stuck in spam filters.

root@mail-server:~
root@eka:~$ telnet mail.ekaserver.com 25
Trying 192.168.1.100...
Connected to mail.ekaservucu.com.
Escape character is '^]'.
220 mail.ekasunucu.com ESMTP Postfix (Ubuntu)
EHLO localhost
250-mail.ekasunucu.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

1 Preparation and Requirements

Hosting your own mail server provides data privacy and complete control, but requires the right hardware and network infrastructure. Minimum recommended for a mail server of 2026 standards VPS Features include:

  • CPU: Minimum 1 Core (2 Core recommended)
  • RAM: Minimum 2 GB (4 GB+ for ClamAV)
  • Disc: 40 GB+ NVMe SSD
  • OS: Ubuntu 22.04 or 24.04 LTS
Critical Warning:

The company from which you rented the server 25. Port (SMTP) Make sure it allows output. Many providers close this port by default to prevent spam.

Hostname Setting

The first step in mail server setup is to set the server name (FQDN) correctly.

# Setting hostname (Ex: mail.ekaservucu.com)
sudo hostnamectl set-hostname mail.ekaserver.com

# Editing the hosts file
sudo nano /etc/hosts

# Add the following line:
127.0.0.1 localhost
SERVER_IP_ADDRESS mail.ekaservucu.com mail

2 DNS Records (Critical for Deliverability)

DNS records are vital for e-mails to go to services such as Gmail and Outlook without falling into the "Spam" folder. domain name Add the following records from your panel.

Record Type Ad (Host) Value Description
A email SERVER_IP Mail server IP address
MX @ mail.ekaservucu.com (Priority: 10) Mail server address
TXT (SPF) @ v=spf1 ip4:SERVER_IP -all Proxy server IP
TXT (DMARC) _dmarc v=DMARC1; p=none; rua=mailto:[email protected] Policy management
PTR (Reverse DNS) Record:

This registration is not done through the hosting panel, but from the IP address management section of the panel of the company you bought the server from (Eka Sunucu). Your IP address must resolve to "mail.domain.com".

3 Postfix (SMTP) Installation and Configuration

Postfix handles sending and receiving mail (MTA). During installation, select the "Internet Site" option.

# System update and Postfix installation
sudo apt update -y
sudo apt install postfix mailutils -y

# Editing the main configuration file
sudo nano /etc/postfix/main.cf

main.cf Edit the file according to modern standards as follows:

# /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no

# TLS parameters (will be updated after SSL installation)
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = mail.ekaserver.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox =Maildir/

4 Dovecot (IMAP/POP3) Setup

Dovecot is required for users to read their emails from Outlook or their phones.

sudo apt install dovecot-core dovecot-imapd dovecot-pop3d -y

Edit Dovecot configuration files:

# 1. Mail location setting
sudo nano /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir

# 2. Authentication setting
sudo nano /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = yes
auth_mechanisms = plain login

5 SSL (Let's Encrypt) and Security

For encryption of e-mail traffic SSL certificate It is mandatory. You can get it for free with Certbot.

sudo apt install certbot -y
# 80. make sure the port is free
sudo certbot certonly --standalone -d mail.ekaserver.com

Once the certificate is received, introduce it to Postfix and Dovecot:

# Postfix main.cf update
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.ekasunucu.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.ekasunucu.com/privkey.pem

# Dovecot 10-ssl.conf update
ssl = required
ssl_cert = </etc/letsencrypt/live/mail.ekasunucu.com/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.ekasunucu.com/privkey.pem

6 OpenDKIM Setup and DNS Integration

Digitally signing emails is mandatory in 2026 for providers such as Google and Yahoo.

sudo apt install opendkim opendkim-tools -y
sudo mkdir -p /etc/opendkim/keys/ekasunucu.com
sudo opendkim-genkey -s email -d ekasunucu.com
sudo chown opendkim:opendkim mail.private

# View Public Key (to be added to DNS)
cat /etc/opendkim/keys/ekasunucu.com/mail.txt
DNS TXT Record:

Send the output of the above command to your DNS panel. mail._domainkey Add it as a TXT record with the name .

VPS for Mail Server

NVMe SSD virtual servers with clean IP guarantee, optimized for the mail server.

Eka VDS 1
149₺/Ay
Home
  • 2 vCPU Core
  • 4 GB DDR4 RAM
  • 40 GB NVMe SSD
  • 1 Gbit Line
Review
Eka VDS 2
249₺/Ay
Recommended
  • 4 vCPU Core
  • 8 GB DDR4 RAM
  • 80 GB NVMe SSD
  • Clean IP Guarantee
Buy
Installation Support

When you purchase a VPS, basic mail server installation can be done free of charge by our technical team.

Get Support

Frequently Asked Questions

As long as the correct configuration (SPF, DKIM, DMARC, PTR) is made and the IP address is not on the blacklist, the inbox rate will be high. Eka Sunucu offers VPS service with clean IP guarantee.

It is technically possible on your own VPS, but suddenly sending thousands of emails with a cold IP (new IP) will reduce your reputation. IP warmup should be performed.

Yes, if you don't want to deal with the command line cPanelYou can also manage your mail server through control panels such as Plesk or CyberPanel.

Set Up Your Mail Server Now

Uninterrupted communication with Eka Sunucu's high-performance VPS infrastructure.

Check out VPS Packages
Top