RHEL BasedRocky Linux

How To Install WildFly on Rocky Linux 10

Install WildFly on Rocky Linux 10

WildFly represents a powerful open-source Java application server that enterprises rely on for deploying robust, scalable web applications. This comprehensive guide demonstrates the complete installation process for WildFly on Rocky Linux 10, delivering enterprise-grade Java application server capabilities to your infrastructure.

Rocky Linux 10 provides an ideal foundation for hosting WildFly due to its stability, security features, and enterprise-class reliability. System administrators and developers will gain access to a production-ready environment capable of supporting mission-critical Java applications with high performance and availability.

This tutorial covers every essential step from initial system preparation through advanced configuration, ensuring readers establish a secure, optimized WildFly installation. The complete process typically requires 30-45 minutes, depending on system specifications and network connectivity.

What is WildFly?

Understanding WildFly Architecture

WildFly, formerly known as JBoss Application Server, stands as Red Hat’s flagship open-source Java application server. The platform features a lightweight, modular architecture with pluggable subsystems that enable administrators to customize functionality based on specific requirements.

The application server provides comprehensive support for Java EE and Jakarta EE specifications, making it compatible with modern enterprise Java development frameworks. WildFly’s built-in clustering capabilities and high-availability features ensure applications maintain optimal performance under demanding production workloads.

WildFly vs Other Application Servers

WildFly offers significant advantages over competing solutions like Apache Tomcat, GlassFish, and Oracle WebLogic. The platform delivers superior performance optimization through efficient resource utilization and advanced memory management techniques.

Community support remains exceptionally strong due to Red Hat’s backing and active developer contributions. Unlike proprietary alternatives, WildFly eliminates licensing costs while providing enterprise-grade features, making it an cost-effective choice for organizations seeking robust Java application server capabilities without substantial financial investment.

Prerequisites and System Requirements

Hardware Requirements

Successful WildFly deployment requires adequate system resources to ensure optimal performance. Minimum RAM allocation should reach 2GB, though production environments benefit from 4GB or higher memory configurations.

CPU requirements include at least 2 cores for basic operations, with 4+ cores recommended for production workloads handling multiple concurrent applications. Storage allocation needs 10GB available disk space for WildFly installation, application deployments, and log file management.

Software Prerequisites

Before beginning WildFly installation, ensure your Rocky Linux 10 system meets essential software requirements. Root or sudo access enables execution of system-level configuration commands and package installations.

Active internet connectivity allows downloading WildFly packages, Java dependencies, and security updates throughout the installation process. SSH access facilitates remote server management when administering WildFly installations across distributed environments.

Basic Linux command-line knowledge proves helpful for navigating file systems, editing configuration files, and troubleshooting potential issues. Text editor familiarity with tools like nano, vim, or emacs enables efficient configuration file modifications during setup procedures.

Step 1: System Preparation and Updates

Updating Rocky Linux 10

Begin WildFly installation by ensuring your Rocky Linux 10 system contains the latest security patches and system updates. Execute comprehensive system updates using the DNF package manager:

sudo dnf update -y

Check current system information to verify kernel version and distribution details:

hostnamectl
uname -r

System updates may include kernel modifications requiring a reboot to activate new components. Reboot the system if kernel updates were installed to ensure all changes take effect properly.

Installing Essential Tools

Install fundamental utilities required for downloading and extracting WildFly installation packages:

sudo dnf install wget curl tar unzip -y

Configure development tools if planning to compile custom applications or modules:

sudo dnf groupinstall "Development Tools" -y

Set appropriate system timezone and locale settings for accurate logging and application behavior:

sudo timedatectl set-timezone America/New_York
sudo localectl set-locale LANG=en_US.UTF-8

Step 2: Java Installation and Configuration

Installing OpenJDK 11

WildFly requires Java Runtime Environment for core functionality and application execution. Install OpenJDK 11 as the recommended Java version for WildFly compatibility:

sudo dnf install java-11-openjdk-devel -y

