Deploying Hazaar Applications
Deploying Hazaar Applications
Hazaar Framework applications are designed to be deployed in a variety of hosting environments, from traditional web servers to modern containerized platforms. This guide will help you choose the best deployment method for your needs.
Recommended Deployment: FrankenPHP
For new deployments, we strongly recommend FrankenPHP as your production web server. Built on Caddy and written in Go, FrankenPHP offers:
- Superior Performance: Worker mode provides 10-50x faster response times
- Modern Features: Built-in HTTP/2, HTTP/3, and Early Hints support
- Automatic HTTPS: Free SSL certificates from Let's Encrypt with auto-renewal
- Simple Configuration: Minimal setup compared to traditional stacks
- Production Proven: Powers the Hazaar API platform and other high-traffic applications
Deployment Options
FrankenPHP (Recommended)
The modern, high-performance option for Hazaar applications. FrankenPHP's worker mode keeps your application in memory, eliminating bootstrap overhead on every request.
- Best for: New deployments, high-performance requirements, modern infrastructure
- Difficulty: Easy
- Performance: Excellent (especially with worker mode)
Docker
Containerize your Hazaar application for consistent deployments across all environments. Docker provides isolation, portability, and easy scaling. Works with FrankenPHP, Apache, or Nginx base images.
- Best for: Cloud deployments, microservices, orchestrated environments
- Difficulty: Moderate
- Performance: Excellent (when using FrankenPHP base image)
Apache
The traditional, battle-tested web server. Choose Apache when you need compatibility with existing infrastructure or are deploying to shared hosting environments.
- Best for: Shared hosting, legacy infrastructure, traditional deployments
- Difficulty: Easy to Moderate
- Performance: Good
Nginx
A lightweight, high-performance web server with low resource usage. Good choice for traditional deployments when Apache isn't required.
- Best for: VPS hosting, traditional infrastructure, resource-constrained environments
- Difficulty: Moderate
- Performance: Very Good
Quick Comparison
| Feature | FrankenPHP | Docker + FrankenPHP | Apache | Nginx |
|---|---|---|---|---|
| Performance | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ |
| Ease of Setup | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
| Worker Mode | ✅ | ✅ | ❌ | ❌ |
| Auto HTTPS | ✅ | ✅ | ❌ | ❌ |
| HTTP/3 | ✅ | ✅ | ❌ | ✅ (with config) |
| Portability | Medium | ⭐⭐⭐⭐⭐ | High | High |
| Resource Usage | Low | Medium | Medium | Low |
Choosing Your Deployment Method
Use FrankenPHP if:
- You're starting a new project
- Performance is a priority
- You want automatic HTTPS
- You need modern HTTP/2 and HTTP/3 support
- You want the simplest configuration
Use Docker if:
- You need environment consistency across dev/staging/prod
- You're deploying to cloud platforms (AWS, GCP, Azure)
- You use orchestration tools (Kubernetes, Docker Swarm)
- You have multiple services that need to work together
Use Apache if:
- You're on shared hosting
- You have existing Apache infrastructure
- You need .htaccess support
- You're migrating from another PHP application
Use Nginx if:
- You're on a VPS with limited resources
- You prefer Nginx's configuration style
- You need to serve static files very efficiently
- You have existing Nginx expertise
System Requirements
All deployment methods require:
- PHP 8.0 or higher (included in FrankenPHP and Docker images)
- Composer for dependency management (during build/deployment)
- A Hazaar application (see Getting Started)
Additional requirements vary by deployment method—see the specific guides for details.
Next Steps
- Choose your deployment method based on your requirements
- Follow the specific deployment guide for detailed instructions
- Configure your application for production (see Configuration)
- Set up monitoring to track application performance
Getting Help
If you encounter issues during deployment:
- Check the FAQ for common questions
- Review the specific deployment guide for troubleshooting sections
- Ensure your system meets the requirements for your chosen method
Ready to deploy? Start with FrankenPHP for the best experience, or choose the deployment method that best fits your infrastructure.