How to Install Mailwizz 1.5.1 on Ubuntu 16.04/64 bits with VestaCP + PHP 7 + PCNTL Enabled

PART 1/2

Step 1 #

# Rent a 4 GB Ram Quad Core VPS server with at least 20 GB SSD space and install Ubuntu 16.04 64 Bits on it. You can rent the VPS with some provider that gives you SSH root access.

I can recommend and

If you don't know how to setup a VPS with Time4vps you can use my previous step by step tutorial at:

Step # 2

# Use linux terminal or Windows putty to connect to your VPS server (replace with your own domain)

ssh root@your_vps_server_ip_address

# if your SSH server does not respond onthe default port ( 22) you can use -p to indicate the SSH port to connect with:

ssh root@your_vps_server_ip_address -p 22222

Step # 3

# Update the repositories

sudo apt-get update

Step # 4

# Upgrade your OS

sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y

Step # 5

# Install the english locales

sudo locale-gen "en_US.UTF-8" && sudo dpkg-reconfigure locales

Step # 6

# Install some utilities like curl, nano and zip

sudo apt-get install curl nano zip php-zip -y

Step # 7

# Install the great VESTACP control panel into your VPS server

# Download VestaCP 0.9.8 release 19 script with:

curl -O

Step # 8

# Run the VestaCP installer (You must replace the example data with your own data as shown below:

--password your_own_password

# This is the command to install Vestacp into your VPS:

bash --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin no --clamav no --softaculous no --mysql yes --postgresql no --hostname --email --password your_own_password --force

# Don't forget to use the --force option at the end of the install command !!!

Step # 9

# Enable PCNTL under PHP 7.0.22 (it is the vestacp's default php version installed)

# change to temp directory
cd /tmp

# install the developer tools to compile php
apt-get install php7.0-dev -y

# download the sources

# uncompress the source file
tar zxvf php-7.0.22.tar.gz

# change to the PCNTL directory
cd php-7.0.22/ext/pcntl

# then run this command

# the run this command

# the run this command

# change to the modules directory
cd modules

# copy the pcntl module to libraries directory
cp /usr/lib/php/20151012

# edit file /etc/php/7.0/mods-available/pcntl.ini
nano /etc/php/7.0/mods-available/pcntl.ini

# Add the following line to the blank file:

# Save and close the file using CTRL + X , Y, Enter

# change directory
cd /etc/php/7.0/apache2/conf.d

# create symbolic link for the new pcntl ini file
ln -s /etc/php/7.0/mods-available/pcntl.ini 20-pcntl.ini

# edit the default vestacp php.ini file
nano /etc/php/7.0/apache2/php.ini

# Use CTRL + W to search for "disable_functions" and comment the line using ; at the beginning of the line:


# Save and close the file using CTRL + X , Y, Enter

# Restart Apache2 server with:

sudo service apache2 restart

# Now you could check that PCNTL is active and working from the following page after install Mailwizz onyour vps server visiting this page:

Step # 10

# Restart the vps

sudo shutdown -r now

Step # 11:

# Inside your domain's registrar control panel you must point the two nameservers of your domain to your VPS IP address, like:

where is your VPS IP address

Step # 12

# Login to your Vesta control panel using https://your_server_ip:8083 using admin username and your own password

Step # 13

# Disable IPv6 for Dovecot from:

Go to Server tab and open Dovecot configuration

Change line 2 to this:

listen = *

Save and restart the dovecot service

Step # 14

# Change the DNS Servers on Vestacp's Default package to:

Save the changes

Step # 15

# Add to your admin account using the plus sign (+) on WEB menu

Step # 16

# Remember to add the following two A records to your domain DNS zone using:

where must be the IP address of your VPS server

Step # 17

# Now you can upload mailwizz 1.5.1 to your web root folder

# Go to your web root directory

cd /home/admin/web/

# At this point you should use Filezilla or WinSCP to upload your mailwizz 1.5.1 installer inside the root folder of your web server ( file that you downloaded from Mailwizz customer area or from CodeCanyon)

# My web server root folder for this vestacp user (admin) and for this vestacp domain ( is:


# You can use "ls -lha" command to see the file is present inside the actual directory

