How to Install phpList on Ubuntu Server
phpList is open-source software for managing email campaigns. To install phpList on your Ubuntu Server, you can follow the steps below.
- Update and upgrade your Ubuntu packages:
sudo apt-get update
sudo apt-get upgrade
- Install LAMP stack (Apache, MySQL/MariaDB, PHP) using the following command:
sudo apt-get install apache2 mysql-server php libapache2-mod-php php-mysql php-mbstring php-xml
- Next, you need to create a database for phpList. To do so, run:
sudo mysql -u root -p
Enter your MySQL root password, and then run the following commands:
CREATE DATABASE phplist;
GRANT ALL PRIVILEGES ON phplist.* TO 'phplist'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
exit
Note: Replace 'PASSWORD' with your preferred password.
- Download the latest version of phplist from https://www.phplist.com/download-phplist and extract the files to the /var/www/html directory:
cd /tmp
wget https://phplist.org/latest.zip
unzip latest.zip -d /var/www/html/
- Change the ownership of the /var/www/html/phplist directory to the Apache user:
sudo chown -R www-data:www-data /var/www/html/phplist/
- Now navigate to the phplist directory:
cd /var/www/html/phplist/
- Copy the config-sample.php file to config.php:
cp config/config.sample.php config/config.php
- Edit the config.php file using your preferred text editor:
sudo nano config/config.php
- Update the database settings in the config.php file as follows:
$config['database_host'] = 'localhost';
$config['database_name'] = 'phplist';
$config['database_user'] = 'phplist';
$config['database_password'] = 'PASSWORD';
Note: Replace 'PASSWORD' with the password you set for 'phplist' user in Step 3.
Save and close the file.
Set the proper permissions for the cache and attachment directories:
sudo chown www-data:www-data lists/config/ && sudo chmod 755 lists/config/
sudo chown www-data:www-data upload/ && sudo chmod 755 upload/
- Restart Apache:
sudo systemctl restart apache2
- Finally, navigate to the phplist website in your web browser:
http://YOUR_DOMAIN_NAME_OR_IP_ADDRESS/phplist/
Follow the on-screen instructions to install and setup phplist.
That's it! You have successfully installed phplist on your Ubuntu Server.