Skip to main content

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:
  1. Open a terminal.
  2. 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:
  1. Open System Properties.
  2. Go to the Advanced tab and click "Environment Variables".
  3. 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)
  4. Edit the Path variable.
  5. 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.

  1. Install MySQL 8.0 or 5.7.

  2. 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;
  1. 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
  1. Copy the MySQL JDBC driver (mysql-connector-java-8.0.x.jar) to:
hybris/bin/platform/lib/dbdriver/

Step 4: Initialize Hybris

  1. Open a terminal and navigate to the platform directory:
cd hybris/bin/platform
  1. Run the setup script:
On Windows:
setantenv.bat
On Linux/macOS:
source setantenv.sh
  1. 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:


Step 7 (Optional): Running Spartacus (SAP Headless Storefront)

If you want a modern Angular-based storefront, you can install Spartacus.

  1. Install Node.js (latest LTS version).

  2. Install Angular CLI:

    npm install -g @angular/cli
  3. Clone and install Spartacus:

    git clone https://github.com/SAP/spartacus.git
    cd spartacus
    npm install
    npm start
  4. 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