Skip to content

Deploying Apache OFBiz

Introduction

Apache OFBiz is a mature open-source enterprise automation software project that provides a comprehensive suite of business applications. It includes ERP, CRM, e-commerce, supply chain management, manufacturing resource planning, and many other enterprise applications in a single integrated platform.

Built on a Java/J2EE foundation, OFBiz uses a component-based architecture that allows organizations to deploy only the modules they need. The framework provides tools for rapid application development while maintaining enterprise-grade security and scalability.

Key highlights of Apache OFBiz:

  • ERP Suite: Complete enterprise resource planning capabilities
  • CRM Module: Customer relationship management with sales automation
  • E-Commerce: Full-featured online storefront functionality
  • Manufacturing: Production planning and manufacturing execution
  • Inventory Management: Comprehensive warehouse and stock control
  • Accounting: General ledger, accounts payable/receivable, and billing
  • Human Resources: Employee management and payroll processing
  • Content Management: Document and content management system
  • Business Intelligence: Reporting and analytics tools
  • Workflow Engine: Configurable business process automation
  • Open Source: Apache 2.0 license with active community

This guide walks through deploying Apache OFBiz on Klutch.sh using Docker.

Why Deploy OFBiz on Klutch.sh

Deploying OFBiz on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh handles the complex Java deployment automatically.

Persistent Storage: Attach persistent volumes for your business data and configurations.

HTTPS by Default: Automatic SSL certificates ensure secure access.

GitHub Integration: Version-controlled deployments through your repository.

Scalable Resources: Allocate CPU and memory based on your business needs.

Environment Variable Management: Securely store database credentials.

Custom Domains: Use your own domain for your business applications.

Always-On Availability: Your ERP system remains accessible 24/7.

Prerequisites

Before deploying OFBiz on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Understanding of enterprise software concepts
  • A PostgreSQL or MySQL database (recommended for production)
  • (Optional) A custom domain for your OFBiz instance

Understanding OFBiz Architecture

OFBiz is built on a layered architecture:

Entity Engine: Handles all database operations and entity definitions.

Service Engine: Manages business logic as reusable services.

Widget Engine: Renders the user interface using XML definitions.

Web Framework: Handles HTTP requests and responses.

Security Component: Manages authentication, authorization, and access control.

Core Components: Party, Product, Order, Accounting, and other business modules.

Deploying OFBiz on Klutch.sh

    Create Your GitHub Repository

    Create a new GitHub repository for your OFBiz deployment configuration.

    Create the Dockerfile

    Create a Dockerfile in your repository root:

    FROM eclipse-temurin:17-jdk
    # Install dependencies
    RUN apt-get update && apt-get install -y \
    git \
    unzip \
    && rm -rf /var/lib/apt/lists/*
    # Clone OFBiz
    WORKDIR /opt
    RUN git clone https://github.com/apache/ofbiz-framework.git ofbiz
    WORKDIR /opt/ofbiz
    # Initialize Gradle
    RUN ./gradlew --no-daemon init-gradle-wrapper
    # Build OFBiz
    RUN ./gradlew --no-daemon cleanAll loadAll
    # Set environment
    ENV JAVA_OPTS="-Xms512m -Xmx2g"
    EXPOSE 8443 8080
    CMD ["./gradlew", "--no-daemon", "ofbiz"]

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project.

    Create a New App

    Within your project, create a new app and connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 8443 or 8080

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    JAVA_OPTS-Xms512m -Xmx2g
    OFBIZ_DATA_PATH/data

    For external database (recommended):

    VariableValue
    DB_HOSTYour database host
    DB_PORTDatabase port
    DB_NAMEofbiz
    DB_USERDatabase username
    DB_PASSWORDDatabase password

    Attach Persistent Volumes

    Add persistent storage:

    Mount PathRecommended SizePurpose
    /opt/ofbiz/runtime20 GBRuntime data and logs
    /opt/ofbiz/runtime/data50 GBApplication data
    /opt/ofbiz/runtime/logs10 GBLog files

    Deploy Your Application

    Click Deploy to start the build process. Initial build takes significant time.

    Access OFBiz

    Once deployed, access OFBiz:

    • Main portal: https://your-app.klutch.sh/
    • E-commerce: https://your-app.klutch.sh/ecommerce
    • Admin: https://your-app.klutch.sh/webtools

    Default credentials: admin / ofbiz

Initial Configuration

First-Time Setup

Complete initial configuration:

  1. Log in as admin
  2. Change default passwords immediately
  3. Configure company information
  4. Set up basic system parameters

Database Configuration

For production, use an external database:

  1. Create PostgreSQL or MySQL database
  2. Update entity engine configuration
  3. Run data migrations
  4. Verify database connectivity

User Management

Set up users and permissions:

  1. Navigate to Party Manager
  2. Create user accounts
  3. Assign security groups
  4. Configure access permissions

Using OFBiz Modules

Accounting

Set up financial management:

  1. Configure Chart of Accounts
  2. Set up fiscal periods
  3. Configure tax rules
  4. Enable invoicing

Order Management

Handle sales orders:

  1. Configure products and catalogs
  2. Set up pricing rules
  3. Configure shipping methods
  4. Enable payment processing

Manufacturing

Configure production:

  1. Set up BOMs (Bill of Materials)
  2. Configure work centers
  3. Create routing templates
  4. Enable production runs

E-Commerce

Launch your online store:

  1. Configure store settings
  2. Set up product categories
  3. Customize storefront theme
  4. Configure checkout flow

Production Best Practices

Performance Optimization

  • Allocate sufficient JVM heap size
  • Enable connection pooling
  • Configure caching appropriately
  • Optimize database queries

Security Recommendations

  • Change all default passwords
  • Enable HTTPS only
  • Configure security groups properly
  • Regular security updates
  • Implement backup encryption

High Availability

  • Use external database with replication
  • Configure session persistence
  • Implement load balancing
  • Set up monitoring and alerting

Troubleshooting Common Issues

Application Won’t Start

  • Check Java heap settings
  • Verify database connectivity
  • Review startup logs
  • Ensure ports are available

Login Issues

  • Verify user credentials
  • Check security configuration
  • Review authentication logs
  • Reset passwords if needed

Performance Problems

  • Increase JVM memory
  • Optimize database queries
  • Enable query caching
  • Review application logs

Additional Resources

Conclusion

Deploying Apache OFBiz on Klutch.sh provides a comprehensive enterprise automation solution without the complexity of traditional ERP implementations. With its modular architecture and extensive functionality, OFBiz offers a flexible foundation for managing all aspects of your business operations while maintaining full control over your data and systems.