Install ORO Commerce 6.0/6.1 on Ubuntu 24.04 locally or remote.
OroCommerce is an exceptional B2B eCommerce platform and a compelling alternative to legacy Magento 2. Since Adobe’s acquisition and the transition of Magento(Adobe Commerce) to a SaaS-based model, many developers and merchants have been actively seeking a new platform that offers flexibility, control, and robust features. OroCommerce stands out as one of the best replacements.
Created by Magento co-founders Yoav Kutner and Dima Soroka, along with other original Magento core team members, OroCommerce inherits the architectural strengths of Magento while addressing its limitations. The platform is built from the ground up on the modern Symfony PHP framework, offering a clean, modular architecture that aligns with current development best practices.
Functionally, OroCommerce mirrors many of Magento 2’s capabilities while adding improvements in scalability, B2B-specific features, and developer experience. It feels like a natural evolution — what some might call “Magento 3” — modernized and reimagined for today’s eCommerce needs.
If you’re looking for a future-proof, open-source eCommerce solution rooted in the Magento heritage but designed for the modern era, OroCommerce is well worth exploring.
Regular ORO Stack is:
- PHP 8.3+
- Nginx/Apach/Symfony Server
- PostgreSQL(MySQL is retired and not supported anymore)
- RebbitMQ(For Enterprise)
- Elastic Search
- Redis
- NodeJS
- WebSockets
Official Documentation has installation steps:
Set up Environment for OroPlatform Based Application on Ubuntu 20.04
This guide demonstrates how to set up Docker and Symfony Server development stack for Oro applications on Ubuntu 20.04 LTS.
Environment Setup
Install php 8.4 with all required extensions:
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt -y install php8.4 php8.4-fpm php8.4-cli php8.4-pdo php8.4-mysqlnd php8.4-xml php8.4-soap php8.4-gd php8.4-zip php8.4-intl php8.4-mbstring php8.4-opcache php8.4-curl php8.4-bcmath php8.4-ldap php8.4-pgsql php8.4-dev
Install the MongoDB PHP Extension with PECL:
sudo pecl install mongodb-1.15.0
For more information, see MongoDB PHP Extension installation.
echo -e "extension=mongodb.so \n\nmemory_limit = 2048M \nmax_input_time = 600 \nmax_execution_time = 600 \nrealpath_cache_size=4096K \nrealpath_cache_ttl=600 \nopcache.enable=1 \nopcache.enable_cli=0 \nopcache.memory_consumption=512 \nopcache.interned_strings_buffer=32 \nopcache.max_accelerated_files=32531 \nopcache.save_comments=1" | sudo tee -a /etc/php/8.4/fpm/php.ini
echo -e "extension=mongodb.so \n\nmemory_limit = 2048M" | sudo tee -a /etc/php/8.4/cli/php.ini
Install Node.js 22:
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt -y install nodejs
Install Docker and Docker Compose:
sudo apt -y install docker.io docker-compose-plugin
sudo usermod -aG docker $(whoami)
sudo systemctl enable --now docker
Install Composer v2:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/bin/composer
Install Symfony Server and enable TLS:
sudo apt -y install libnss3-tools
wget https://get.symfony.com/cli/installer -O - | bash
echo 'PATH="$HOME/.symfony/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
symfony server:ca:install
Restart the terminal and web browser to get them ready.but it has some pitfalls and requires Docker so I created my steps. I will install on Virtual Box Ubuntu but for Docker or VPS the steps are the same.
Installation Steps
- Step 1: Set Installation variables
- Step 2: PHP installation and Composer
- Step 3: Install PostgreSQL and Database Create
- Step 4: Install and Configuration of the Nginx
- Step 5: Install Redis
- Step 6: Install Node JS and NPM and NVM
- Step 7: Install Elastic Search
- Step 8: Install ORO Commerce
- Step 8.1: Install Oro commerce cloning from GIT
- Step 8.2: Set ORO Commerce DB config
- Step 8.3: Install Composer NPM dependencies
- Step 8.4: Install ORO Commerce itself
Pre-Installation steps we need Git and Python and some other tools:
sudo apt update
sudo apt install -y python3 python3-pip git
sudo apt install -y software-properties-common curl wget unzip nano htopStep 1: Set Installation variables:
Before beginning the installation, several environment-specific configuration variables are defined to control how the ORO Commerce stack is set up:
PHP_VERSION="8.3"
DB_NAME="oro"
DB_USER="postgres"
DB_PASSWORD="postgres"
ORO_DIR="/var/www/html/oro"
ORO_REPO="https://github.com/oroinc/orocommerce-application.git"
ORO_BRANCH="6.0"
ADMIN_USER="admin"
ADMIN_EMAIL="admin@example.com"
ADMIN_FIRSTNAME="Admin"
ADMIN_LASTNAME="Adminenko"
ADMIN_PASSWORD="admin123"
ELASTIC_VERSION="8.x"Check the variables:
echo "========================================"
echo " OroCommerce Installation Parameters"
echo "========================================"
echo "PHP_VERSION = $PHP_VERSION"
echo "DB_NAME = $DB_NAME"
echo "DB_USER = $DB_USER"
echo "DB_PASSWORD = $DB_PASSWORD"
echo "ORO_DIR = $ORO_DIR"
echo "ORO_REPO = $ORO_REPO"
echo "ORO_BRANCH = $ORO_BRANCH"
echo "ADMIN_USER = $ADMIN_USER"
echo "ADMIN_EMAIL = $ADMIN_EMAIL"
echo "ADMIN_FIRSTNAME = $ADMIN_FIRSTNAME"
echo "ADMIN_LASTNAME = $ADMIN_LASTNAME"
echo "ADMIN_PASSWORD = $ADMIN_PASSWORD"
echo "========================================"Step 2: PHP installation and Composer
echo "Install PHP"
sudo apt install -y php${PHP_VERSION} php${PHP_VERSION}-{fpm,cli,mbstring,xml,soap,gd,intl,zip,bcmath,pgsql,ldap,redis,curl,dev,mongodb} \
php_ini_path="/etc/php/${PHP_VERSION}/fpm/php.ini"
cat <<EOF >> "$php_ini_path"
memory_limit = 2048M
max_input_time = 600
max_execution_time = 600
realpath_cache_size=4096K
realpath_cache_ttl=600
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=512
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=32531
opcache.save_comments=1
EOF
echo "Installing Composer..."
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
echo "Composer Version:"
composer -vStep 3: Install PostgreSQL and Database Create:
sudo apt install -y postgresql postgresql-contrib
echo "Creating PostgreSQL database..."
sudo -u postgres psql <<SQL
DROP DATABASE IF EXISTS $DB_NAME;
CREATE DATABASE $DB_NAME;
ALTER USER $DB_USER WITH PASSWORD '$DB_PASSWORD';
\c $DB_NAME
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SQL
echo "Show confirmation details"
sudo -u postgres psql <<SQL
\conninfo
\l $DB_NAME
SELECT datname FROM pg_database WHERE datname = '$DB_NAME';
SELECT rolname FROM pg_roles WHERE rolname = '$DB_USER';
SQLStep 4: Install and Configuration of the Nginx
echo "========================================"
echo " Configuring Nginx for OroCommerce..."
echo "========================================"
sudo apt install nginx -y
sudo rm -f /etc/nginx/sites-enabled/orocommerce
NGINX_CONF_PATH="/etc/nginx/sites-available/orocommerce"
sudo tee /etc/nginx/sites-available/orocommerce > /dev/null <<EOF
server {
listen 80;
server_name localhost;
root /var/www/html/oro/public;
index index.php index.html;
location / {
try_files \$uri /index.php\$is_args\$args;
}
location ~ ^/(index|index_dev|config|install)\\.php(/|$) {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_param HTTPS off;
}
location ~* \\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
access_log off;
expires 1h;
add_header Cache-Control public;
}
error_log /var/log/nginx/orocommerce_error.log;
access_log /var/log/nginx/orocommerce_access.log;
}
EOF
# Enable and link site
sudo ln -sf "$NGINX_CONF_PATH" /etc/nginx/sites-enabled/orocommerce
sudo rm -f /etc/nginx/sites-enabled/default
# Test and reload Nginx
sudo nginx -t
sudo systemctl reload nginxStep 5: Install Redis
sudo apt install redis-server -y
echo "Redis Version:"
echo redis-cli -vStep 6: Install Node JS and NPM and NVM
sudo apt install nodejs npm -y
echo "NodeJs version:"
node -v
# install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
echo "NVM Version:"
nvm -vStep 7: Install Elastic Search:
This is the most difficult part of the script
echo "========================================"
echo " Installing Elasticsearch $ELASTIC_VERSION"
echo "========================================"
# Step 1: Install dependencies
echo "Installing required system packages..."
sudo apt update
sudo apt install -y gnupg apt-transport-https software-properties-common
# Step 2: Add Elasticsearch GPG key
echo "Adding Elasticsearch GPG key..."
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
# Step 3: Add Elasticsearch APT repository
echo "Adding Elasticsearch APT repository..."
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/${ELASTIC_VERSION}/apt stable main" | \
sudo tee /etc/apt/sources.list.d/elastic-${ELASTIC_VERSION}.list
# Step 4: Install Elasticsearch
echo "Updating package lists..."
sudo apt update
echo "Installing Elasticsearch..."
sudo apt install -y elasticsearch
# Step 5: Configure elasticsearch.yml
echo "Configuring Elasticsearch..."
sudo tee -a /etc/elasticsearch/elasticsearch.yml > /dev/null <<EOF
xpack.security.enabled: false
node.name: "node-1"
network.host: 0.0.0.0
http.port: 9200
cluster.name: "my-single-node-cluster"
discovery.type: single-node
EOF
# Step 6: Set JVM heap size to 500MB
echo "Setting JVM heap size to 500MB..."
sudo mkdir -p /etc/elasticsearch/jvm.options.d
sudo tee /etc/elasticsearch/jvm.options.d/heap_size.options > /dev/null <<EOF
-Xms500m
-Xmx500m
EOF
# Step 7: Enable and start Elasticsearch
echo "Enabling and starting Elasticsearch service..."
sudo systemctl daemon-reexec
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
# Step 8: Wait and verify
echo "Waiting for Elasticsearch to start..."
sleep 15
echo "Verifying Elasticsearch installation..."
if curl -s "http://localhost:9200" | grep -q "cluster_name"; then
echo "✅ Elasticsearch installed and responding on port 9200"
else
echo "❌ Failed to verify Elasticsearch is running"
fiAlmost Done!
Step 8: Install ORO Commerce:
Check all services and run them if not active:
echo "🔍 Checking Redis..."
if ! systemctl is-active --quiet redis-server; then
echo "⚠️ Redis is not active. Starting..."
sudo systemctl start redis-server && echo "✅ Redis started." || echo "❌ Failed to start Redis."
else
echo "✅ Redis is running."
fi
echo "🔍 Checking PHP-FPM..."
if ! systemctl is-active --quiet php8.3-fpm; then
echo "⚠️ PHP-FPM is not active. Starting..."
sudo systemctl start php8.3-fpm && echo "✅ PHP-FPM started." || echo "❌ Failed to start PHP-FPM."
else
echo "✅ PHP-FPM is running."
fi
echo "🔍 Checking Elasticsearch..."
if ! systemctl is-active --quiet elasticsearch; then
echo "⚠️ Elasticsearch is not active. Starting..."
sudo systemctl start elasticsearch && echo "✅ Elasticsearch started." || echo "❌ Failed to start Elasticsearch."
else
echo "✅ Elasticsearch is running."
fi
echo "🔍 Checking PostgreSQL..."
if ! systemctl is-active --quiet postgresql; then
echo "⚠️ PostgreSQL is not active. Starting..."
sudo systemctl start postgresql && echo "✅ PostgreSQL started." || echo "❌ Failed to start PostgreSQL."
else
echo "✅ PostgreSQL is running."
fi
echo "🔍 Checking Nginx..."
if ! systemctl is-active --quiet nginx; then
echo "⚠️ Nginx is not active. Starting..."
sudo systemctl start nginx && echo "✅ Nginx started." || echo "❌ Failed to start Nginx."
else
echo "✅ Nginx is running."
fiYou should see something like this :
or just one line to check :
systemctl status redis-server php8.3-fpm elasticsearch postgresql nginx --no-pagerStep 8.1: Install ORO Commerce cloning from GIT:
echo "========================================"
echo " Cloning OroCommerce repository..."
echo "========================================"
sudo rm -rf "$ORO_DIR"
sudo git clone --branch "$ORO_BRANCH" "$ORO_REPO" "$ORO_DIR"
sudo chown -R "$USER":"$USER" "$ORO_DIR"
cd "$ORO_DIR" || { echo "❌ Failed to enter $ORO_DIR";}
ls
echo "✅ Repository cloned."Set correct Node JS version:
Oro Commerce has file (‘/var/www/html/oro/.nvmrc') with the correct Node version simply run:
nvm install && nvm useStep 8.2: Set ORO Commerce DB config
echo "========================================"
echo " Setting environment configuration..."
echo "========================================"
cp .env-app .env.local
sed -i "s|^ORO_DB_DSN=.*|ORO_DB_DSN=pgsql://$DB_USER:$DB_PASSWORD@127.0.0.1:5432/$DB_NAME|" .env.local
sed -i "s|^ORO_DB_DSN=.*|ORO_DB_DSN=pgsql://$DB_USER:$DB_PASSWORD@127.0.0.1:5432/$DB_NAME|" .env-app
echo "✅ .env.local updated."
echo "Checking database connection..."
if php bin/console doctrine:query:sql "SELECT 1" > /dev/null 2>&1; then
echo "✅ Database connection successful!"
else
echo "❌ Failed to connect to the database. Check your ORO_DB_DSN and PostgreSQL service."
fiStep 8.3: Install Composer NPM dependencies:
echo "========================================"
echo " Installing OroCommerce dependencies..."
echo "========================================"
nvm install && nvm use
npm install || { echo "❌ NPM install failed";}
composer install --no-interaction --no-scripts || { echo "❌ Composer failed";}
echo "✅ Dependencies installed."After you will see something like :
Step 8.4: Install ORO Commerce itself:
echo "========================================"
echo " Running OroCommerce installation..."
echo "========================================"
php bin/console oro:install --env=prod \
--user-name="$ADMIN_USER" \
--user-email="$ADMIN_EMAIL" \
--user-firstname="$ADMIN_FIRSTNAME" \
--user-lastname="$ADMIN_LASTNAME" \
--user-password="$ADMIN_PASSWORD" \
--sample-data=y \
--timeout=2000 \
--no-interaction || { echo "❌ OroCommerce installation failed";}
echo "✅ OroCommerce installed."
echo "========================================"
echo " Finalizing setup..."
echo "========================================"
bin/console cache:warmup
npm run build || { echo "❌ NPM build failed";}
php bin/console oro:assets:install --symlink
php bin/console oro:search:reindex
php bin/console cache:clear --env=prod
sudo chown -R www-data:www-data "$ORO_DIR"
sudo chmod -R 755 "$ORO_DIR/var"
echo "✅ Assets, cache, and search index finalized."Restart All Services:
echo "========================================"
echo " Restart essential services..."
echo "========================================"
sudo systemctl restart php${PHP_VERSION}-fpm
sudo systemctl restart nginx
sudo systemctl restart redis-server
sudo systemctl restart postgresql
echo "✅ Services restarted."
echo "========================================"
echo " OroCommerce installation complete!"
echo " Visit: http://localhost"
echo "========================================"That’s it! Done!
Hoover if you are on Virtual Box (or Docker) you need port forwarding 80->8080(or another):
Checking our domain: http://localhost:8080
Checking category page:
Everything works well. If you don’t have product probably you need re-index.
Admin check:
User as you set at the first step:
ADMIN_USER="admin"
ADMIN_PASSWORD="admin123"Everything Works fine and ready fro production:)
We have notice in admin:
The application is not configured properly (message consumers are not available). Please contact the system administrator.
it is ok you need to run :
php bin/console oro:message-queue:consumeAfter running php bin/console oro:message-queue:consume in the background (default behavior), no errors were displayed.
For Persistent Runtime (Recommended) Running oro:message-queue:consume with systemd
Create a systemd Service Unit
Create a new service file:
sudo nano /etc/systemd/system/oro-mq-consumer.servicePaste the following content:
[Unit]
Description=OroCommerce Message Queue Consumer
After=network.target mysql.service postgresql.service
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/var/www/html/oro
ExecStart=/usr/bin/php /var/www/html/oro/bin/console oro:message-queue:consume --env=prod
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=oro-mq-consumer
[Install]
WantedBy=multi-user.targetReload systemd and Start the Service
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable oro-mq-consumer
sudo systemctl start oro-mq-consumerVerify the Service
Check its status:
sudo systemctl status oro-mq-consumerWatch live logs (optional):
journalctl -u oro-mq-consumer -fOptional: Log to File Instead of Syslog
If you prefer logging to a file, modify the [Service] block like so:
StandardOutput=append:/var/log/oro-mq-consumer.log
StandardError=append:/var/log/oro-mq-consumer-error.logIf you find any issue please comment or send me email I will fix it. There is final One-File Script (Gist: https://gist.github.com/Genaker/ff79b20d02ef6d3584c1a06638c50973)
#!/bin/bash
set -euo pipefail
handle_error() {
echo "❌ Installation failed. Check the output above or oro_install.log."
exit 1
}
trap handle_error ERR
echo "========================================"
echo " Setting Installation Variables..."
echo "========================================"
PHP_VERSION="8.3"
DB_NAME="oro"
DB_USER="postgres"
DB_PASSWORD="postgres"
ORO_DIR="/var/www/html/oro"
ORO_REPO="https://github.com/oroinc/orocommerce-application.git"
ORO_BRANCH="6.0"
ADMIN_USER="admin"
ADMIN_EMAIL="admin@example.com"
ADMIN_FIRSTNAME="Admin"
ADMIN_LASTNAME="Adminenko"
ADMIN_PASSWORD="admin123"
ELASTIC_VERSION="7.x"
echo "========================================"
echo " Installing pre-requisite tools..."
echo "========================================"
sudo apt update
sudo apt install -y python3 python3-pip git \
software-properties-common curl wget unzip nano htop
echo "========================================"
echo " OroCommerce Installation Parameters"
echo "========================================"
echo "PHP_VERSION = $PHP_VERSION"
echo "DB_NAME = $DB_NAME"
echo "DB_USER = $DB_USER"
echo "DB_PASSWORD = $DB_PASSWORD"
echo "ORO_DIR = $ORO_DIR"
echo "ORO_REPO = $ORO_REPO"
echo "ORO_BRANCH = $ORO_BRANCH"
echo "ADMIN_USER = $ADMIN_USER"
echo "ADMIN_EMAIL = $ADMIN_EMAIL"
echo "ADMIN_FIRSTNAME = $ADMIN_FIRSTNAME"
echo "ADMIN_LASTNAME = $ADMIN_LASTNAME"
echo "ADMIN_PASSWORD = $ADMIN_PASSWORD"
echo "========================================"
echo "========================================"
echo " Installing PHP and Composer..."
echo "========================================"
sudo apt install -y php${PHP_VERSION} php${PHP_VERSION}-{fpm,cli,mbstring,xml,soap,gd,intl,zip,bcmath,pgsql,ldap,redis,curl,dev,mongodb}
php_ini_path="/etc/php/${PHP_VERSION}/fpm/php.ini"
cat <<EOF | sudo tee -a "$php_ini_path"
memory_limit = 2048M
max_input_time = 600
max_execution_time = 600
realpath_cache_size=4096K
realpath_cache_ttl=600
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=512
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=32531
opcache.save_comments=1
EOF
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
composer -v
echo "========================================"
echo " Installing and configuring PostgreSQL..."
echo "========================================"
sudo apt install -y postgresql postgresql-contrib
sudo -u postgres psql <<SQL
DROP DATABASE IF EXISTS $DB_NAME;
CREATE DATABASE $DB_NAME;
ALTER USER $DB_USER WITH PASSWORD '$DB_PASSWORD';
\c $DB_NAME
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SQL
sudo -u postgres psql <<SQL
\conninfo
\l $DB_NAME
SELECT datname FROM pg_database WHERE datname = '$DB_NAME';
SELECT rolname FROM pg_roles WHERE rolname = '$DB_USER';
SQL
echo "========================================"
echo " Installing and configuring Nginx..."
echo "========================================"
sudo apt install -y nginx
sudo rm -f /etc/nginx/sites-enabled/orocommerce
NGINX_CONF_PATH="/etc/nginx/sites-available/orocommerce"
sudo tee "$NGINX_CONF_PATH" > /dev/null <<EOF
server {
listen 80;
server_name localhost;
root /var/www/html/oro/public;
index index.php index.html;
location / {
try_files \$uri /index.php\$is_args\$args;
}
location ~ ^/(index|index_dev|config|install)\\.php(/|$) {
fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.sock;
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_param HTTPS off;
}
location ~* \\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
access_log off;
expires 1h;
add_header Cache-Control public;
}
error_log /var/log/nginx/orocommerce_error.log;
access_log /var/log/nginx/orocommerce_access.log;
}
EOF
sudo ln -sf "$NGINX_CONF_PATH" /etc/nginx/sites-enabled/orocommerce
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl reload nginx
echo "========================================"
echo " Installing Redis..."
echo "========================================"
sudo apt install -y redis-server
redis-cli -v
echo "========================================"
echo " Installing Node.js and NVM..."
echo "========================================"
sudo apt install -y nodejs npm
node -v
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm -v
echo "========================================"
echo " Installing Elasticsearch..."
echo "========================================"
sudo apt install -y gnupg apt-transport-https software-properties-common
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/${ELASTIC_VERSION}/apt stable main" | \
sudo tee /etc/apt/sources.list.d/elastic-${ELASTIC_VERSION}.list
sudo apt update && sudo apt install -y elasticsearch
sudo tee /etc/elasticsearch/elasticsearch.yml > /dev/null <<EOF
xpack.security.enabled: false
node.name: "node-1"
network.host: 0.0.0.0
http.port: 9200
cluster.name: "my-single-node-cluster"
discovery.type: single-node
EOF
sudo mkdir -p /etc/elasticsearch/jvm.options.d
sudo tee /etc/elasticsearch/jvm.options.d/heap_size.options > /dev/null <<EOF
-Xms500m
-Xmx500m
EOF
sudo systemctl daemon-reexec
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
sleep 15
curl -s "http://localhost:9200" | grep -q "cluster_name" && echo "✅ Elasticsearch is running." || echo "❌ Elasticsearch failed."
echo "========================================"
echo " Verifying service status..."
echo "========================================"
for svc in redis-server php${PHP_VERSION}-fpm elasticsearch postgresql nginx; do
systemctl is-active --quiet $svc || sudo systemctl start $svc
systemctl is-active --quiet $svc && echo "✅ $svc is running." || echo "❌ $svc failed to start."
done
echo "========================================"
echo " Cloning OroCommerce repository..."
echo "========================================"
sudo rm -rf "$ORO_DIR"
sudo git clone --branch "$ORO_BRANCH" "$ORO_REPO" "$ORO_DIR"
sudo chown -R "$USER":"$USER" "$ORO_DIR"
cd "$ORO_DIR"
echo "========================================"
echo " Configuring OroCommerce database..."
echo "========================================"
cp .env-app .env.local
sed -i "s|^ORO_DB_DSN=.*|ORO_DB_DSN=pgsql://$DB_USER:$DB_PASSWORD@127.0.0.1:5432/$DB_NAME|" .env.local
sed -i "s|^ORO_DB_DSN=.*|ORO_DB_DSN=pgsql://$DB_USER:$DB_PASSWORD@127.0.0.1:5432/$DB_NAME|" .env-app
echo "========================================"
echo " Install NPM and Composer Dependencies..."
echo "========================================"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install && nvm use
composer install --no-interaction --no-scripts
echo "========================================"
echo " Running OroCommerce installation..."
echo "========================================"
php bin/console oro:install --env=prod \
--user-name="$ADMIN_USER" \
--user-email="$ADMIN_EMAIL" \
--user-firstname="$ADMIN_FIRSTNAME" \
--user-lastname="$ADMIN_LASTNAME" \
--user-password="$ADMIN_PASSWORD" \
--sample-data=y \
--timeout=2000 \
--no-interaction
bin/console cache:warmup
npm run build || { echo "❌ NPM build failed";}
php bin/console oro:assets:install --symlink
php bin/console oro:search:reindex
php bin/console cache:clear --env=prod
sudo chown -R www-data:www-data "$ORO_DIR"
sudo chmod -R 755 "$ORO_DIR/var"
sudo systemctl restart php${PHP_VERSION}-fpm nginx redis-server postgresql
echo "========================================"
echo " OroCommerce installation complete!"
echo " Visit: http://localhost"
echo "========================================"Additional you probably need RabbitMQ:
curl -fsSL https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo gpg --dearmor -o /usr/share/keyrings/erlang.gpg
echo "deb [signed-by=/usr/share/keyrings/erlang.gpg] https://packages.erlang-solutions.com/ubuntu $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/erlang.list
sudo apt update
sudo apt install -y erlang
curl -fsSL https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/rabbitmq.gpg
echo "deb [signed-by=/usr/share/keyrings/rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
sudo apt update
sudo apt install -y rabbitmq-server
sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server
sudo rabbitmq-plugins enable rabbitmq_management
USER=oro_password_manager
PASS=strongpassword
#Default Username: guest / Password: guest
#optional
sudo rabbitmqctl add_user $USER $PASS || true
sudo rabbitmqctl set_user_tags $USER administrator
sudo rabbitmqctl set_permissions -p / $USER ".*" ".*" ".*"If you need install already existed project:
Import DB to PostgreSQL:
sudo -u postgres psql
\d
sudo -u postgres psql -d postgres -c "DROP DATABASE oro22;"
sed -i 's/OWNER TO oro;/OWNER TO postgres;/g' /tmp/dump.sql
sudo -u postgres psql -d yourdbname -f /tmp/dump.sql
#modify connection
ORO_DB_URL=postgres://postgres:postgres@127.0.0.1:5432/oro2?sslmode=disable&charset=utf8&serverVersion=13.7
#clone new code if needed
composer install --no-interaction --no-scripts
oroplatform platform update
#
bin/console oro:config:update oro_website.url "http://localhost:8080" --env=prod
bin/console oro:config:update oro_ui.application_url "http://localhost:8080" --env=prod
bin/console oro:config:update oro_website.secure_url "http://localhost:8080" --env=prod
bin/console oro:config:update oro_security.require_secure_channel false --env=prod
bin/console fos:js-routing:dump
php bin/console cache:clear
php bin/console oro:migration:load --force
php bin/console oro:assets:install
php bin/console oro:assets:build
php bin/console cache:clear
php bin/console cache:warmup
sudo service nginx restart Additionally if You need X-Debug:
sudo apt install php8.3-xdebug -y
sudo phpdismod xdebug
#sudo phpenmod xdebugDisable two factor:
php bin/console oro:config:update oro_user_pro.two_factor_authentication_strength disabledChange admin password:
bin/console — env=prod oro:user:update admin — user-password=adminInstall New Additional Extensions:
Full:
# Clear cache
php bin/console cache:clear
# Install assets
php bin/console assets:install --symlink
# Update database schema (if you have any entities)
php bin/console doctrine:schema:update --force
# Clear opcache if needed
php bin/console oro:platform:update --force
# Optional - run migrations if you have any
php bin/console doctrine:migrations:migrate
# Warm up cache
php bin/console cache:warmupSimple if no DB and assets :
# Clear cache only
php bin/console cache:clear
# Clear opcache and update platform
php bin/console oro:platform:update --force
# Warm up cache
php bin/console cache:warmupEnabling Redis for Cache Storage:
/config/config_prod.yml
parameters:
redis_dsn_cache: 'redis://localhost:6379/0'
redis_dsn_doctrine: 'redis://localhost:6379/1'
redis_dsn_layout: 'redis://localhost:6379/2'
# or
parameters:
redis_dsn_cache: '%env(ORO_REDIS_CACHE_DSN)%'
redis_dsn_doctrine: '%env(ORO_REDIS_DOCTRINE_DSN)%'
redis_dsn_layout: '%env(ORO_REDIS_LAYOUT_DSN)%'if you used ENV set values in the .appxxxx
###> redis cache config ###
# Sentinel DSN example: redis://127.0.0.1:26379?dbindex=1&redis_sentinel=lru_cache_mon
# Cluster DSN example: redis://password@127.0.0.1:6379?host[127.0.0.1:6380]&dbindex=1&cluster=predis`
# To activate Redis for the cache, run `composer set-params redis` and clear the application cache
ORO_REDIS_URL=redis://localhost:6379
ORO_REDIS_CACHE_DSN=${ORO_REDIS_URL}/1
ORO_REDIS_DOCTRINE_DSN=${ORO_REDIS_URL}/2
ORO_REDIS_LAYOUT_DSN=${ORO_REDIS_URL}/3
###< redis cache config ###ElasticSearch Config:
###> search engine config ###
# Elastic search's DSN example: elastic-search://valid_user:valid_password@127.0.0.1:9200?prefix=oro_search
# 'valid_user:valid_password@' DSN's part can be skipped if authentication is not enabled.
ORO_SEARCH_URL=elastic-search://127.0.0.1:9200
ORO_SEARCH_ENGINE_DSN=${ORO_SEARCH_URL}?prefix=oro_search
ORO_WEBSITE_SEARCH_ENGINE_DSN=${ORO_SEARCH_URL}?prefix=oro_website_searchGenerate Self Signed certificate for HTTPS:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
#nginx changes
Using Samba for folder sharing with IDE:
[vmshare]
path = /var/www/html/
read only = no
writable = yes
browsable = yes
valid users = @oro
writable = yes
guest ok = no
force create mode = 770
force directory mode = 770
inherit permissions = yes
#on host machine
sudo mount -t cifs //127.0.0.1/vmshare/ /mnt/shared -o username=oro,password=oro,gid=1000,uid=1000,dir_mode=0777,file_mode=0777,noperm,rw,vers=3.0,port=1445Build CSS From scratch
php bin/console oro:assets:build --skip-js