Introduction
CiviCRM is a customer relationship management suite that can use Drupal, Joomla!, or Wordpress to track contacts and their relationships to projects and initiatives.
In this guide, we will discuss how to install CiviCRM on all three of these platforms on top of an Ubuntu 12.04 installation.
Prerequisites
This guide assumes that you have installed LAMP (Linux, Apache, MySQL, and PHP) on your Ubuntu 12.04 VPS. If you have not done so already, follow this guide to install LAMP on Ubuntu.
You will also have to decide which content management system (CMS) that you wish to use with CiviCRM. The CMS of your choice will have to be installed prior to undertaking the CiviCRM installation, but we will cover that in each CRM section.
Drupal
Drupal is a popular CMS choice. Follow this link to install Drupal on an Ubuntu VPS if you haven't done so already.
Be sure to substitute the most recent version of Drupal for the version in that guide.
Download and Install the Module
We will make sure that the web user has ownership of the Drupal files by executing the following lines of code:
cd /var/www
sudo chown -R www-data:www-data *
Next, log into your Drupal site as an administrator using the credentials you established during installation.
Go to the "Modules" tab at the top of the page. Click on the "Install new module" link.
Enter this URL for the CiviCRM Drupal package into the "Install from a URL" field. Click "Install".
http://downloads.sourceforge.net/project/civicrm/civicrm-stable/4.3.5/civicrm-4.3.5-drupal.tar.gz
You should get a notification telling you that the installation was successful:
Configure MySQL
Next, we will create a database specifically for CiviCRM. In you terminal, log into MySQL with the following command:
mysql -u root -p
Type the root MySQL password to get a new prompt. Create the CiviCRM database, which we will call civicrm
, with this command:
CREATE DATABASE civicrm;
Next, we will assign permissions on this database to a new user with a password we choose:
GRANT ALL ON civicrm.* TO [email protected] IDENTIFIED BY 'password';
Now, implement the changes and exit out of the MySQL prompt with these commands:
FLUSH PRIVILEGES;
exit
Run the Installation Script
Next, we will actually go through the CiviCRM install script. Access this by going to the following URL:
http://your_domain_or_IP_address/sites/all/modules/civicrm/install/index.php
You will see a lot of red on the page initially because we haven't inputted our data yet.
Fill out the credentials to the CiviCRM database and the Drupal Database.
When you are finished, click on the "Re-check requirements" button. You should see green banners telling you that everything is ready.
If you want some sample data, be sure to check the "Load sample data" check box. Click the "Check Requirements and Install CiviCRM" button.
You will get a page that looks like this:
You can access CiviCRM through a link in the left-hand navigation menu of the site:
Joomla!
Another popular CMS is Joomla!. The installation procedures for Joomla on Ubuntu 12.04 are located here. Make sure you are substituting the most recent version of Joomla in the instructions.
Download and Install the CiviCRM Package
When you have Joomla installed, go ahead and download the CiviCRM Joomla package onto your server with the following commands:
cd /var/www/tmp
wget http://downloads.sourceforge.net/project/civicrm/civicrm-stable/4.3.5/civicrm-4.3.5-joomla.zip
We will need to install the "unzip" utility to unzip the archive:
sudo apt-get install unzip
Unzip the file with this command:
unzip civicrm-4.3.5-joomla.zip
Go to the web root and ensure that the web user has write access:
cd /var/www
chown -R www-data *
Install CiviCRM within Joomla
Go to the site administration page at:
domain_name_or_IP_address/administrator
Log in with your administrator credentials.
Click on "Extensions" in the top navigation bar and click "Extension Manager".
In the "Install from Directory" field, enter the path to the CiviCRM directory we extracted:
/var/www/tmp/com_civicrm
Click "Install". You should see a confirmation page that will verify that CiviCRM was installed correctly.
WordPress
WordPress can also be configured to work with CiviCRM. Click here to learn how to install WordPress on Ubuntu 12.04.
Download and Install the CiviCRM Archive
When you are ready, we will download the CiviCRM archive to the plugins directory within WordPress. We need to allow write permissions to this folder for the time being:
sudo chmod 777 /var/www/wp-content/plugins/
cd /var/www/wp-content/plugins/
wget http://downloads.sourceforge.net/project/civicrm/civicrm-stable/4.3.5/civicrm-4.3.5-wordpress.zip
Create a directory called "files" and make it writable.
mkdir files
chmod 777 files
Install the "unzip" utility to allow us to extract the archive:
sudo apt-get install unzip
Unzip the file with this command:
unzip civicrm-4.3.5-wordpress.zip
Give the web user ownership of all of the new files like this:
sudo chown -R www-data:www-data *
Configure MySQL
We need to create a separate CiviCRM database within MySQL. Log into MySQL with the root user:
mysql -u root -p
You will be given a MySQL prompt. Create a CiviCRM database:
CREATE DATABASE civicrm;
Create a user and password and assign it privileges to the database with this command:
GRANT ALL ON civicrm.* TO [email protected] IDENTIFIED BY 'password';
Implement the changes and exit out of MySQL with the following commands:
FLUSH PRIVILEGES;
exit
Configure the Plugin Within WordPress
Visit your WordPress site. Log in as the administrator user you created during setup.
Click on the "Plugins" section in the left-hand menu.
You should see the "CiviCRM" row within the page. Click on "Activate".
Next, go to the "Settings" section on the left-hand menu. Click on the "CiviCRM Installer" sub-menu.
You should be given a page with a lot of red. This is because we haven't given our CiviCRM database information yet.
Fill in the CiviCRM database settings section. If you would like to populate some sample data, check the "Load sample data" check box.
When you are ready, click "Re-Check requirements". Everything should be green.
Click the "Check Requirements and Install CiviCRM" button.
Finishing Up
Once you have CiviCRM installed on your server, there are still a few important tasks that you should complete.
First, you should import the existing users of your CMS. This will ensure that your CMS users also have CiviCRM profiles, so that you can easily track them.
Access CiviCRM through the method provided by your CMS. Click on the "Administer" heading. Navigate to "Users and Permissions" and then to "Synchronize Users to Contacts".
This will import your CMS user data into the CiviCRM database.
Next, you will want to review the included "Configuration Checklist". You can get there by clicking the "Administer" heading and then selecting the "Administration Console".
Go through each of the linked items and configure your system to match your needs.
Conclusion
You should now have the CiviCRM suite of tools installed on your server. You will be able to manage the contacts for your site or organization easily.