Updated: Aug 15, 2020
Mailwizz is an email marketing software used to create email campaigns and manage email lists. Simply is the software from where we can send emails and monitor our delivery status and so on.
A self-hosted email marketing system:
As we know any email marketing system has two parts:
SMTP Server (The sender/receiver): This is a server that is specifically configured to send and receive emails on the internet.
The Management Application: where you can configure and connect your SMTP server to send and receive emails and manage your customers (Email Lists).We can also create Email Campaigns, Monitor and analyze results, Manage your delivery servers, etc.
Here we are going to use a VPS machine to install mailwizz application so that it'll be on cloud and accessible on any device. another thing is a SMTP server we already discussed how to set up a FREE SMTP server using postal so to use that server or any other SMTP server such as Amazon SES, Mailgun, Sendgrid, etc. We need an email marketing software tool in our case it is Mailwizz.
Requirements for Mailwizz installation.
Domain name: will point to our VPS and access out management on ease.
Server or a VPS server: On which we will install our Mailwizz software.
How to get your own domain name:
There are many domain registrars out there where you can buy a domain such as godaddy, namecheap, googledomain, etc. Getting domain names is easy and very cheap nowadays. I recommend buying .com, .org, .net domains as they are considered as standard. If you already own a domain then you can skip this part and continue the next step.
How to get your own VPS:
We need a VPS that is a virtual server on the cloud where we will install our Mailwizz software. Getting a VPS is as easy as getting a domain name. Some of the trusted and famous hosting service providers are Digital ocean and Contabo, Both are cheap and easy to configure.
As a start, you can Ubuntu 16/18 x64 as your OS and a 1-2 core CPU/ 2-4GB of RAM to run the software smoothly on your VPS. And later you can resize it as per the need.
Pointing domain name to VPS:
Once you get your domain to go to your domain name registrar and create a subdomain record and point it to your VPS IP address. in my case, I'll be creating wiz.primeclick.net and point it to my own IP address.
Now once you got a VPS and a domain pointing to it we can proceed with the installation process just follow each step given below and use the commands as it is.
After installing putty put your server IP address as shown in image above and click on OPEN after that you'll get connected to your VPS server via a terminal there it'll ask you for username and password of your VPS login there and now you're ready to fire some commands on it.
Step 1: Install Apache2 Web Server on Ubuntu :
To install Apache Web server just run below 2 commands on terminal
sudo apt update
sudo apt install apache2
Just wait a few seconds for the installation to complete, and after that run the following commands to test and enable the Apache service.
sudo systemctl restart apache2.service
sudo systemctl enable apache2.service
To test if the apache is installed properly and running properly. open any browser and in URL bar enter your VPS IP address (http://XXX.XXX.XXX.XXX) and hit enter
It'll redirect you to this default apache page and you're ready to go next.
Step 2: Installation of MariaDB (MySQL) Database Server;
Any Php script will require a database to store data here in our case we will use the MariaDB database server to store our Mailwizz system data.
To install MariaDB run the command below:
sudo apt-get install mariadb-server mariadb-client
Below are some handy commands to start, stop, and enable the MariaDB server. Run the below commands now
For Ubuntu 16.04 LTS
sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service
For Ubuntu 18.04 and 18.10 LTS
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Now, to secure the MariaDB server by a root password and disabling remote root access run below command.
It'll prompt some questions, answer them below by following the guide
Enter current password for root (enter for none): (Just press the Enter)
Set a root password? [Y/n]: Y
New password: (Enter your new password)
Re-enter new password: (Repeat your new password)
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
Restart the Mariadb
Restart MariaDB Mysql service
To test if MariaDB is installed, Use the below commands to log in to MariaDB server
sudo mysql -u root -p
Then type the password you created earlier for database, After that, a welcome message will show and you are now inside MariaDB as shown below
Step 3: Installation of PHP and Other Components
Mailwizz is developed using PHP so it'll require PHP 7.0 + to run it. I'll be using 7.1 you can use any version just by replacing mentioning the version name like 7.x and so on.
Now fire below commands
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
Next, run the commands below to install PHP 7.1 and related components.
(Below is a single line command so copy all and paste it)
sudo apt install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-gmp php7.1-curl php7.1-intl php7.1-mbstring php7.1-xmlrpc php7.1-mysql php7.1-bcmath php7.1-gd php7.1-xml php7.1-cli php7.1-zip php7.1-imap
Wait for some time to finish the installation.
Edit php.ini file:
We will use WinSCP to connect our VPS and browse to locate the config file. just download the application. It is free and small in size also very easy to use.
Next, Open WinSCP, and Connect to your VPS using the root user credentials. and go to: /etc/php/7.X/apache2/ Directory. Then open the “php.ini” file.
Now make changes in the file as mentioned below:
file_uploads = On allow_url_fopen = On short_open_tag = On memory_limit = 256M //You can increase this if you server can handle upload_max_filesize = 100M max_execution_time = 360 date.timezone = America/NewYork //Set you Time Zone here
Now save the file and restart the apache server by using below command;
sudo systemctl restart apache2.service
Step 4: Creating MailWizz Database;
Now we need to create a database and connect it to mailwizz so that it'll be used to store mailwizz data such as email lists, email templates, etc.
To login to the MariaDB MySql database server, run the commands below
sudo mysql -u root -p
Now create a database called Mailwizz
CREATE DATABASE mailwizz;
Create a database user called Mailwizz and give that user a password
CREATE USER 'mailwizz'@'localhost' IDENTIFIED BY 'Enter_Password_Here';
Now grant the user full access to the database.
(below is a single line command so copy all and paste it)
GRANT ALL ON mailwizz.* TO 'mailwizz'@'localhost' IDENTIFIED BY 'Enter_password_here' WITH GRANT OPTION;
Now, save your changes and exit.
Step 5: Setting up Mailwizz:
1. After downloading mailwizz extract the zip file and you'll find a folder inside named "INSTALL"
2. Zip that folder to install.zip and upload it in directory /var/www/html.
3. Now connect your VPS using putty
4. Now change the directory to /var/www/html using the following command:
Now we need to install the install.zip folder which we uploaded earlier. In order to do so, we need to install unzip tool to decompress the file. run below command.
sudo apt-get install unzip
Unzip the “latest.zip” file using the following command:
Using WinSCP, Move all the content of the latest folder content to the upper directory so it can be accessed directly.
Then delete the html folder, and rename “latest” to html.
Step 6: Configuring Mailwizz.
Now open any browser and in URL bar enter your domain and /install. in my case it is
Now, Enter your purchase code, Agree on the terms and click Next
After clicking on next you'll probably see a window as shown below some of the PHP extensions are required before we proceed to do so simply run below commands:
sudo apt-get install php-xml
sudo apt-get install php-mbstring
sudo apt-get install php-curl
sudo apt-get install php-zip
sudo apt-get install php-imap
sudo service apache2 restart
Now click next, Mailwizz installation will check for folder permissions, if you see any warning, then Open WinSCP and set the permission for each mentioned folder to 777.
or you can use putty terminal to do the same:
sudo chmod -R 777 /folderpath
After setting up all the folder permissions click next, Now it'll ask for database details. in my case they are:
Username: mailwizz (done in step 4)
Password: Enter Your DB Password (done in step 4)
Database name: mailwizz (done in step 4)
Click Next and Create Your Admin Account.
After clicking next it'll ask you to configure cron jobs. how to setup? just follow the next to last step!
Step 7: Setting up Cron Jobs (VERY IMPORTANT)
Cron jobs setup is the most important part here. They are simply scheduled tasks that run automatically as configured. So we schedule campaigns in Mailwizz to run them on a specific time we need to set up cron jobs.
Just copy all the listed cron jobs as shown in the screenshot above and paste it in the “crontab” file.
Open WinSCP, and navigate to “/etc” directory you will find the “crontab” file. Edit it, and paste the jobs inside, then save.
Note: when you paste the jobs add “root” to the commands so the jobs car run as root user on your VPS. Example:
(Below is a single line command)
* * * * root /usr/bin/php -q /var/www/html/apps/console/console.php send-campaigns >/dev/null 2>&1
That's it !! Maliwizz is ready for use!
Optional Step: Installing Free SSL Certificate using certbot:
just fire below commands as it is to install SSL
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt install python-certbot-apache
sudo certbot --apache -d your_domain
ex: sudo certbot --apache -d wizz.primeclick.net