How to Set Up a Mailbox on Your VPS

🔹 Why You Need Email on Your Own Server

A mail service on a VPS allows you to use professional email addresses such as info@yourdomain.com, send system notifications, or deliver emails directly from your website without third-party services.
You can configure it through a control panel (ISPmanager, cPanel, Plesk) or manually in Linux.

🧭 Option 1. Using a Control Panel

✅ If your server runs ISPmanager, cPanel, or Plesk, follow these steps:

  1. Log in to the control panel.
  2. Go to Mail → Mailboxes.
  3. Click Create mailbox.
  4. Fill in the following fields:
    • Domain name — your domain (e.g., yourdomain.com)
    • Mailbox name — for example, info
    • Password — set a strong password
  5. Click Save.

Your mailbox is now created. You can connect it to an email client (Thunderbird, Outlook) or access it via webmail (Roundcube, RainLoop).

🧠 Option 2. Manual Setup in Linux

  1. Install the Mail Server
    A common combination for Linux is Postfix + Dovecot:
apt install postfix dovecot-imapd dovecot-pop3d -y

During installation:

  • Choose Internet Site as the configuration type.
  • Enter your domain (e.g., yourdomain.com).
  1. Create a Mail User
adduser mailuser
passwd mailuser
  1. Configure Postfix
    Edit the file /etc/postfix/main.cf:
myhostname = mail.yourdomain.com
mydestination = $myhostname, localhost.$mydomain, localhost, yourdomain.com

Save the changes and restart the services:

systemctl restart postfix dovecot

🔧 DNS Settings for Proper Mail Delivery

TypeExamplePurpose
MXmail.yourdomain.comPrimary mail server
Amail.yourdomain.com → IP VPSServer IP address
SPFv=spf1 mx ~allProtects against sender spoofing
DKIM(generated by the mail server)Adds signature to outgoing mail
DMARCv=DMARC1; p=none; rua=mailto:dmarc@yourdomain.comCollects email delivery reports

⚠️ Without proper SPF, DKIM, and DMARC setup, your messages may end up in the spam folder.

📬 Testing Your Mail Server

After creating the mailbox, open your webmail client (for example, Roundcube — usually available at https://mail.yourdomain.com/roundcube).
Log in with your new credentials, send a test email to an external address (e.g., Gmail), and verify that the message is delivered successfully.

🧩 Recommendations

  • Use an SSL certificate for encrypted connections (SMTP ports 465/587, IMAP port 993).
  • Avoid sending mail from the same IP that hosts websites or scripts prone to spam.
  • Regularly scan your server for viruses.
  • For large-scale email needs, consider professional platforms such as Google Workspace or Zoho Mail.
Leave a Reply 0

Your email address will not be published. Required fields are marked *