OroCRM is a free and open source Customer Relationship Manager (CRM) application built on OroPlatform. OroPlatform is fully customizable open source business application platform software. OroPlatform provides you with all the features that are required to create a customized application. OroCRM is built using PHP Symfony framework and stores its data into the MySQL\/MariaDB database server. It is an enterprise-ready CRM application providing tons of features. It also integrates with many 3rd party applications such as Magento Store, MailChimp, Zendesk etc. It is multilingual and has a fully responsive user interface, which provides you with the capability to manage it using mobile devices also.<\/p>\n\n\n\n
In this tutorial, we will use\u00a0 OroCRM can be installed on any production web server supporting PHP. OroCRM supports all versions of PHP greater than 7.0. In this tutorial, we will use Nginx with PHP-FPM and PHP 7.1.<\/p>\n\n\n\n Install Nginx.<\/p>\n\n\n\n Start Nginx and enable it to automatically start at boot.<\/p>\n\n\n\n PHP 7 is not available in the default YUM repository, but we can use the Remi repository to obtain and install the latest builds of PHP 7. First, add and enable the Remi repository.<\/p>\n\n\n\n Install the latest version of PHP 7 along with the PHP modules required by OroCRM.<\/p>\n\n\n\n Edit the default PHP configuration file.<\/p>\n\n\n\n Find the following lines. Uncomment and make changes as shown.<\/p>\n\n\n\n Edit the PHP-FPM configuration file.<\/p>\n\n\n\n By default, PHP-FPM is configured to run with Apache and to listen to the port Start PHP-FPM and enable it to start at boot.<\/p>\n\n\n\n Provide ownership of PHP-FPM socket file to Nginx user.<\/p>\n\n\n\n MariaDB is an open source fork of MySQL. Install MariaDB.<\/p>\n\n\n\n Start MariaDB and enable it to automatically start at boot.<\/p>\n\n\n\n The default installation of MariaDB comes with a few test databases and anonymous users. Before configuring the database, you will need to secure the MariaDB server first. You can secure it by running the You will be asked for the current MariaDB root password. By default, there is no root password in a fresh MariaDB installation. Press the Log in to the MySQL shell as the root user by running.<\/p>\n\n\n\n Provide the password for the MariaDB root user to log in.<\/p>\n\n\n\n Run the following queries to create a database and a database user for OroCRM installation.<\/p>\n\n\n\n You can replace the database name OroCRM also requires Node.js JavaScript runtime. Node.js will be used by OroCRM to compile the JavaScript, which is used to build the user interface of the application. The default repository of CentOS contains an outdated version of Node.js, thus you will need to add the Nodesource repository to your system to obtain the latest version.<\/p>\n\n\n\n Install Node.js and Git.<\/p>\n\n\n\n Git will be used to clone the OroCRM repository from the internet. You will also need to install Composer. Composer is a dependency manager tool for PHP applications. Because OroCRM is written in Symfony framework, you will need Composer to install the dependencies and application.<\/p>\n\n\n\n Install Composer.<\/p>\n\n\n\n Move Composer to the Provide execution permission to the Composer.<\/p>\n\n\n\n There are many ways to download OroCRM on your server. The most appropriate way to get the most updated version is to clone the repository through Git.<\/p>\n\n\n\n Clone the OroCRM repository.<\/p>\n\n\n\n Copy the example Before you can proceed further, you will need to update the Find the following lines.<\/p>\n\n\n\n Update the above configuration according to the database you have created to store OroCRM data. In our case, it should look like this.<\/p>\n\n\n\n If you have an SMTP server ready and you wish to use email sending features immediately, you can update the mailer settings as shown.<\/p>\n\n\n\n If you do not have a mail server ready, you can skip it for now by leaving the existing values. You can always change email configuration through the dashboard.<\/p>\n\n\n\n Set a random string in You can generate a random string using the Save the file and exit from the editor. Install the required PHP dependencies through composer.<\/p>\n\n\n\n Using Install the application.<\/p>\n\n\n\n This will build the web cache and write the database. The During the installation, you will be asked few questions for setting up the administrator account. The questions are as follows.<\/p>\n\n\n\n Provide the information. Load the sample data to evaluate the product before using it for production.<\/p>\n\n\n\n Warm up the API documentation cache:<\/p>\n\n\n\n Create an Nginx server block file to serve the application to the users.<\/p>\n\n\n\n Populate the file.<\/p>\n\n\n\n Make sure that you change the Check the Nginx configuration file for any errors.<\/p>\n\n\n\n The output should look like the following.<\/p>\n\n\n\n Provide the ownership of the OrOCRM files to the Nginx user.<\/p>\n\n\n\n Restart Nginx to apply the new configuration.<\/p>\n\n\n\n If you are running a firewall on your server, you will need to configure the firewall to set an exception for HTTP service. Allow Nginx to connect from outside the network.<\/p>\n\n\n\n You can now access the application at To automatically run the scheduled tasks you can add a Cron job entry. Open Add the following line to the file.<\/p>\n\n\n\n This will run the cron job every minute so that the scheduled tasks such as email queues are processed earliest.<\/p>\n\n\n\n You will also need to setup Supervisor to run the Message Queue service. It is required that at least one process is running at all times for a consumer to process the messages. A consumer can normally interrupt the message process through many ways. To ensure that the service is running continuously, we will use the Supervisor service. We will configure Supervisor to run four processes in parallel. If any of the four processes is stopped for any reason, the Supervisor will try to start it again.<\/p>\n\n\n\n Install Supervisor.<\/p>\n\n\n\n Edit the Supervisor configuration file.<\/p>\n\n\n\n Add the following lines at the end of the file.<\/p>\n\n\n\n Start and enable Supervisor to automatically start at boot time.<\/p>\n\n\n\n You can view the status of the processes by running the following.<\/p>\n\n\n\n You should see that the processes are running.<\/p>\n\n\n\n OroCRM is now installed on your server. You can now use the application to manage the routine tasks of your organization. To learn more about OroCRM, you can visit its\u00a0official website<\/strong><\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[242,245,587],"manual_kb_tag":[615,616,647,649,651,654],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3838"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=3838"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3838\/revisions"}],"predecessor-version":[{"id":3839,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/3838\/revisions\/3839"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=3838"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=3838"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=3838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}crm.example.com<\/code>\u00a0as the domain name pointed to the server. Replace all occurrences of\u00a0
crm.example.com<\/code>\u00a0with your actual domain name.<\/p>\n\n\n\n
Install Nginx and PHP 7<\/h2>\n\n\n\n
sudo yum -y install nginx<\/code><\/pre>\n\n\n\n
sudo systemctl start nginx\nsudo systemctl enable nginx<\/code><\/pre>\n\n\n\n
sudo rpm -Uvh http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\nsudo yum -y install yum-utils\nsudo yum-config-manager --enable remi-php71<\/code><\/pre>\n\n\n\n
sudo yum -y install php php-fpm php-ctype php-curl php-fileinfo php-gd php-intl php-json php-mbstring php-mcrypt php-mysql php-pcre php-simplexml php-tokenizer php-xml php-zip php-tidy php-soap php-opcache php-posix<\/code><\/pre>\n\n\n\n
sudo nano \/etc\/php.ini<\/code><\/pre>\n\n\n\n
date.timezone = Asia\/Kolkata\n;Replace \"Asia\/Kolkata\" with your appropriate timezone\n \nmemory_limit = 512M\ncgi.fix_pathinfo=0<\/code><\/pre>\n\n\n\n
sudo nano \/etc\/php-fpm.d\/www.conf<\/code><\/pre>\n\n\n\n
9000<\/code>. We will need to change the user and group, as well as the Unix socket file on which it will run. Find the following lines and make necessary changes as shown.<\/p>\n\n\n\n
user = nginx\ngroup = nginx\n\n;listen = 127.0.0.1:9000\n;Comment out or remove the above line and add the following line.\nlisten = \/var\/run\/php-fpm\/php-fpm.sock\n\nlisten.owner = nobody\nlisten.group = nobody<\/code><\/pre>\n\n\n\n
sudo systemctl start php-fpm\nsudo systemctl enable php-fpm<\/code><\/pre>\n\n\n\n
sudo chown nginx:nginx \/var\/run\/php-fpm\/php-fpm.sock<\/code><\/pre>\n\n\n\n
Install MariaDB<\/h2>\n\n\n\n
sudo yum -y install mariadb mariadb-server<\/code><\/pre>\n\n\n\n
sudo systemctl start mariadb\nsudo systemctl enable mariadb<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code> script.<\/p>\n\n\n\n
sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n
Enter<\/code> key to proceed. Set a strong password for the root user of your MariaDB server and answer
Y<\/code> to all the other questions asked. The questions asked are self-explanatory.<\/p>\n\n\n\n
Create the Database for OroCRM<\/h3>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
CREATE DATABASE oro_data;\nCREATE USER 'oro_user'@'localhost' IDENTIFIED BY 'StrongPassword';\nGRANT ALL PRIVILEGES ON oro_data.* TO 'oro_user'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n\n\n\n
oro_data<\/code> and username
oro_user<\/code> according to your choice. Be sure to change
StrongPassword<\/code> to a very strong password.<\/p>\n\n\n\n
Install Node.js and Composer<\/h2>\n\n\n\n
sudo curl --silent --location https:\/\/rpm.nodesource.com\/setup_8.x | sudo bash -<\/code><\/pre>\n\n\n\n
sudo yum -y install nodejs git<\/code><\/pre>\n\n\n\n
php -r \"copy('https:\/\/getcomposer.org\/installer', 'composer-setup.php');\"\nphp composer-setup.php\nphp -r \"unlink('composer-setup.php');\"<\/code><\/pre>\n\n\n\n
\/usr\/bin<\/code> directory so that it can be executed from anywhere in the system.<\/p>\n\n\n\n
sudo mv composer.phar \/usr\/bin\/composer<\/code><\/pre>\n\n\n\n
sudo chmod +x \/usr\/bin\/composer<\/code><\/pre>\n\n\n\n
Install OroCRM<\/h2>\n\n\n\n
cd \/usr\/share\/nginx\/\nsudo git clone -b 2.3 https:\/\/github.com\/oroinc\/crm-application.git orocrm<\/code><\/pre>\n\n\n\n
parameters<\/code> file to the default
parameters<\/code> file used by OroCRM.<\/p>\n\n\n\n
cd orocrm\nsudo cp app\/config\/parameters.yml.dist app\/config\/parameters.yml<\/code><\/pre>\n\n\n\n
parameters.yml<\/code> file to provide database and email information.<\/p>\n\n\n\n
sudo nano app\/config\/parameters.yml<\/code><\/pre>\n\n\n\n
database_driver: pdo_mysql\ndatabase_host: 127.0.0.1\ndatabase_port: ~\ndatabase_name: oro_crm\ndatabase_user: root\ndatabase_password: ~<\/code><\/pre>\n\n\n\n
database_driver: pdo_mysql\ndatabase_host: 127.0.0.1\ndatabase_port: 3306\ndatabase_name: oro_data\ndatabase_user: oro_user\ndatabase_password: StrongPassword<\/code><\/pre>\n\n\n\n
mailer_transport: smtp\nmailer_host: mail.example.com\nmailer_port: 456\nmailer_encryption: ssl\nmailer_user: mails@example.com\nmailer_password: EMailPassword<\/code><\/pre>\n\n\n\n
secret<\/code> by replacing
ThisTokenIsNotSoSecretChangeIt<\/code>. A random string is required to encode the session data. An example string will look like this.<\/p>\n\n\n\n
secret: uxvpXHhDxCFc9yU1hV1fMwjSoyVUzGh4WBMBBBa3XEgrRUF5OuB2h8iNl9JRDqcd<\/code><\/pre>\n\n\n\n
pwgen<\/code> utility. Install
pwgen<\/code> utility by running
sudo yum -y install pwgen<\/code>. To generate a random string, run
pwgen -s 64 1<\/code>.<\/p>\n\n\n\n
sudo composer install --prefer-dist --no-dev<\/code><\/pre>\n\n\n\n
--no-dev<\/code> will ensure that the Composer only installs the dependencies required to run the web server in production mode. The script will take a few minutes to download and install the required PHP dependencies.<\/p>\n\n\n\n
sudo php app\/console oro:install --env=prod<\/code><\/pre>\n\n\n\n
--env=prod<\/code> parameter is provided to install the application in production mode. The installation will only proceed if all the required dependencies are installed and configured.<\/p>\n\n\n\n
Administration setup.\nApplication URL (http:\/\/localhost): http:\/\/crm.example.com\nOrganization name (OroCRM): My Organization\nUsername (admin):\nEmail: mail@example.com\nFirst name: John\nLast name: Doe\nPassword:\nLoad sample data (y\/n): y<\/code><\/pre>\n\n\n\n
sudo php app\/console oro:api:doc:cache:clear<\/code><\/pre>\n\n\n\n
Configuring Nginx, Firewall and Permissions<\/h2>\n\n\n\n
sudo nano \/etc\/nginx\/conf.d\/orocrm.conf<\/code><\/pre>\n\n\n\n
server {\n server_name crm.example.com;\n root \/usr\/share\/nginx\/orocrm\/web;\n\n location \/ {\n # try to serve file directly, fallback to app.php\n try_files $uri \/app.php$is_args$args;\n }\n\n location ~ ^\/(app|app_dev|config|install)\\.php(\/|$) {\n fastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.sock;\n fastcgi_split_path_info ^(.+\\.php)(\/.*)$;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_param HTTPS off;\n }\n\n # Enable Gzip compression\n gzip on;\n gzip_buffers 16 8k;\n gzip_comp_level 5;\n gzip_disable \"msie6\";\n gzip_min_length 1000;\n gzip_http_version 1.0;\n gzip_proxied any;\n gzip_types text\/plain application\/javascript application\/x-javascript text\/javascript text\/xml text\/css image\/svg+xml;\n gzip_vary on; \n\n # Enable browser caching\n # One week for javascript and css\n location ~* \\.(?:css|js) {\n expires 1w;\n access_log off;\n add_header Cache-Control public;\n }\n\n # Three weeks for media: images, fonts, icons, video, audio etc.\n location ~* \\.(?:jpg|jpeg|gif|png|ico|tiff|woff|eot|ttf|svg|svgz|mp4|ogg|ogv|webm|swf|flv)$ {\n expires 3w;\n access_log off;\n add_header Cache-Control public;\n }\n\n error_log \/var\/log\/nginx\/orocrm_error.log;\n access_log \/var\/log\/nginx\/orocrm_access.log;\n}<\/code><\/pre>\n\n\n\n
crm.example.com<\/code> with your actual domain name. The above configuration also includes the configuration required for GZip compression and browser caching. Gzip compression compresses the data before sending it to the browser. Enabling browser caching stores the static resources to the web cache of the client computer. The next time the user accesses the site, most of the static content is loaded from the user’s own web cache. These two methods increase the speed of the application dramatically.<\/p>\n\n\n\n
sudo nginx -t<\/code><\/pre>\n\n\n\n
[user@aklwebhost ~]$ sudo nginx -t\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n\n\n\n
sudo chown -R nginx:nginx \/usr\/share\/nginx\/orocrm<\/code><\/pre>\n\n\n\n
sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n
sudo firewall-cmd --zone=public --permanent --add-service=http\nsudo firewall-cmd --zone=public --permanent --add-service=https\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n
http:\/\/crm.example.com<\/code>. Log in using the administrator username and password you have set during installation.<\/p>\n\n\n\n
Setup Scheduled Tasks and Background Jobs<\/h2>\n\n\n\n
crontab<\/code>.<\/p>\n\n\n\n
sudo crontab -e<\/code><\/pre>\n\n\n\n
*\/1 * * * * \/usr\/bin\/php \/usr\/share\/nginx\/orocrm\/app\/console oro:cron --env=prod > \/dev\/null<\/code><\/pre>\n\n\n\n
sudo yum -y install supervisor<\/code><\/pre>\n\n\n\n
sudo nano \/etc\/supervisord.conf<\/code><\/pre>\n\n\n\n
[program:oro_message_consumer]\ncommand=\/usr\/bin\/php \/usr\/share\/nginx\/orocrm\/app\/console --env=prod --no-debug oro:message-queue:consume\nprocess_name=%(program_name)s_%(process_num)02d\nnumprocs=4\nautostart=true\nautorestart=true\nstartsecs=0\nuser=nginx\nredirect_stderr=true<\/code><\/pre>\n\n\n\n
sudo systemctl start supervisord\nsudo systemctl enable supervisord<\/code><\/pre>\n\n\n\n
sudo supervisorctl status<\/code><\/pre>\n\n\n\n
[user@aklwebhost ~]$ sudo supervisorctl status\noro_message_consumer:oro_message_consumer_00 RUNNING pid 13596, uptime 0:02:13\noro_message_consumer:oro_message_consumer_01 RUNNING pid 13595, uptime 0:02:13\noro_message_consumer:oro_message_consumer_02 RUNNING pid 13594, uptime 0:02:13\noro_message_consumer:oro_message_consumer_03 RUNNING pid 13593, uptime 0:02:13<\/code><\/pre>\n\n\n\n