Complete Guide to Install Sendy on DigitalOcean at $5 a Month
After getting fed up with MailChimp, and not getting enough ROI, I finally began searching for a MailChimp clone that's cheaper.
I came across the awesome self-hosted app called "Sendy". I managed to buy a license for one of my domains and managed it to host it on one of my servers at DigitalOcean. This application sends emails through Amazon SES servers, that ensure maximum deliverability.
In this post, I'll explain you in detail how you can install Sendy application and send emails to your subscribers at a dirt cheap price of $5 per month and may be additional $1 per 10,000 emails. All you need to do is just buy a lifetime license for Sendy at $59, you are good to go. Compared to the price you pay for MailChimp or other email softwares, this is certainly a good investment.
One you acquire Sendy, it's now your time to install it on your Server.
Installing Sendy on DigitalOcean Droplet
Why DigitalOcean? DigitalOcean is one of the fastest growing Cloud hosting services out there. I personally host all my sites on DigitalOcean. This is mainly due to the speed and reliability they offer. The basic plan of $5 per month is more than enough for you to install Sendy.
This is the cheapest and easiest cloud solution available to date.
You can sign up for DigitalOcean through this link, and get $10 of free credits (2 months of free Sendy hosting).
Creating a new droplet
As I've said you earlier the basic droplet of $5 per month is enough for the Sendy to be working greatly. For this, first off, you need to create a droplet.
Once you login to your DigitalOcean account, you can see the green button saying, "Create droplet". Click on that.
Now you need to create a latest CentOS droplet, as seen in the below screenshot.
Why CentOS? I've seen many times that Sendy won't properly work on Ubuntu servers. Sometimes, you face the stubborn mod_rewrite issues on Ubuntu. Although Ubuntu may be a choice for most of them, I strongly recommend you install Sendy on CentOS. Even the Sendy team recommends you do so.
Here are the settings you need to set while creating a new droplet.
Distributions: CentOS (latest)
Choose a size: $5/month
Add block storage: None
Choose a datacenter region: NYC3
Select additional options: None
Add your SSH keys: Optional
How many Droplets? 1 Droplet
Choose a hostname: sendy (your choice)
Now click on the create droplet button.
It will take a few seconds to spin up a new server for you. You'll also receive an email from DigitalOcean containing your IP address, root password, etc. Note it.
Adding domain forwarding
In this step, you need to decide, the subdomain on which you would like to install Sendy on (sendy.example.com).
Go to your domain registrar and here you need to add a new 'A' record to point sendy.example.com to the IP address of your newly created droplet.
Record Type: A Record
Host Name: sendy
Points to IP/value: IP address of the newly created droplet
Connecting to Droplet
Now you to need to get Terminal access to the droplet you've just created.
Mac users: If you are a Mac user, you have inbuilt Terminal app in your OS. You can use Spotlight search to use it.
Once you open the terminal, type in.
Enter the root password of the droplet you received in your email.
Windows users: You need to install a free software called PuTTY. There you need to enter the IP address of your droplet as hostname, select connection type as SSL, and connect to the server. There login as root and enter the root password.
PS: I'm using Mac terminal.
The Terminal will prompt for you to change the default password of your Droplet for security reasons.
Re-enter the current password and change it to new one. Make sure the new password you set is difficult to guess and brute force upon. This is the new password that you use to ssh into your new droplet from now on.
Installing LAMP stack
Installing LAMP is nothing but installing on Linux the Apache, MySQL, and PHP. Remember, you don't need to install Nginx (LEMP) as Sendy is not made to run on Nginx.
Let me guide you to install the components one-by-one.
The first thing you need to install is Apache. To install Apache on your CentOS, just type in this command in your Terminal.
sudo yum install httpd
The sudo lets you to install Apache with root privileges. The yum is the package where most of the CentOS software packages are thete in. After you type in this command, type in 'y' to confirm that you want to install it.
After the installation is completed, you get the complete message as shown the above screenshot.
Now after the installation, you need to activate Apache by the following command.
sudo systemctl start httpd.service
Once the Apache is activated, you can go to your subdomain (sendy.example.com) and check if you see the below page.
It means that the Apache is installed successfully on your server.
Installing MySQL (MariaDB)
For the Sendy to install,you also need a database where you can store the Sendy data. So, for creating database, first you need to install mysql package on your server.
Install MySQL or MariaDB with the command below
sudo yum install mariadb-server mariadb
Now start the mysql server.
sudo systemctl start mariadb
Here's the screenshot of the same.
Once you enable it, you need to set apassword to your mysql access.
For that, type in.
Once you type in this command, it will ask for the password. Since you haven't set one yet, leave it blank and hit enter.
Now it will ask you to setup a new password for MySQL root user, and confirm the same.
Now it will ask several questions. Simply hit the enter key to set the default secure configurations to your MySQL.
Now you need to enter the below command to enable the MySQL to start every time the server is booted and to start running it now.
sudo systemctl enable mariadb.service
Install PHP modules
You need to install PHP modules. To start with this enter the following.
sudo yum install php php-mysql
The above command will install both the common files for PHP and also necessary files to operate PHP with MySQL.
After this, you need to restart your Apache server to apply the changes.
sudo systemctl restart httpd.service
Optionally, to test the functionality of the PHP, you can create a new PHP file that displays the PHP info and open it in your browser. However, this may not be required as long as you don't see any warning or error messages while installing PHP modules.
With this, you've successfully installed LAMP stack on your VPS server.
Create a database for Sendy
As you've installed MySQL on your server, it's now possible to create a new database for Sendy to work.
To login to MySQL as root type in
mysql -u root -p
Now create a new database and exit the MySQL.
create database sendy;
Click this if you have an old Sendy Backup that needs to be restored
If you are migrating Sendy from a old server to new server here, then you need to export the old database in the old server via PhpMyAdmin or SQLDump and upload it to the new server perhaps under /home directory. So that the location of the database would be like /home/old-sendy.sql
Supply the below command to import database to the new database.
mysql -u root -p sendy < /home/old-sendy.sql
Configure Sendy to connect to the new database
So in order to let Sendy core files to communicate with the database you created just now, you need to edit the file config.php under 'includes' folder in the Sendy download.
Open the config.php.
As shown in the below screenshot enter the installation URL and the database name and credentials and hit save. A simple Notepad application can do this.
Once you finished editing the config file, save it as sendy.zip and upload it to your server under /var/www/html directory.
For uploading the file, you can make use of FTP file managers like FileZilla or CyberDeck available for all the OSes. Just download any of these softwares. Go to site manager. There create a new site and enter the droplet IP address in host field, seelct SSH as protocol, user as root, and enter the root password. Now connect to your server.
Now browse to /var/www/html and drag and drop the sendy.zip file on your computer to the server.
Now open the Terminal.
There when you type in,
You can see the sendy.zip file you uploaded.
Now you need to unzip the file. For this you need to install the unzip module first.
yum install unzip
After installing unzip, now type in
The files under the zip file will be extracted under a seperate folder called 'sendy'. Now you need to move those files outside the sendy directory to the html folder. For this, execute the following commands.
mv * /var/www/html/
The above command browses inside the /var/www/html/sendy directory and moves all the files there to /var/www/html/
Now browse back to /var/www/html/ and list all the files
Now you need to delete the sendy.zip folder in your html folder that you uploaded to prevent being downloaded by the public.
You need to give the permissions 777 to the uploads folder, so that Sendy have access to this folder, by issuing the bloe command.
chmod 777 /var/www/html/uploads
Setting up cronjobs for autoresponders and scheduled emails to work
The files autoresponders.php and scheduled.php need to run every 1 and 5 minutes respectively to check whether there are any emails to be sent. You can't manually execute every minute or so.
For this, Linux has the inbuilt option called "Cron", that lets you to automate the tasks and execution. Using this, you can automate this task. Linux has a file called Crontab in which you can set these scripts to run as you wish.
You can edit the crontab with the command.
sudo crontab -e
Now press the 'i" key to enable the editing of the file.
Add the below two lines at the top of the file.
*/5 * * * * php /var/www/html/scheduled.php > /dev/null 2>&1
*/1 * * * * php /var/www/html/autoresponders.php > /dev/null 2>&1
Now save the file by pressing Esc, typing :wq and hit enter
Setting up weekly Sendy backups: Sendy do not allow you automatically backup the database. So you need to setup a cron job that backs up the Sendy database weekly to a directory.
For this first you need to create a directory in your server, that's not reachable by the public to store your scheduled database backups. Let the Sendy database backups be stored in /home/sendy_backups/. Now let's go ahead create one.
sudo crontab -e
Edit the file by pressing 'i'. Add the following line to the file.
* * */7 * * /usr/bin/mysqldump -u root -p'mysqlpassword' sendy > /home/sendy_backups/$(date +%F)_full_sendy.sql
Replace the "mysqlpassword" with your MySQL root password. Now save the file hitting Esc button, typing ":wq" and hit enter.
YOu can execute the following command to make the backup of today in the terminal.
* * */7 * * /usr/bin/mysqldump -u root -p'mysqlpassword' sendy > /home/sendy_backups/$(date +%F)_full_sendy.sql
You can see the file as "2016-11-08_full_sendy.sql" under /home/sendy_backups.
However the cronjob you set up earlier will take care of the backups every week.
Now Sendy installation is complete.
To access the Sendy application, you need to enter the sendy.example.com (your subdomain) on the browser. Sign up for Sendy using your name, email, new password, license key (you got it in the Sendy purchase email), and you need to also enter the Amazon SES access keys.
You need to sign up for Amazon SES. There create a new user - sendy. Now you'll be provided with the access id and key for the user to access the AWS. Later you need to request the production access for your SES account.
Now enter the access id and key on the sign up form in your Sendy installation. Now sign up.
You can refer the Step 5 in the Sendy Get Started Guide for this.
Once you fill in the sign up form, you should be redirected to the login page. Where you login using the credentials you set up earlier.
Click this if Sendy login is returning 404
After the fresh installattion, the chances are there that the login page for Sendy returns "404 error. If this is the case, you need to do the following.
Login to your server via SSH.
In this file add the following line under "RewriteEngine On".
Save the file by pressing Esc and typing in :wq and hit enter. The above thing enables to enables the mod_rewrite in your server. Now restart your Apache server by the following command.
service apache2 restart
Now again you need to sign in for the Sendy. If you see the 404 error again, here's the surefire fix.
Now modify the "AllowOverride None" to "AllowOverride All" in the httpd.conf file. This enables the server to respect the changes made in the .htaccess file earlier.
After logging in, you can create brands, create lists within them. There are also options for you to import the exisiting list, etc.
If you are facing any other issues like 500 error, blank page, and any other issues while using Sendy, refer their troubleshooting page.
This is nothing but an application that's a MailChimp clone. You get all the features of MailChimp except the advanced segmentation features.
Here are the features you get.
- Autoresponders (which MailChimp's free plan don't have)
- Automatic bounce and complaint handling
- Import and exporting of email lists
- Statistics (by countries, opens, link clicks, bounces, unsubscribes, mark as spams, etc)
- Scheduled emails
- Campaign builder
With these features, this is the perfect Mailchimp alternative you can get. That too at a fraction of the cost. With Mailchimp it costs around $200 for sending 10,000 emails whereas, Sendy allows you to send 10,000 emails at $1 via Amazon SES.