Tutorial: Installing phpList on Debian Latest

In this tutorial, we will cover the steps required to install phpList on Debian Latest. phpList is an open-source software designed for managing email lists, newsletters, and mass email campaigns. To begin the installation process, follow the steps described below.

Step 1: Update the System

Before installing any software on the system, it is essential to update the packages installed. To do so, run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Apache Web Server

phpList requires a web server to function correctly. You can install Apache web server using the following command:

sudo apt install apache2

Step 3: Install PHP

phpList is a PHP-based application, and it requires a PHP version of 5.4 or higher. You can install PHP and other required extensions by running the following command:

sudo apt install php php-mysql php-mcrypt php-curl php-xml php-cli php-mbstring

Step 4: Install MariaDB

phpList requires a database to store its data. You can install MariaDB, a popular database management system, using the following command:

sudo apt install mariadb-server

Once installed, run the following command to secure the MariaDB installation:

sudo mysql_secure_installation

Step 5: Create a Database for phpList

phpList requires a dedicated database to manage its data. You can create a new database for phpList using the following steps:

sudo mysql -u root -p
CREATE DATABASE phplist;
CREATE USER 'phplistuser'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL ON phplist.* TO 'phplistuser'@'localhost';
FLUSH PRIVILEGES;
exit

Step 6: Download and Install phpList

You can download the latest version of phpList from their official website. Alternatively, you can use the following command to download and extract the package:

sudo wget https://github.com/phpList/phplist3/archive/main.zip -O phplist.zip
sudo unzip phplist.zip
sudo mv phplist3-main /var/www/html/phplist

Step 7: Configure phpList

Before accessing the phpList installation wizard, you need to modify the configuration file. Navigate to the directory where you installed phpList and rename the sample configuration file:

cd /var/www/html/phplist
sudo cp config/config.php.sample config/config.php

Then, open the config.php file and update the following lines:

define("PHPMAILERHOST",'your.smtp.server');
$database_host = 'localhost';
$database_user = 'phplistuser';
$database_password = 'your_password_here';
$database_name = 'phplist';

Step 8: Configure Apache for phpList

To configure Apache to serve phpList, you need to create a new virtual host file. Use the following command to create and open a new file:

sudo nano /etc/apache2/sites-available/phplist.conf

Then, add the following lines:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/phplist
    ServerName your_domain_here
    <Directory /var/www/html/phplist>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/phplist_error.log
    CustomLog ${APACHE_LOG_DIR}/phplist_access.log combined
</VirtualHost>

Replace your_domain_here with your actual domain name. Then, save and close the file. Enable the virtual host and restart Apache:

sudo a2ensite phplist
sudo systemctl restart apache2

Step 9: Access phpList

Open your web browser and navigate to http://your_domain_here/lists/admin/. You will be redirected to the phpList installation wizard. Follow the wizard's instructions to complete the installation process.

Congratulations! You have successfully installed phpList on Debian Latest. You can now use phpList to manage your email campaigns and newsletters.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!