Payara Application Server: An Open Source Alternative
When teams evaluate application servers for enterprise Java workloads, the conversation often gravitates toward commercial offerings. However, Payara Server has established itself as a compelling open source alternative that combines production-grade reliability with active development and community support.
This post explores what Payara is, why it matters, and how to get started.
What Is Payara Server?
Payara Server is a fully-featured, open source application server derived from GlassFish. When Oracle stepped back from commercial GlassFish support in 2013, the Payara project emerged to provide a supported, actively maintained fork.
Today, Payara offers two primary products:
- Payara Server — A full application server implementing the Jakarta EE (formerly Java EE) specifications.
- Payara Micro — A lightweight runtime (~70MB) designed for microservices and containerized deployments.
Both are released under a dual license: the CDDL and GPL with Classpath Exception, keeping them genuinely open source.
Why Consider Payara?
1. Jakarta EE and MicroProfile Compatibility
Payara implements the full Jakarta EE platform, meaning applications built to the standard specifications remain portable. It also supports Eclipse MicroProfile, giving teams access to modern microservice patterns like:
- Config
- Fault Tolerance
- Health Checks
- Metrics
- OpenAPI
2. Production Stability
Payara ships on a predictable release cadence and provides Long Term Support (LTS) versions for teams that value stability over frequent upgrades.
3. Migration Path from GlassFish
Because Payara originates from GlassFish, migration is typically straightforward. Existing deployments often move with minimal configuration changes.
Getting Started with Payara Micro
Payara Micro is ideal for demonstrating the platform quickly. Assuming you have a WAR file ready, running it is a single command.
# Download Payara Micro
wget https://repo1.maven.org/maven2/fish/payara/extras/payara-micro/6.2024.0/payara-micro-6.2024.0.jar
# Deploy your application
java -jar payara-micro-6.2024.0.jar --deploy myapp.war
Your application is now running on the default port 8080.
Customizing the Runtime
You can configure ports, contexts, and clustering directly from the command line:
java -jar payara-micro.jar \
--deploy myapp.war \
--port 9090 \
--contextRoot /api \
--clusterName my-cluster
A Simple MicroProfile Health Check
MicroProfile support makes it trivial to expose health endpoints for container orchestration platforms like Kubernetes.
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Readiness;
import jakarta.enterprise.context.ApplicationScoped;
@Readiness
@ApplicationScoped
public class DatabaseHealthCheck implements HealthCheck {
@Override
public HealthCheckResponse call() {
boolean dbReachable = checkDatabaseConnection();
return HealthCheckResponse.named("database")
.status(dbReachable)
.build();
}
private boolean checkDatabaseConnection() {
// Perform a lightweight connectivity check
return true;
}
}
Once deployed, the readiness state is available at /health/ready, ready to be consumed by a Kubernetes readiness probe.
Running Payara in Docker
Payara provides official Docker images, making containerized deployments simple.
FROM payara/micro:6.2024.0
# Copy the application artifact
COPY target/myapp.war $DEPLOY_DIR
# Expose the default HTTP port
EXPOSE 8080
Build and run:
docker build -t myapp-payara .
docker run -p 8080:8080 myapp-payara
Payara Server vs. Payara Micro
| Feature | Payara Server | Payara Micro |
|---|---|---|
| Deployment style | Full server install | Single JAR |
| Admin console | Yes | No |
| Footprint | Larger | ~70MB |
| Best for | Monolithic apps | Microservices |
| Clustering | Hazelcast-based | Hazelcast-based |
When Payara Makes Sense
Payara is a strong fit when you:
- Need a standards-based Jakarta EE runtime without vendor lock-in.
- Are migrating from GlassFish and want ongoing support.
- Want a single platform that spans monoliths and microservices.
- Require an open source license for cost or compliance reasons.
Conclusion
Payara Server proves that open source application servers can meet enterprise expectations without compromise. With full Jakarta EE compatibility, first-class MicroProfile support, and a lightweight microservices runtime, it offers flexibility across a wide range of deployment scenarios.
Whether you're modernizing legacy GlassFish deployments or building cloud-native services from scratch, Payara deserves a place on your shortlist. The best way to evaluate it is to deploy a small workload and experience the developer ergonomics firsthand.
Top comments (0)