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
- Select HTTP as the traffic type
- Set the internal port to 8443 or 8080
- Main portal:
https://your-app.klutch.sh/ - E-commerce:
https://your-app.klutch.sh/ecommerce - Admin:
https://your-app.klutch.sh/webtools
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 dependenciesRUN apt-get update && apt-get install -y \ git \ unzip \ && rm -rf /var/lib/apt/lists/*
# Clone OFBizWORKDIR /optRUN git clone https://github.com/apache/ofbiz-framework.git ofbiz
WORKDIR /opt/ofbiz
# Initialize GradleRUN ./gradlew --no-daemon init-gradle-wrapper
# Build OFBizRUN ./gradlew --no-daemon cleanAll loadAll
# Set environmentENV 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:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
JAVA_OPTS | -Xms512m -Xmx2g |
OFBIZ_DATA_PATH | /data |
For external database (recommended):
| Variable | Value |
|---|---|
DB_HOST | Your database host |
DB_PORT | Database port |
DB_NAME | ofbiz |
DB_USER | Database username |
DB_PASSWORD | Database password |
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/opt/ofbiz/runtime | 20 GB | Runtime data and logs |
/opt/ofbiz/runtime/data | 50 GB | Application data |
/opt/ofbiz/runtime/logs | 10 GB | Log files |
Deploy Your Application
Click Deploy to start the build process. Initial build takes significant time.
Access OFBiz
Once deployed, access OFBiz:
Default credentials: admin / ofbiz
Initial Configuration
First-Time Setup
Complete initial configuration:
- Log in as admin
- Change default passwords immediately
- Configure company information
- Set up basic system parameters
Database Configuration
For production, use an external database:
- Create PostgreSQL or MySQL database
- Update entity engine configuration
- Run data migrations
- Verify database connectivity
User Management
Set up users and permissions:
- Navigate to Party Manager
- Create user accounts
- Assign security groups
- Configure access permissions
Using OFBiz Modules
Accounting
Set up financial management:
- Configure Chart of Accounts
- Set up fiscal periods
- Configure tax rules
- Enable invoicing
Order Management
Handle sales orders:
- Configure products and catalogs
- Set up pricing rules
- Configure shipping methods
- Enable payment processing
Manufacturing
Configure production:
- Set up BOMs (Bill of Materials)
- Configure work centers
- Create routing templates
- Enable production runs
E-Commerce
Launch your online store:
- Configure store settings
- Set up product categories
- Customize storefront theme
- 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.