ls -lha

# you must get at least three files inside the directory:

- index.php
- robots.txt

# You must remove the other files using rm

rm index.php
rm robots.txt

# Now you must unzip the mailwizz zip file using:


# Now you can enter to the latest mailwizz directory (to do a full / clean install)

cd mailwizz-1.5.1/latest

# And move all files (files and directories) from inside latest folder to the root folder

mv * /home/admin/web/

# Now we must change to the root folder

cd /home/admin/web/

# And must change ownership of all files to the admin user:

chown -R admin:admin *

# Let's check again with ls -lha

ls -lha

# Now the file permissions are right before to install Mailwizz

Step # 18

# Now you must create the MySQL database to install Mailwizz on it
For this you need to use DATABASE menu inside VESTACP control panel

Go to your https://your_vps_server_ip:8083/add/db/ URL to add a database

# Create the DB and write down the following data for later use:

DB name: admin_mailwizz
DB User: admin_mailwizz
DB Pass: your_own_generated_password
DB HOST: localhost
DB Port: 3306

# Remember to click the save button and send DB credentials to your mail box.

Step # 19:

# Go to

to begin with Mailwizz Install Wizard and follow the steps

Mailwizz Install STEPS:

Part 1. Welcome

Enter your Name, mail and MW license here

Part 2. Requirements Check

# You must get the message:

Congratulations! Your server configuration satisfies all requirements by MailWizz EMA

before to continue to the next step

Part 3. File System Checks

# You must get the message:

Congratulations! The file system satisfies all requirements by MailWizz EMA.

before to continue to the next step

Part 4. Database Import (Connection)

Use the DB data you wrote on previous step here

Part 5. Admin account

Enter your name, last name, email, password, time zone, and also you can create first customer with same data if you want

Part 6. Set Cronjobs

# Use the "crontab -e" command to open the crontab editor
# If requested select NANO option number as your default cron editor

crontab -e

# Add the crontabs to the end of file (remember to replace with your correct domain)

# Campaigns sender, runs each minute.
* * * * * /usr/bin/php -q /home/admin/web/ send-campaigns >/dev/null 2>&1

# Transactional email sender, runs once at 2 minutes.
*/2 * * * * /usr/bin/php -q /home/admin/web/ send-transactional-emails >/dev/null 2>&1

# Bounce handler, runs once at 10 minutes.
*/10 * * * * /usr/bin/php -q /home/admin/web/ bounce-handler >/dev/null 2>&1

# Feedback loop handler, runs once at 20 minutes.
*/20 * * * * /usr/bin/php -q /home/admin/web/ feedback-loop-handler >/dev/null 2>&1

# Delivery/Bounce processor, runs once at 3 minutes.
*/3 * * * * /usr/bin/php -q /home/admin/web/ process-delivery-and-bounce-log >/dev/null 2>&1

# Various tasks, runs each hour.
0 * * * * /usr/bin/php -q /home/admin/web/ hourly >/dev/null 2>&1

# Daily cleaner, runs once a day.
0 0 * * * /usr/bin/php -q /home/admin/web/ daily >/dev/null 2>&1

# Save and close the file using CTRL + X , Y, Enter

# Now you must delete the Mailwizz install folder from your web root folder

rm -rf /home/admin/web/

STEP # 20

# Login to your Mailwizz BACKEND Area accesing the following URL:

# Remeber to use your email and password you choose on previous step # 19 point 5.

Next part I will cover the Mailwizz configuration to be able to add the five system mailboxes and also one delivery server to send campaigns.

Last edited:
# Additional CRONTABS

# Using console or Linux terminal you can use the "crontab -e" command to open the crontab editor. If requested, select NANO option as your default cron editor

crontab -e

# Add these additional crontabs to the end of file to process CLI and URL Imports (remember to replace with your correct domain)

*/5 * * * * /usr/bin/php -q /home/admin/web/ list-import folder >/dev/null 2>&1

0 0 * * * /usr/bin/php -q /home/admin/web/ list-import url >/dev/null 2>&1

*/5 * * * * /usr/bin/php -q /home/admin/web/ suppression-list-import folder >/dev/null 2>&1