Would you like to use your own email addresses for your domain, such as info@yourdomain.com? Your web hosting is a VPS with One-Click Apps; a mail server is not included automatically. You can set one up yourself in just a few minutes with the ZAP Webspace + Mail app. It includes webspace (PHP, MariaDB, SFTP), the Stalwart mail server, and Roundcube webmail in a single app.
In this guide, you'll install the app, create mailboxes, add the DNS records for your domain, and enable sending to external recipients.
- A VPS with One-Click Apps set up (Debian or Ubuntu). For instructions on setting up One-Click Apps, see the article VPS: One-Click Apps.
- At least 2 GB of RAM for the app.
- Your own domain whose DNS records you can edit, such as a domain from ZAP-Hosting.
Only one mail app can run on a VPS because the mail server uses fixed ports (25, 465, 587, 993, and 8443). You can add additional mail domains in the same app.
Open your VPS in the ZapX dashboard and go to the One-Click Apps tab. Search for “ZAP Webspace” in the App catalog, then click Install next to ZAP Webspace + Mail.
In the installation dialog, choose the domain where the app will be accessible:
- Under Domain selection, choose your own domain and enter a prefix, such as
www. If your domain is with ZAP-Hosting, ZapX will create the A record for you. If it's with another provider, select Custom domain (DNS hosted elsewhere) and add the displayed A record there. - Open App configuration and enter the domain for your email addresses in
MAIL_DOMAIN, such asyourdomain.com. If you leave this field blank, the app will use its own domain, such aswww.yourdomain.com.
Click Queue installation. After about two to three minutes, the app will show as Online. The app card includes links to Website, Webmail, Mail Administration, phpMyAdmin, and DNS records, as well as the ports for your email clients.
Mail Administration is the Stalwart interface. You can access it using the Mail Administration link on the app card (port 8443 of the app domain).
- Click the gear icon (Settings) on the app card and go to the App environment tab.
- Under Automatically generated values, find
SERVICE_PASSWORD_ADMIN. Click the eye icon to reveal the password, or the icon next to it to copy it. - Sign in to Mail Administration with the username
adminand this password.
Mail Administration is in English, so the labels in this guide match the English interface.
- In Mail Administration, go to Directory → Accounts and click Create user.
- Under Username, enter the part before the @ sign, such as
info, and select your mail domain under Domain. - Under Credentials, click Add item and set a strong password.
- Add other addresses for the same mailbox, such as
contact@yourdomain.com, under Email Aliases. - Click Create to save.
The new mailbox will then appear in the list. The website@ entry is a technical mailbox used by your website to send email via PHP mail(). Do not delete it.
Your domain needs several DNS records so that emails reach your mail server and don't end up in spam. The app generates these records for you: click DNS records on the app card.
Copy these records exactly into your domain's DNS settings. For a domain from ZAP-Hosting, you can do this in the domain dashboard, as described in Domain: Domain Record Settings.
| Record | Type | Purpose |
|---|---|---|
| MX | MX | Tells other mail servers where to deliver emails for your domain. Required. |
SPF (v=spf1 …) | TXT | Specifies which server is allowed to send email for your domain. Required. |
DKIM (…._domainkey) | TXT | Public key used to sign your emails. Required. |
DMARC (_dmarc) | TXT | Tells recipients what to do with emails that don't have valid SPF/DKIM. Recommended. |
| SRV and TLS-RPT | SRV / TXT | Help email clients with setup and provide reports. Optional. |
Always copy the values from the DNS records page of your own app. The DKIM key, in particular, is different for every installation. It can take anywhere from a few minutes to several hours for new DNS records to propagate everywhere.
Many mail servers check whether the sender's IP address points to a matching hostname. Set the reverse DNS (PTR) for your VPS IP to the app's domain:
- Open your VPS and go to Settings.
- Under Reverse DNS, enter the app's domain in the Hostname field for the primary IP address, such as
www.yourdomain.com. - Click Save.
To prevent spam, outgoing connections on mail ports 25 and 465 are blocked on new VPSs. You'll see the notice Email sending blocked on your VPS. Emails to external recipients will remain in the queue until you verify a phone number on your account.
Click Verify phone number in the notice, or go to My account → Settings → Profile and verify your phone number there. ZapX will then automatically enable email sending for all your VPSs.
You can receive emails and send emails between your own mailboxes immediately, even without a verified phone number.
Use the Webmail link on the app card to sign in with your full email address and mailbox password.
For email clients such as Thunderbird, Outlook, or the mail app on your phone, use these settings:
| Setting | Value |
|---|---|
| Server (IMAP and SMTP) | App domain, such as www.yourdomain.com |
| Username | Full email address |
| IMAP | Port 993, SSL/TLS |
| SMTP | Port 587 with STARTTLS or port 465 with SSL/TLS |
The certificate is the same one used for the app domain. It will be installed a few minutes after setup.
You can use multiple domains for email in the same app:
- Click the gear icon (Settings) on the app card and go to the App actions tab.
- Enter the domain under Additional domains and leave Also create as mail domain enabled.
- Click Add. ZapX will add the mail domain in Mail Administration and show the required DNS records next to the domain.
For a mail-only domain, only the MX record needs to point to your server; the domain itself does not. Create mailboxes for the new domain as described in Step 3.
Your emails are sent from your VPS's own IP address. Its reputation depends only on your own email traffic. Follow these steps to help your emails get delivered reliably:
- Add the MX, SPF, DKIM, and DMARC records (Step 4) and set the reverse DNS (Step 5).
- Start by sending only a few emails and gradually increase the volume.
- Your website should use an address from your domain as the sender.
For more information and useful testing tools, see Web Hosting: Improve Email Deliverability.
The app catalog also includes the Stalwart app. This is a standalone mail server without webspace, Roundcube, or the setup provided by ZAP Webspace + Mail. You must configure domains, the TLS certificate, ports, and DNS records yourself in the Stalwart interface. It's suitable if you're already familiar with Stalwart and want to configure everything yourself. See the official Stalwart documentation for setup instructions.
If you don't want to run your own mail server, you can use an external provider such as Google Workspace or Microsoft 365 for your domain. Add the MX, SPF, and DKIM records provided by the provider to your domain. You don't need to install anything on your VPS.