How do I install OroCRM on Debian 8

Step 1. Clone the OroCRM Git repository

git clone crm


git clone -b 2.1.2 crm

Step 2. Install the «fxp/composer-asset-plugin» plugin for Composer

composer global require "fxp/composer-asset-plugin"

Step 3. composer install

cd crm && composer install

The installation script will request some options from you:

Step 4. The temporary HTTP-only Nginx config for the Let’s Encrypt challenge

server {
	listen 80;
	root /var/www/crm/web;
	# 2017-04-29 For Let's Encrypt:
	location ~ /.well-known {allow all;}
	location / {try_files $uri /app.php$is_args$args;}
	location ~ ^/(app|app_dev|config|install|phpinfo)\.php(/|$) {
		fastcgi_split_path_info ^(.+\.php)(/.*)$;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
service nginx restart

Step 5. The Let’s Encrypt challenge

How do I install Let’s Encrypt on Debian 8.

If the Let’s Encrypt challenge was run by the root user, then I adjust the permissions:

cd /var/www/crm/web/.well-known && chgrp www-data . && chown www-data .

Step 6. The permament (HTTPS / WSS) Nginx config

My Nginx configuration for OroCRM (it features PHP-FPM, Ratchet Websocket server, SSL/TLS, Lets’Encrypt).

Step 7. Adjust the PHP interpreter

How to configure PHP for OroCRM?

Step 8. Create the database (with the name specified on the Step 3)

mysql -e "CREATE DATABASE crm;"

Step 9. app/console oro:install --env=prod --timeout=0

The --timeout=0 undocumented key preserves you from the «The process “’/usr/bin/php7.1’ ‘app/console’ ‘oro:migration:load’ ‘–force’ ‘–timeout=300’ ‘–env=prod’” exceeded the timeout of 300 seconds» failure.

You will be asked for some settings:

Step 10. app/console oro:api:doc:cache:clear

Step 11. Setup Cron

*/1 * * * * www-data php /var/www/crm/app/console oro:cron --env=prod > /dev/null

Step 12. Install and setup Supervisor

How do I install and setup Supervisor for OroCRM?

Step 13. Add this patch to the websocket code, and then delete the cache

The job is done!

See also: