Skip to content

Watch How To Setup an Email Server on VPS - The Complete Tutorial Video

Learn how to set up your own business email server on VPS the easiest way with minimum codes and commands. In this tutorial, I used the combination of TinyCP control panel, EXIM4, and Roundcube to create the email server and start sending and receiving emails.

Step 2: Download PuTTY

Download PuTTy and SSH to Your VPS

Step 3: Download & Install a Control Panel

Copy and paste the following command lines to download and install TinyCP control panel on your VPS. A control panel helps you manage your websites from your browser.

					sudo apt install gnupg ca-certificates
sudo apt-key adv --fetch-keys
sudo echo "deb all main" | sudo tee /etc/apt/sources.list.d/tinycp.list
sudo apt-get update
sudo apt-get install tinycp

Step 4: Connect to your Control Panel

Connect to your control panel via the browser by copying and pasting the IP address + the port that you got at the end of the installation.

Step 5: Configure Your Control Panel

To host your WordPress websites on your VPS, install the required packages required by WordPress: You can choose between Apache and Nginx, in the tutorial video above, I chose Nginx because it's faster. You also need to install the latest PHP FPM and MariaDB database management system.

Step 6: Add Domain Names to TinyCP And Link Them to the VPS

You can now add your domain names, it's recommended to add the main domain name on which you'd like to host your website and a subdomain for your email application. To link your domain to the VPS, in the DNS, create A records that point to your VPS IP address. In the video, I pointed the main domain name along with the subdomains "www" and "mail" to the VPS.

Step 7: Install EXIM MTA

An MTA stands for "Message Transfer Agent", it is responsible for the messages that you send and receive, it also allows you to create email accounts. EXIM can be installed with a one click from TinyCP, by first clicking on the gray email icon and then following the instructions that follow.

Step 8: Install Roundcube

Roundcube is a popular email client, it allows you to connect to your email accounts, and also send and receive emails via the browser. Installing Roundcube requires a database with a username and a password.

Step 9: Configure Roundcube - Fix Issues

If you try to log into Roundcube, it will not work, because the config file has issues, to fix this you need to change some details and save the file via FileZilla. More detrails are in the video above.

Step 10: Configure DNS to start receiving emails

Without proper DNS configuration, the mail server will not be able to handle received messages.

Step 11: Test sending and receiving emails

You can now test your mail server to see how it's working.


° 00:00 Introduction
° 00:43 Connect to the VPS & Install TinyCP
° 02:10 Connect to TinyCP
° 02:32 Configure TinyCP to host websites
° 03:03 Add domain names to TinyCP and link them to the VPS
° 04:27 Install EXIM4 MTA
° 05:39 Create Email Accounts
° 06:37 Install Roundcube
° 08:50 Configure RoundCube – Fix Issues
° 12:10 Configure DNS to start receiving emails
° 15:31 Test sending and receiving emails

Have you encountered a problem?
I am here to help! Leave your comment below.

4 thoughts on “How To Setup an Email Server on VPS – The Complete Tutorial Video”

  1. Avatar


    I have already followed your instructions, and it is working fine. My problem is I can send emails but not receive them on Gmail. How do you check and fix it?

    1. Avatar


      You cannot send emails if port 25 is blocked. Some VPS providers block this port to prevent spammers from using their services, making it impossible to build a mail server on their VPS. The solution is to find a VPS provider that does not restrict access to port 25.

Leave a Reply

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

Pin It on Pinterest

error: Content is protected !!