DEV Community

Cover image for Deploy Java Apps Like a Pro: WildFly Setup, Tuning & Automation on RHEL (2025 Edition)
kaustubh yerkade
kaustubh yerkade

Posted on

Deploy Java Apps Like a Pro: WildFly Setup, Tuning & Automation on RHEL (2025 Edition)

What Is WildFly?

WildFly is a lightweight, flexible, and open-source Java EE / Jakarta EE application server.

It’s the modern evolution of JBoss AS , known for its performance, modular design, and enterprise-grade reliability.

Whether you’re deploying microservices or full Java monoliths, WildFly fits perfectly in CI/CD pipelines, containers, or air-gapped enterprise setups.


Step 1: Installing WildFly on RHEL

Let’s start fresh.

1️ Download WildFly

wget https://github.com/wildfly/wildfly/releases/download/30.0.1.Final/wildfly-30.0.1.Final.tar.gz
Enter fullscreen mode Exit fullscreen mode

2️ Extract and Move to /opt

tar -xvzf wildfly-30.0.1.Final.tar.gz
sudo mv wildfly-30.0.1.Final /opt/wildfly
Enter fullscreen mode Exit fullscreen mode

3️ Set JAVA_HOME

export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export PATH=$PATH:$JAVA_HOME/bin
Enter fullscreen mode Exit fullscreen mode

Tip: WildFly 30+ works best with Java 17 or newer.

4️ start the Server

cd /opt/wildfly/bin
./standalone.sh
Enter fullscreen mode Exit fullscreen mode

You should now see logs like:

WFLYSRV0025: WildFly Full 30.0.1.Final (WildFly Core 22.0.1.Final) started in 3500ms
Enter fullscreen mode Exit fullscreen mode

Access the default page at http://localhost:8080


Step 2: Create Admin User & Access Console

To use the management console:

cd /opt/wildfly/bin
./add-user.sh
Enter fullscreen mode Exit fullscreen mode

Then open:
http://localhost:9990

You’ll see the elegant WildFly Admin Console UI.

Tip: Secure the console by binding to localhost:

./standalone.sh -bmanagement=127.0.0.1
Enter fullscreen mode Exit fullscreen mode

Step 3: Deploy Your Java Application (WAR)

Just drop your WAR file into:

/opt/wildfly/standalone/deployments/
Enter fullscreen mode Exit fullscreen mode

Example:

cp myapp.war /opt/wildfly/standalone/deployments/
Enter fullscreen mode Exit fullscreen mode

Check deployment logs:

WFLYSRV0010: Deployed "myapp.war" (runtime-name : "myapp.war")
Enter fullscreen mode Exit fullscreen mode

Access: http://localhost:8080/myapp


Step 4: Configure JVM, Ports, and Logging

Common settings can be changed in:

/opt/wildfly/standalone/configuration/standalone.xml
Enter fullscreen mode Exit fullscreen mode

Example: Change HTTP Port

<socket-binding name="http" port="8181"/>
Enter fullscreen mode Exit fullscreen mode

Example: JVM Memory Tuning

JAVA_OPTS="-Xms512M -Xmx2048M -XX:+UseG1GC"
Enter fullscreen mode Exit fullscreen mode

Step 5: Secure Your WildFly Server

Security is non-negotiable in production.

Enable HTTPS:

keytool -genkeypair -alias wildfly -keyalg RSA -keystore keystore.jks -storepass changeit
Enter fullscreen mode Exit fullscreen mode

Add SSL configuration in standalone.xml, then access:
https://your-server:8443

Restrict access to management console

Use strong passwords and roles

Disable unused interfaces


Step 6: Automate Deployments (DevOps-Style)

Here’s where the fun begins

CI/CD Example – Jenkins Pipeline

pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh './mvnw clean package'
      }
    }
    stage('Deploy to WildFly') {
      steps {
        sh '/opt/wildfly/bin/jboss-cli.sh --connect --command="deploy target/myapp.war --force"'
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Dockerfile Example

FROM jboss/wildfly:30.0.1.Final
COPY target/myapp.war /opt/jboss/wildfly/standalone/deployments/
EXPOSE 8080
Enter fullscreen mode Exit fullscreen mode

Then:

docker build -t myapp:wildfly .
docker run -p 8080:8080 myapp:wildfly
Enter fullscreen mode Exit fullscreen mode

Combine WildFly + Docker + Jenkins = effortless repeatable deployments.


Step 7: Performance Tuning Tips

Here are a few optimizations I use in production:

  • 🔹 Increase thread pools: max-threads="200"
  • 🔹 Use async logging (Log4j2)
  • 🔹 Configure JDBC connection pools
  • 🔹 Tune GC for your heap size
  • 🔹 Enable caching for static content

For enterprise workloads, consider using WildFly Operator on OpenShift for scaling and self-healing.


Step 8: Troubleshooting Common Issues

Issue Fix
Admin console not loading Check port 9990 and firewall rules
Unable to access jboss-modules.jar Run from correct bin directory
High CPU usage Tune JVM GC and thread pool size
Deployment failed: module not found Ensure dependencies exist in modules/ directory

Step 9: WildFly in the Modern Era

Even in the age of Spring Boot and microservices, WildFly remains:

  • Lightweight yet enterprise-ready
  • Cloud-compatible (Kubernetes, OpenShift)
  • Perfect for legacy modernization projects

If you’re managing mission-critical finance or healthcare systems, WildFly gives you stability, modularity, and deep control , unmatched by most containers.


Wrapping Up

You just learned how to:

  1. Install WildFly on RHEL
  2. Deploy and secure your apps
  3. Tune for performance
  4. Automate CI/CD pipelines

WildFly may not be flashy , but it’s battle-tested and rock solid for enterprises.


Over to you!

Have you used WildFly in production?

What tuning tricks or automation setups have worked best for you?

Drop a comment , I’d love to compare notes!


*Follow me for more DevOps & Java guides *

Top comments (0)