CiviCRM is a free, open-source, and cloud-based CRM system specifically tailored to the needs of non-profit, civil society, and association-based organizations. CiviCRM can be installed with WordPress, Drupal or Joomla to track contacts and their relationships with projects and initiatives. Many well-known organizations use CiviCRM, including the Free Software Foundation, Creative Commons, Amnesty International, and the Wikimedia Foundation.
This tutorial will teach us how to install CiviCRM with WordPress on Ubuntu.
Before you start, you need to update your system to the latest version. You can do this by running the following command:
apt-get update -y apt-get upgrade -y
Once your system has been updated, restart it to apply the changes.
Next, you must install the Apache web server, MariaDB server, PHP, and other required packages in your system. You can install all the packages by running the following command:
apt-get install apache2 mariadb-server libapache2-mod-php7.2 php7.2 php7.2-curl php7.2-gd php7.2-mbstring php7.2-mysql php7.2-zip php-dev libmcrypt-dev unzip -y
Once all the packages are installed, you also need to install the PHP module mcrypt in your system. You can install it with pecl as shown below:
pecl channel-update pecl.php.net pecl install mcrypt-1.0.1
Next, open the php.ini file and make some settings.
nano /etc/php/7.2/cli/php.ini
Change the following lines:
memory_limit = 256M upload_max_filesize = 64M short_open_tag = On max_execution_time = 300 default_charset = "UTF-8" extension=mcrypt.so
Save and close the file when you're done.
First you need to create a database and a user for WordPress. To do this, log into the MySQL shell with the following command:
mysql -u root -p
Enter your root password when prompted and create a database and user with the following command:
MariaDB [(none)]> CREATE DATABASE wordpressdb; MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpressdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'password';
Then set the permissions with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
Next, create a database and user for CiviCRM with the following command:
MariaDB [(none)]> CREATE DATABASE civicrmdb; MariaDB [(none)]> GRANT ALL PRIVILEGES ON civicrmdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'password';
Flush the permissions and exit the MySQL shell with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Once you're done with that, you can move on to the next step.
First, download the latest version of WordPress from the official website by executing the following command:
cd /var/www/html/ wget https://wordpress.org/latest.zip
Once the download is complete, unzip the downloaded file with the following command:
unzip latest.zip
Next, give the www-data user the permissions as shown below:
chown -R www-data:www-data /var/www/html/wordpress
When you're done, you can proceed to the next step.
First, you need to create an Apache Virtual Host file for WordPress. You can create it with the following command:
nano /etc/apache2/sites-available/wordpress.conf
Paste the following lines:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/wordpress
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/html/wordpress/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save and close the file when you're done. Then activate the Apache virtual host and the rewrite module with the following command:
a2ensite wordpress a2enmod rewrite
Finally, restart the Apache web service for the changes to take effect:
systemctl restart apache2
Now open your web browser, enter the URL http://example.com and exit the WordPress installation.
First, download the latest version of CiviCRM from the official website by executing the following command:
wget https://download.civicrm.org/civicrm-5.19.1-wordpress.zip
Once the download is complete, unzip the downloaded file with the following command:
unzip civicrm-5.19.1-wordpress.zip
Next, move the unzipped directory to the /var/www/html/wordpress/wp-content/plugins/ directory:
mv civicrm /var/www/html/wordpress/wp-content/plugins/
Give the plugins directory the correct permissions with the following command:
chown -R www-data:www-data /var/www/html/wordpress/wp-content/plugins/ chmod -R 777 /var/www/html/wordpress/wp-content/plugins/civicrm
Now open your web browser and enter the URL http://example.com/wp-admin/plugins.php. You should see the following screen:
Now click on the Activate button to activate the CiviCRM plugin. You should see the following screen:
Now go to the WordPress dashboard and click on the CiviCRM installer in the left pane. You should see the following page:
Now enter your CiviCRM database details and click on the Check Requirements and Install CiviCRM button. Once the installation is complete. You should see the following screen:
Congratulations! You have successfully installed CiviCRM with WordPress on the Ubuntu 18.04 server. Now you can configure and extend CiviCRM according to your needs.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…