How to Install SugarCRM Community Edition on an Ubuntu 14.04 VPS

sugarcrm vpsSugarCRM Community Edition is an open source and web based customer relationship management (CRM) software. It provides many functions such as activity management, contacts, accounts, campaigns, web-to-lead forms, dashboards, email clients and marketing, project management, bug tracking, shared calendars etc. that allow maximum management for business and client relationships.
In this tutorial we will show you how to install SugarCRM Community Edition on an Ubuntu VPS in less than 5 minutes.

Download the latest version of SugarCRM Community Edition available at to the ‘/opt’ directory on the server. Then, extract it and move the SugarCRM files and directories to the ‘/var/www/html/sugar’ directory. At the time of writing this tutorial, the latest stable version of SugarCRM Community Edition is 6.5.20.

cd /opt/
wget -O
mv SugarCE-Full-6.5.20 /var/www/html/sugar

SugarCRM Community Edition requires:

  • PHP with bcmath, cURL, GD graphics library, hash, IMAP, JSON, mbstring, MySQLi, openSSL, SimpleXML, ZIP and ZLIB PHP extensions enabled.
  • Apache Web Server >= 2.x+
  • MySQL >= 5.x installed on your Linux VPS.

Update your OS package lists and install the software updates using the following commands:

apt-get update
apt-get upgrade

Install PHP and required PHP modules:

apt-get install php5 php5-cli php5-common php5-dev php5-mysql php5-curl php5-gd php-pear php5-imap php5-mcrypt php5-xmlrpc php5-xsl

In order to improve performance, it is recommended to have JSMin PHP extension installed on your server. The JSMin PHP extension can be installed using the pecl command:

pecl install jsmin

Edit the php.ini configuration file and add ‘’ to it:

vi /etc/php5/apache2/php.ini

Also, add/modify the following settings:

post_max_size = 32M
upload_max_filesize = 32M
memory_limit = 768M

InboundEmail and Campaigns (Email) require the IMAP libraries, so enable the IMAP module:

sudo php5enmod imap

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘sugar.conf’:

touch /etc/apache2/sites-available/sugar.conf
ln -s /etc/apache2/sites-available/sugar.conf /etc/apache2/sites-enabled/sugar.conf
vi /etc/apache2/sites-available/sugar.conf

then, add the following lines:

<VirtualHost *:80>
   DocumentRoot /var/www/html/sugar/
   <Directory /var/www/html/sugar/>
      Options FollowSymLinks
      AllowOverride All
   ErrorLog /var/log/apache2/
   CustomLog /var/log/apache2/ common

Restart the Apache web server for the changes to take effect:

service apache2 restart

The following files and directories inside the ‘/var/www/html/sugar/’ directory need to be writable from your web server:

'cache' and all subdirectories and files
'custom' and all subdirectories and files
'data' and all subdirectories and files
'modules' and all subdirectories and files

This can easily be accomplished by executing the following command:

chown www-data:www-data -R /var/www/html/sugar/

Create a new MySQL database named ‘sugarcrm’ on your server:

mysql -u root -p
mysql> CREATE DATABASE sugarcrm;
mysql> CREATE USER sugar@localhost;
mysql> SET PASSWORD FOR 'sugar'@'localhost' = PASSWORD("sugar-password");
mysql> GRANT ALL PRIVILEGES ON sugarcrm.* TO 'sugar'@'localhost' IDENTIFIED BY 'sugar-password' WITH GRANT OPTION;
mysql> quit

Do not forget to change ‘sugar-password’ with a strong password for your ‘sugar’ MySQL user.

Open in your favorite web browser and follow the easy instructions.

In order to run Sugar Schedulers, add the following line to the crontab file:

*    *    *    *    *     cd /var/www/html/sugar; php -f cron.php > /dev/null 2>&1

That is it. The SugarCRM installation is now complete. Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install SugarCRM for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Install and setup SpamAssassin in Debian 6 (Squeeze)
How to Install the Ghost blogging platform on Debian Wheezy with Nginx
Install Octopress on a CentOS 6 VPS
  • johan


    Author Reply

    am getting a package is not available error when trying to Install PHP and required PHP modules. Any advice? thanks

    • admin


      Author Reply

      What version of Ubuntu are you using? You can try to use ‘php’ instead of ‘php5’ and see if that solves your problem.