Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Install OroCRM on CentOS 7

How to Install OroCRM on CentOS 7

In this tutorial, we will provide you a detailed instruction on how to Install OroCRM Community Edition, on CentOS 7.OroCRM is a free and open source CRM software. It is very flexible, easy to use, and it can integrate with other softwares like Magento. It cames with buil-in automation tools for marketing your eCommerce business. OroCRM is complete CRM solutions for both sales and marketing. Let’s get started with the installation of OroCRM on your Ubuntu 16.04 Virtual Server

Install Nginx, run and enable it on boot.

In this tutorial, we will use Nginx with PHP-FPM and PHP 7.1, we have to use PHP version higher than 7.0 to install OroCRM

sudo yum -y install nginx
sudo systemctl start nginx
sudo systemctl enable nginx

We will use Remi repository to install the latest builds of PHP 7. First, we have to add and enable the repository.

sudo rpm -Uvh
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php71

Install PHP 7.1 with the required modules

sudo yum -y install php php-fpm php-ctype php-curl php-intl php-json php-mbstring php-mcrypt php-fileinfo php-gd php-tokenizer php-xml php-mysql php-pcre php-simplexml php-zip php-posix php-tidy php-soap php-opcache

Edit the default PHP configuration file.

sudo nano /etc/php.ini

Increase memory limit and change your timezone value

date.timezone = America/Los_Angeles
memory_limit = 512M

Edit the PHP-FPM configuration file.

sudo nano /etc/php-fpm.d/www.conf

We will change php-fpm default configuration, its user and group, and the listening port to Unix socket file.

user = nginx
group = nginx

;listen =

Comment out or remove the above line and add the following line.

listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nobody = nobody

Start PHP-FPM and enable it to start at boot.

sudo systemctl start php-fpm
sudo systemctl enable php-fpm

Change the ownership of PHP-FPM socket file to Nginx user.

sudo chown nginx:nginx /var/run/php-fpm/php-fpm.sock

Install MariaDB

sudo yum -y install mariadb mariadb-server

Start MariaDB and enable it at boot.

sudo systemctl start mariadb
sudo systemctl enable mariadb

Then, we need to run mysql_secure_installation script to secure MariaDB Server.

sudo mysql_secure_installation

In this step, you will be asked for the current MariaDB root password. Then, set a strong password for the root user and answer Y to all the other questions asked thereafter.

Create the Database for OroCRM

Log in to the MySQL shell as the root user by running.

mysql -u root -p

You will be asked for MariaDB root password you created earlier.

Run the following queries to create a database and a database user for OroCRM installation.

GRANT ALL PRIVILEGES ON orocrm_db.* TO 'orocrm_user'@'localhost' IDENTIFIED BY 'ModifyThisPassword';;

Make sure to change ModifyThisPassword to a very strong and hard to guess password.

Install Node.js, Git and Composer

sudo curl --silent --location | sudo bash -

sudo yum -y install nodejs git

Install Composer.

sudo curl -sS | php

Move Composer to the /usr/bin directory so that it can be executed from anywhere in the system.

sudo mv composer.phar /usr/bin/composer

Provide execution permission to the Composer.

sudo chmod +x /usr/bin/composer

Install OroCRM

