SAP Hybris (SAP Commerce) - local installation guide
This guide will walk you through installing SAP Commerce (Hybris) on your local machine.
Prerequisites
Before installing, make sure your system meets the following requirements:
- Operating system: Windows 10/11, macOS, or Linux
- Java Development Kit (JDK): AdoptOpenJDK 11 or OpenJDK 11+
- Apache Ant, version 1.10+
- Apache Maven, version 3.6+
- Database: MySQL 5.7 or 8.0 (SAP Commerce also supports HSQLDB, Oracle etc.)
- Git (optional - recommended for version control)
Step 1: Download SAP Commerce
SAP Commerce is not publicly available for download. You need an SAP account to obtain it.
- Request the SAP Commerce ZIP file from our Support team via the Zoovu Support Portal.
- Extract the ZIP file to a directory of your choice.
Step 2: Configure environment variables
To ensure that your operating system can locate the required software, set up environment variables.
Set the JAVA_HOME variable
On macOS/Linux:
- Open a terminal.
- Run the following command, replacing
/path/to/jdk11
with the actual location where JDK 11 is installed:
export JAVA_HOME=/path/to/jdk11
export PATH=$JAVA_HOME/bin:$PATH
On Windows:
- Open System Properties.
- Go to the Advanced tab and click "Environment Variables".
- Under System Variables, click "New" and enter:
- Variable name:
JAVA_HOME
- Variable value:
C:\Program Files\Java\jdk-11
(replace with your actual Java path)
- Variable name:
- Edit the Path variable.
- Save.
Set the ANT_HOME variable (if not already installed)
export HYBRIS_HOME=/path/to/hybris
Set the Hybris_HOME variable
export HYBRIS_HOME=/path/to/hybris
Step 3: Set up the database
Option 1: Using HSQLDB (for development only)
HSQLDB is included with Hybris and requires no additional setup.
Option 2: Using MySQL (Recommended)
-
Install MySQL 8.0 or 5.7.
-
Create a new database:
CREATE DATABASE hybrisdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'hybris'@'localhost' IDENTIFIED BY 'hybris';
GRANT ALL PRIVILEGES ON hybrisdb.* TO 'hybris'@'localhost';
FLUSH PRIVILEGES;
- Update ``hybris/config/local.properties`:
db.url=jdbc:mysql://localhost:3306/hybrisdb?useSSL=false
db.driver=com.mysql.cj.jdbc.Driver
db.username=hybris
db.password=hybris
- Copy the MySQL JDBC driver (
mysql-connector-java-8.0.x.jar
) to:
hybris/bin/platform/lib/dbdriver/
Step 4: Initialize Hybris
- Open a terminal and navigate to the platform directory:
cd hybris/bin/platform
- Run the setup script:
On Windows:
setantenv.bat
On Linux/macOS:
source setantenv.sh
- Initialize the system
Warning: This deletes existing data.
ant clean all
ant initialize
Step 5: Start the Hybris server
On macOS/Linux:
./hybrisserver.sh
On Windows:
hybrisserver.bat
Wait for the server to start - it may take a few minutes.
Step 6: Access SAP Commerce (Hybris)
Once the server is running, you can access different parts of the platform:
-
Backoffice (Admin Panel):
http://localhost:9002/backoffice- Username:
admin
- Password:
nimda
- Username:
-
Storefront (Default Site - electronics):
http://localhost:9002/yacceleratorstorefront -
HAC (Hybris Administration Console):
http://localhost:9002/hac
(For system monitoring, cron jobs, and configurations.)
Step 7 (Optional): Running Spartacus (SAP Headless Storefront)
If you want a modern Angular-based storefront, you can install Spartacus.
-
Install Node.js (latest LTS version).
-
Install Angular CLI:
npm install -g @angular/cli
-
Clone and install Spartacus:
git clone https://github.com/SAP/spartacus.git
cd spartacus
npm install
npm start -
Access Spartacus Storefront at:
http://localhost:4200
Stopping the Hybris server
To stop the SAP Hybris server, run:
On Linux/macOS:
./hybrisserver.sh stop
On Windows:
hybrisserver.bat stop