Verify Java installation by checking version information and confirming successful deployment:

java --version
javac --version

OpenJDK 11 provides long-term support and maintains compatibility with current WildFly releases, ensuring stable operation for enterprise applications.

Java Environment Configuration

Configure JAVA_HOME environment variable to enable WildFly’s automatic Java detection:

echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' | sudo tee -a /etc/profile
echo 'export PATH=$JAVA_HOME/bin:$PATH' | sudo tee -a /etc/profile
source /etc/profile

Verify environment configuration by displaying JAVA_HOME value:

echo $JAVA_HOME
which java

Configure Java alternatives if multiple Java versions exist on the system:

sudo alternatives --config java

Test Java functionality by compiling and executing a simple test program to ensure proper installation and configuration.

Step 3: Creating WildFly System User

Security Best Practices

Running WildFly as a dedicated system user enhances security isolation and reduces potential attack vectors. Dedicated user accounts limit privilege escalation risks and provide better process management capabilities.

System user accounts differ from regular user accounts by restricting shell access and limiting login capabilities, preventing unauthorized interactive sessions while maintaining service functionality.

User Creation Process

Create a dedicated system group for WildFly service management:

sudo groupadd --system wildfly

Create WildFly system user with appropriate home directory and security restrictions:

sudo useradd -s /sbin/nologin --system -d /opt/wildfly -g wildfly wildfly

Verify user creation by checking user information and group membership:

id wildfly
grep wildfly /etc/passwd

The system user configuration prevents direct login while enabling service process execution under controlled security contexts.

Step 4: Downloading and Installing WildFly

Obtaining Latest WildFly Version

Navigate to WildFly’s official releases page to identify the most current stable version. Download WildFly 37.0.1.Final using wget utility for reliable file transfer:

cd /tmp
wget https://download.jboss.org/wildfly/37.0.1.Final/wildfly-37.0.1.Final.tar.gz

Verify download integrity by comparing file checksums with official values from the WildFly website:

sha256sum wildfly-37.0.1.Final.tar.gz

Alternative download methods include using curl for environments with specific proxy configurations or mirror sites for improved download speeds in certain geographical regions.

Installation Process

Extract WildFly archive to temporary location for processing:

tar -xzf wildfly-37.0.1.Final.tar.gz

Move extracted files to standard installation directory:

sudo mv wildfly-37.0.1.Final /opt/wildfly

Set correct ownership and permissions for security and proper operation:

