Apache OFBiz®



Welcome to Apache OFBiz! A powerful top level Apache software project. OFBiz
is an Enterprise Resource Planning (ERP) System written in Java and houses a
large set of libraries, entities, services and features to run all aspects of
your business.
For more details about OFBiz please visit the OFBiz Documentation page:
OFBiz documentation
OFBiz License
Notes
Note -
If you want to use Eclipse, read the Setup eclipse project for OFBiz
section to set it up.
Note -
If you want to use an external database like MySQL or PostgreSQL, read
the Setup an external database section.
Note -
If you want to run OFBiz without an internet connection, read the
Running gradle tasks without an internet connection section.
Note -
The directory structure and repositories have changed. For more
information read the Repository and directory structure section.
Note -
If you are in China you may encounter network issues or proxy settings. This is unrelated to OFBiz.
System requirements
The only requirements to run OFBiz are
- to have the Java Development Kit (JDK) version 17 installed on your system
(not just the JRE, but the full JDK) that you can download from the link below.
Make sure to set the
$JAVA_HOME environment variable.
JDK download.
To know more about the JDK
Warning -
On Windows, do not install OFBiz in a directory whose path contains spaces.
- If on Windows, a Powershell version >= 7.1.3 installed that you can download from the below link.
Powershell
Quick start
To quickly install and fire-up OFBiz, please follow the below instructions from
the command line at the OFBiz top level directory (folder).
Download the Gradle wrapper
MS Windows: init-gradle-wrapper
Important
- If you encounter an error
"Powershell is not recognized as an internal or external command, operable program or batch file"
follow the advice at: https://s.apache.org/vdcv8. If you want more details see: https://s.apache.org/urnju
- If you run into problems, check the execution policy of PowerShell. See https://s.apache.org/urnju for details.
By setting the execution policy to "unrestricted", you'll be prompted to run the script once you run the init-gradle-wrapper command.
Note -
If you wonder where are stored the PowerShell Executables, here are the answers: https://s.apache.org/w5dye
Unix-like OS: ./gradle/init-gradle-wrapper.sh
Prepare OFBiz
Clean system and load the complete OFBiz data
Note -
Depending on your Internet connection speed it might take a long time
for this step to complete if you are using OFBiz for the first time as it needs
to download all dependencies. So please be patient!
MS Windows: gradlew cleanAll loadAll
Unix-like OS: ./gradlew cleanAll loadAll
Warning - This command deletes all previous data and resets it to the initial demo data.
Start OFBiz
MS Windows: gradlew ofbiz
Unix-like OS: ./gradlew ofbiz
Note -
Ignore the % progress indicator because this task does not end as long
as OFBiz is running.
Visit OFBiz through your browser
Order Back Office interface
Accounting Back Office interface
Administrator interface
You can log in with the user admin and password ofbiz.
Note -
In case if problems visit our Further reading section.
Docker
If you want to set and use Docker, here is the documentation.
Production setup
Note -
Currently, deployment configuration is tied to the source code. If you want to separate deployment configuration from production code we recommend using Docker, see Docker section above.
Following is a simple production setup. For more detailed information visit Apache OFBiz Technical Production Setup Guide.
Package OFBiz
MS Windows: gradlew distZip
Unix-like OS: ./gradlew distTar
Copy to server
Copy the archive from build/distributions directory to the server and unarchive them with tar xf or unzip.
Run OFBiz
From the unarchived directory you can run either bin/ofbiz shell script or bin/ofbiz.bat batch script.
Install as a service
MS Windows: you can use nssm.
Unix-like OS: This article might give you an idea, although it seems to be outdated. Either way, you can use the standard mechanism of your distribution, like for example creating an /etc/systemd/system/ofbiz.service file.
Troubleshooting
On Windows you might get the following error when trying to run the ofbiz.bat script:
The input line is too long. The syntax of the command is incorrect.
The current workaround is to clone the repository and run gradlew commands from the root folder instead.
Security
Caution -
You can find more information about security in OFBiz at
the site security page
Build system syntax
All build tasks are executed using the Gradle build system which is embedded
in OFBiz. To execute build tasks go to OFBiz top-level directory (folder) and
execute tasks from there.
Operating System Syntax
The syntax for tasks differ slightly between windows and Unix-like systems
- Windows:
gradlew <tasks-in-here>
- Unix-like:
./gradlew <tasks-in-here>
For the rest of this document, we will use the windows syntax, if you are on a
Unix-like system, you need to add the ./ to gradlew.
Types of tasks in Gradle
There are two types of tasks designed for OFBiz in Gradle:
- Standard tasks: To execute general standard Gradle tasks
- OFBiz server tasks: To execute OFBiz startup commands. These tasks start with one of the following words:
- ofbiz : standard server commands
- ofbizBackground : server commands running in a background forked process
Tips:
- OFBiz server commands require "quoting" the commands. For example:
gradlew "ofbiz --help"
- Shortcuts to task names can be used by writing the first letter of every word
in a task name. However, you cannot use the shortcut form for OFBiz server
tasks. Example:
gradlew loadAdminUserLogin -PuserLoginId=myadmin =
gradlew lAUL -PuserLoginId=myadmin
- Dependent tasks can be skipped with the -x switch. Example:
gradlew build -x test does not run the tests within the build.
Example standard tasks
gradlew build
gradlew cleanAll loadAll testIntegration
Example OFBiz server tasks
gradlew "ofbiz --help"
gradlew "ofbiz --test" --debug-jvm
gradlew "ofbizBackground --start --portoffset 10000"
gradlew "ofbiz --shutdown --portoffset 10000"
gradlew ofbiz (default is --start)
Example mixed tasks (standard and OFBiz server)
gradlew cleanAll loadAll "ofbiz --start --portoffset 10000"
Quick reference
You can use the below common list of tasks as a quick reference for controlling
the system. This document uses the windows task syntax, if you are on a
Unix-like system, you need to add the ./ to gradlew i.e. ./gradlew
Help tasks
List OFBiz server commands
List all available commands to control the OFBiz server
gradlew "ofbiz --help"
List build tasks
List all available tasks from the build system
gradlew tasks
List build projects
List all available projects in the build system
gradlew projects
Gradle build system help
Show usage and options for the Gradle build system
gradlew --help
Server command tasks
Start OFBiz
gradlew "ofbiz --start"
start is the default server task so this also works:
gradlew ofbiz
Shutdown OFBiz
gradlew "ofbiz --shutdown"
Get OFBiz status
gradlew "ofbiz --status"
Force OFBiz shutdown
Terminate all running OFBiz server instances by calling the appropriate
operating system kill command. Use this command to force OFBiz termination if
the --shutdown command does not work. Usually this is needed when in the middle
of data loading or testing in OFBiz.
Warning: Be careful in using this command as force termination might lead to inconsistent state / data
gradlew terminateOfbiz
Start OFBiz in remote debug mode
Starts OFBiz in remote debug mode and waits for debugger or IDEs to connect on
port 5005
gradlew ofbiz --debug-jvm
Start OFBiz on a different port
Start OFBiz of the network port offsetted by the range provided in the argument
to --portoffset
gradlew "ofbiz --start --portoffset 10000"
Start OFBiz in the background
Start OFBiz in the background by forking it to a new process and redirecting the
output to **runtime/logs/consol