Sendy is a self hosted email newsletter application that lets you send bulk emails without restrictions or high costs that come with other commercial, “as-a-Service” newsletter platforms.
Sendy is very cheap ($69 one-time fee) and you can install it on your own server which gives you great control given the fact that your database will contain sensitive data of third-parties.
Whilst there are many articles explaining how to install Sendy on AWS, there are very few guides on how to install Sendy on a self-hosted server; this is what we will demonstrate in this article.
Easy Steps to Install Sendy on Ubuntu Server
Pre-requisites
- Valid Sendy license – during your license purchase you will be asked to submit your Name, Email and Domain name. These will be needed afterwards so make sure you remember them.
- Sendy application files – these are delivered to you upon the successful purchase of Sendy license.
- SSH access on Linux Ubuntu server with ‘root’ or a sudo privileged account.
Note: All commands in this tutorial assume you are accessing the server using the root account. In any other case, please prepend “sudo” to each of the commands listed below.
Step 1: Install LAMP (PHP, Apache, MySQL/MariaDB)
Sendy software requires the LAMP stack to be installed. Please use the following commands on your Ubuntu server to install Apache2, PHP and MariaDB server.
Install Apache2
root@localhost:~$ apt-get install apache2 -y
Then, enable rewrite module as follows:
root@localhost:~$ a2enmod rewrite
Install PHP-FPM and other required libraries
root@localhost:~$ apt-get install php-fpm libapache2-mod-php php-mysql php-curl php-xml -y
Install MariaDB 10x.
root@localhost:~$ apt-get install mariadb-server mariadb-client -y
Upon successful installation of MariaDB, proceed with the following command to secure the installation:
root@localhost:~$ mysql_secure_installation
We have included in bold letters where your input is required:
root@localhost:/var/www/html# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Step 2: Create Database for Sendy
Connect to your mysql server using command line using the root password you set in the previous step.
root@localhost:~$ mysql -uroot -p
MariaDB [(none)]> create database sendydb;
Create a user and grant it with full permissions on the database:
MariaDB [(none)]> GRANT ALL ON sendydb.* TO 'sendy'@'localhost' IDENTIFIED BY 'enter-strong-password-here';
Step 3: Upload Sendy software
Upon successful license purchase, a zip file containing the application files should have been delivered to you. Upload the zip on the /var/www/html/ directory of your server and proceed with unzip, as follows:
root@localhost:/var/www/html$ unzip sendy-6.1.1.zip
A new folder ‘sendy’ will be created under /var/www/html. In order to avoid having the /sendy/ in your URL, you can move the contents outside the /sendy/ folder, as follows:
root@localhost:/var/www/html$ mv /var/www/html/sendy/* /var/www/html/
Also ensure you move the .htaccess, as follows:
root@localhost:/var/www/html$ mv /var/www/html/sendy/.htaccess /var/www/html/
Update database credentials in Sendy config file:
root@localhost:/var/www/html$ vi sendy/includes/config.php
Update the fields $dbHost , $dbUser, $dbPass, $dbName according to the details of your mysql database (refer to Step 2 above).
/* MySQL database connection credentials (please place values between the apostrophes) */
$dbHost = 'localhost'; //MySQL Hostname
$dbUser = 'sendy'; //MySQL Username
$dbPass = 'enter-strong-password-here'; //MySQL Password
$dbName = 'sendydb'; //MySQL Database Name
Save the file and exit.
Step 4: Restart LAMP stack and enable to auto-start on server boot
Restart all services using the following commands:
root@localhost:~$ systemctl restart apache2 && systemctl restart php8.1-fpm && systemctl restart mysql
Then, enable services to auto-start as follows:
root@localhost:~$ systemctl enable apache && systemctl enable php8.1-fpm && systemctl enable mariadb
Step 5: Install Sendy
The last step of this tutorial is the easiest. Prior accessing the Sendy installation wizard, navigate to the following URL to confirm your server environment meets all requirements for Sendy:
https://<your_domain>/_compatibility.php?i=1
If everything has been installed as per this tutorial, you should see a 10/10 score which means you can proceed to installing Sendy.
Navigate to the following URL so you can begin the Sendy installation:
https://<your_domain>/_install.php
Complete the required fields as indicated in the installation wizard and click “Install now“.
Congratulations! You have successfully installed Sendy on Ubuntu 22.04 server!
Need Help? Have Sendy Installed for Free!
By purchasing any VPS or dedicated server from NetShop ISP, we can install Sendy completely free of charge. All we will need is the license key and the zip file which you have obtained when purchasing the Sendy license.
For more information please contact our Hosting specialists today!