There are many ways to download OroCRM (, the most appropriate way to get the most updated version is to clone the repository through Git.

cd /usr/share/nginx/
sudo git clone -b 2.6.1 orocrm

Copy the example parameters file to the default parameters file used by OroCRM.

cd orocrm
sudo cp app/config/parameters.yml.dist app/config/parameters.yml

next step is to  update the parameters.yml file to provide database configuration.

sudo nano app/config/parameters.yml

Find the following lines.

database_driver: pdo_mysql
database_port: ~
database_name: orocrm
database_user: root
database_password: ~

Update the above configuration according to the database you have created to store OroCRM data. In our case, it should look like this.

database_driver: pdo_mysql
database_port: 3306
database_name: orocrm_db
database_user: orocrm_user
database_password: ModifyThisPassword

If you have an SMTP server and you wish to use email sending feature, you can update the mailer settings.
You can also skip it by leaving the existing values. You can always change email configuration through the dashboard.

Set a random string in secret by replacing ThisTokenIsNotSoSecretChangeIt.

secret: mlDVXWO7QbGmwVz98Rq3TrKMNJQuTuwtrIs3RKWfjJuluI4N7ClrJmr6ksuw6cEU

You can generate a random string using the pwgen utility.
To generate a random string, run

pwgen -s 64 1

If you don’t have pwgen, you can install the utility by running

sudo yum install pwgen -y

Save the file and exit from the editor.

Install the required PHP dependencies through composer.

sudo composer install --prefer-dist --no-dev

–no-dev means that the Composer will only install the dependencies required to run the web server in production mode.
Install the application.

sudo php app/console oro:install --env=prod --timeout=600

This will build the web cache and write the database. The installation will only proceed if all required dependencies are installed.

During the installation, you will be asked few questions for setting up the administrator account. The questions are as follows.

Administration setup.
Application URL (http://localhost):
Organization name (OroCRM): My Organization
Username (admin):
Email: [email protected]
First name: John
Last name: Doe
Load sample data (y/n): y

Provide the information. Load the sample data to evaluate the product before using it for production.

Warm up the API documentation cache:

sudo php app/console oro:api:doc:cache:clear

Configure Nginx

Create an Nginx server block file to serve the application to the users.

sudo nano /etc/nginx/conf.d/orocrm.yourdomain.conf
server {
root /usr/share/nginx/orocrm/web;

location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;

location ~ ^/(app|app_dev|config|install)\.php(/|$) {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;

# Enable Gzip compression
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 5;
gzip_disable "msie6";
gzip_min_length 1000;
gzip_http_version 1.0;
gzip_proxied any;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css image/svg+xml;
gzip_vary on;

# enable browser caching
location ~* \.(?:css|js) {
expires 1w;
access_log off;
add_header Cache-Control public;

location ~* \.(?:jpg|jpeg|gif|png|ico|tiff|woff|eot|ttf|svg|svgz|mp4|ogg|ogv|webm|swf|flv)$ {
expires 3w;
access_log off;
add_header Cache-Control public;

error_log /var/log/nginx/orocrm_error.log;
access_log /var/log/nginx/orocrm_access.log;

Make sure that you change the with your actual domain name.

Check the Nginx configuration file for any errors.

sudo nginx -t

Make sure you don’t see any error messages.

Provide the ownership of the OrOCRM files to the Nginx user.

sudo chown -R nginx: /usr/share/nginx/orocrm

Restart Nginx to apply the new configuration.

sudo systemctl restart nginx

Setup Scheduled Tasks and Background Jobs
To automatically run the scheduled tasks you can add a Cron job entry. Open crontab.

sudo crontab -e

Add the following line to the file.

*/1 * * * * /usr/bin/php /usr/share/nginx/orocrm/app/console oro:cron --env=prod > /dev/null

This will run the cron job every minute so that the scheduled tasks such as email queues are processed earliest.

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.

Install Supervisor

sudo yum -y install supervisor

Edit the Supervisor configuration file

sudo nano /etc/supervisord.conf

Add the following lines at the end of the file

command=/usr/bin/php /usr/share/nginx/orocrm/app/console --env=prod --no-debug oro:message-queue:consume

Start and enable Supervisor to automatically start at boot time.

sudo systemctl enable supervisord
sudo systemctl start supervisord

OroCRM is now installed on your server at Log in using the administrator username and password you have set earlier during the installation. To learn more about OroCRM, you can visit its official website.

PS. If you liked this post, on how to install OroCRM on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

This post first appeared on Virtual Server, please read the originial post: here

Share the post

How to Install OroCRM on CentOS 7


Subscribe to Virtual Server

Get updates delivered right to your inbox!

Thank you for your subscription