sudo chown -R wildfly:wildfly /opt/wildfly
sudo chmod +x /opt/wildfly/bin/*.sh

Create symbolic link for easier version management and future upgrades:

sudo ln -sf /opt/wildfly /opt/wildfly-current

Step 5: WildFly Configuration

Basic Configuration Setup

Create system configuration directory for WildFly settings management:

sudo mkdir -p /etc/wildfly

Copy default configuration files from WildFly installation directory:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/

Edit configuration file to customize Java memory settings and runtime parameters:

sudo nano /etc/wildfly/wildfly.conf

Configure appropriate Java heap sizes based on available system memory:

WILDFLY_SERVER_CONFIG=standalone.xml
WILDFLY_BIND=0.0.0.0
JAVA_OPTS="-Xms1024m -Xmx2048m -XX:MetaspaceSize=256m"

Network and Binding Configuration

Configure network interfaces by editing standalone configuration file:

sudo nano /opt/wildfly/standalone/configuration/standalone.xml

Modify binding addresses to allow external connections while maintaining security:

<interfaces>
    <interface name="management">
        <inet-address value="127.0.0.1"/>
    </interface>
    <interface name="public">
        <inet-address value="0.0.0.0"/>
    </interface>
</interfaces>

Default port configurations include port 8080 for application access and port 9990 for administration console. Customize ports if conflicts exist with other services or security policies require non-standard configurations.

Step 6: Creating Systemd Service

Service File Creation

Create systemd service file for automatic WildFly management:

sudo nano /etc/systemd/system/wildfly.service

Configure service parameters with proper user, group, and working directory settings:

[Unit]
Description=The WildFly Application Server
After=syslog.target network.target
Before=httpd.service

[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/etc/wildfly/wildfly.conf
User=wildfly
Group=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND
StandardOutput=null

[Install]
WantedBy=multi-user.target

Create PID directory with appropriate permissions:

sudo mkdir -p /var/run/wildfly
sudo chown wildfly:wildfly /var/run/wildfly

Service Configuration and Testing

Reload systemd daemon to recognize new service configuration:

sudo systemctl daemon-reload

Enable WildFly service for automatic startup during system boot:

sudo systemctl enable wildfly

Start WildFly service and verify successful initialization:

sudo systemctl start wildfly
sudo systemctl status wildfly

Monitor service logs for troubleshooting startup issues or configuration problems:

sudo journalctl -u wildfly -f

Step 7: Firewall and Security Configuration

Firewall Rules Setup

Configure firewall rules to allow WildFly traffic while maintaining system security. Open port 8080 for application access:

sudo firewall-cmd --permanent --add-port=8080/tcp

Enable management console access through port 9990:

sudo firewall-cmd --permanent --add-port=9990/tcp

Reload firewall configuration to activate new rules:

sudo firewall-cmd --reload

Verify firewall rules by listing active configurations:

sudo firewall-cmd --list-all

SELinux Configuration

Configure SELinux policies for WildFly operation. Check current SELinux status:

sestatus

Set appropriate SELinux contexts for WildFly directories and processes:

sudo setsebool -P httpd_can_network_connect 1
sudo semanage port -a -t http_port_t -p tcp 8080
sudo semanage port -a -t http_port_t -p tcp 9990

Create custom SELinux policy if default policies restrict required functionality:

sudo audit2allow -M wildfly < /var/log/audit/audit.log
sudo semodule -i wildfly.pp

Step 8: Creating WildFly Admin User

Admin Console Access Setup

Navigate to WildFly bin directory for user management script execution:

cd /opt/wildfly/bin

Execute add-user script to create management console administrator:

sudo -u wildfly ./add-user.sh

Select management user type when prompted and provide secure credentials:

  • Choose ‘a’ for Management User
  • Enter username (e.g., ‘admin’)
  • Provide strong password following security best practices
  • Assign appropriate roles and permissions

Confirm user creation by reviewing generated configuration files in the domain/configuration directory.

Security Considerations

Implement strong password policies including minimum length, complexity requirements, and regular rotation schedules. Passwords should contain uppercase letters, lowercase letters, numbers, and special characters.

Restrict administrative access to specific IP addresses or network ranges using firewall rules and WildFly’s built-in access control mechanisms. Configure two-factor authentication if enhanced security requirements exist.

Establish role-based access control by creating specific user groups with limited permissions based on administrative responsibilities and job functions.

Step 9: Testing and Verification

Service Status Verification

Check WildFly process status using system monitoring commands:

ps aux | grep wildfly
sudo systemctl is-active wildfly

Verify network port binding to ensure WildFly listens on configured addresses:

sudo ss -tlnp | grep :8080
sudo ss -tlnp | grep :9990

Monitor resource utilization to confirm adequate system performance:

htop
free -h
df -h

Review log files for error messages or configuration warnings:

sudo tail -f /opt/wildfly/standalone/log/server.log

Web Interface Testing

Access WildFly welcome page using web browser or curl command:

curl -I http://localhost:8080

Open web browser and navigate to http://your-server-ip:8080 to view the default WildFly page.

Install WildFly on Rocky Linux 10

Login to administration console at http://your-server-ip:9990/console using created administrative credentials. Navigate management sections including Deployments, Configuration, and Runtime monitoring to verify full functionality.

Deploy sample application to test deployment capabilities and ensure proper application server operation.

Step 10: Basic WildFly Management

Administration Console Overview

The management console provides comprehensive control over WildFly server configuration, deployment management, and performance monitoring. Key navigation sections include Deployments for application management, Configuration for subsystem settings, and Runtime for live monitoring.

Server status monitoring displays real-time performance metrics, memory usage, and active connection statistics. Log file management through the web interface enables administrators to adjust logging levels and review system events without command-line access.

Understanding subsystem configurations helps optimize database connections, messaging queues, and security domains based on application requirements.

Common Management Tasks

Application deployment and undeployment procedures involve uploading WAR or EAR files through the console interface or CLI commands. Starting and stopping services gracefully prevents data corruption and maintains system stability.

Data source configuration enables database connectivity for enterprise applications requiring persistent storage. Security domain management controls authentication mechanisms and user access permissions across deployed applications.

Performance tuning involves adjusting thread pools, connection limits, and caching strategies to optimize application response times and resource utilization.

Optimization and Performance Tuning

JVM Tuning

Optimize heap memory allocation based on application memory requirements and available system resources. Typical production environments benefit from heap sizes between 2GB and 8GB depending on workload characteristics.

Configure garbage collection parameters to minimize pause times and improve application responsiveness:

JAVA_OPTS="-Xms2048m -Xmx4096m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"

Monitor JVM performance metrics using built-in monitoring tools or external profiling applications. Memory usage patterns help identify potential memory leaks or inefficient resource utilization.

WildFly-Specific Optimizations

Thread pool optimization involves adjusting core and maximum thread counts based on expected concurrent user loads. Connection pool tuning optimizes database connectivity performance for high-traffic applications.

Subsystem configuration optimization includes disabling unused services to reduce memory overhead and improve startup times. Caching strategies enhance application performance by reducing database queries and computation overhead.

Load balancing configurations distribute application requests across multiple WildFly instances for improved scalability and fault tolerance.

Troubleshooting Common Issues

Installation Problems

Java version compatibility issues occur when using unsupported JDK versions with specific WildFly releases. Ensure OpenJDK 11 or later versions for optimal compatibility and performance.

Permission and ownership problems prevent WildFly from accessing configuration files or creating log entries. Verify wildfly user ownership of installation directories and executable permissions on shell scripts.

Port conflicts arise when other services occupy default WildFly ports 8080 or 9990. SELinux restrictions may block service startup if proper contexts are not configured.

Runtime Issues

Memory errors and OutOfMemoryException indicate insufficient heap allocation or memory leaks in deployed applications. Increase heap size or analyze application memory usage patterns.

Application deployment failures often result from dependency conflicts, configuration errors, or insufficient permissions. Database connectivity problems require verification of driver installation, connection URLs, and authentication credentials.

SSL certificate issues prevent secure connections when HTTPS is configured. Performance bottlenecks may indicate inadequate hardware resources or suboptimal configuration parameters.

Security Best Practices

System Security

Regular security updates protect against known vulnerabilities in WildFly, Java, and Rocky Linux components. Implement automated update procedures while maintaining testing protocols for production environments.

User account security involves strong password policies, regular credential rotation, and principle of least privilege access. Network security configurations include firewall rules, VPN access, and intrusion detection systems.

File system permissions prevent unauthorized access to sensitive configuration files and application data. Security monitoring identifies suspicious activities and potential security breaches.

Application Security

Management interface protection requires strong authentication, encrypted connections, and restricted network access. SSL/TLS implementation encrypts data transmission between clients and WildFly servers.

Authentication and authorization mechanisms control user access to applications and administrative functions. Regular security audits identify configuration weaknesses and compliance violations.

Backup and disaster recovery planning ensures business continuity during security incidents or system failures. Vulnerability assessments proactively identify potential security risks before exploitation occurs.

Congratulations! You have successfully installed WildFly. Thanks for using this tutorial for installing WildFly open-source application server for Java Enterprise Edition (Java EE) on Rocky Linux 10 system. For additional help or useful information, we recommend you check the official WildFly website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button