{"id":12652,"date":"2021-12-07T04:17:05","date_gmt":"2021-12-07T04:17:05","guid":{"rendered":"https:\/\/linuxways.net\/?p=12652"},"modified":"2021-12-07T04:17:05","modified_gmt":"2021-12-07T04:17:05","slug":"how-to-install-wildfly-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-wildfly-on-ubuntu-20-04\/","title":{"rendered":"How to Install WildFly on Ubuntu 20.04"},"content":{"rendered":"<p>WildFly (formerly JBoss) is a lightweight, quick, and highly optimized application server that lets you build outstanding Java applications. WildFly is a cross-platform and comes with a sophisticated interface that makes changing application server settings and configuration very simple and quick.<\/p>\n<p>It is currently maintained by RedHat as an open-source project and is also available for commercial enterprise environments<\/p>\n<p>In this guide, we will discuss how to install WildFly on Ubuntu 20.04.<\/p>\n<h2><strong>Step 1: Update your system<\/strong><\/h2>\n<p>It is important to ensure your system packages are up to date. Run the following commands:<\/p>\n<pre><strong>$ sudo apt upgrade<\/strong><\/pre>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<h2><strong>Step 2: Install Java<\/strong><\/h2>\n<p>Wildfly is software written in Java. We, therefore, need to install the Java environment on our Ubuntu 20.04 system<\/p>\n<pre><strong>$ sudo apt install default-jdk<\/strong><\/pre>\n<h2><strong>Step 3: Set up Wildfly User<\/strong><\/h2>\n<p>We need to create a system user and group for Wildfly on the <strong>\/opt\/wildfy <\/strong>directory on our system. Run the following commands:<\/p>\n<pre><strong>$ sudo groupadd -r wildfly<\/strong><\/pre>\n<pre><strong>$sudo useradd -r -g wildfly \/opt\/wildfly -s \/sbin\/nologin wildfly<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"82\" class=\"wp-image-12653\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-16.png 807w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-16-300x30.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-16-768x78.png 768w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/strong><\/p>\n<h2><strong>Step 4:Download and Install Wildfly<\/strong><\/h2>\n<p>Next, download the Wildfly archive file from the official site. At the time of this writing, the latest version of Wildfly is 25.0.1. Run the following wget command to download the file to the \/tmp directory<\/p>\n<pre><strong>$ cd \/tmp<\/strong><\/pre>\n<pre><strong>$ wget wget https:\/\/github.com\/wildfly\/wildfly\/releases\/download\/25.0.1.Final\/wildfly-25.0.1.Final.tar.gz<\/strong><\/pre>\n<p>Next, extract the downloaded archive file using the command:<\/p>\n<pre><strong>$ tar xvf wildfly-20.0.1.Final.tar.gz<\/strong><\/pre>\n<p>Once complete, move the wildfly folder to the \/opt directory as shown:<\/p>\n<pre><strong>sudo mv wildfly-20.0.1.Final\/ \/opt\/wildfly<\/strong><\/pre>\n<p>Next, change the directory permissions to the user and group wildfly.<\/p>\n<pre><strong>$ sudo chown -RH wildfly: \/opt\/wildfly<\/strong><\/pre>\n<h2><strong>Step 4: Configure Systemd<\/strong><\/h2>\n<pre>Next, create a WildFly directory which will store the configuration files in the \/etc\/ directory. Execute the command:<\/pre>\n<pre><strong>$ sudo mkdir -p \/etc\/wildfly<\/strong><\/pre>\n<p>Then copy the Wildfly configuration file to the folder created above. Run:<\/p>\n<pre><strong>$ sudo cp\/opt\/wildfly\/docs\/contrib\/scripts\/systemd\/wildfly.conf \/etc\/wildfly\/<\/strong><\/pre>\n<p>Next, run the following command to copy the launch.sh file to the \/opt directory<\/p>\n<pre><strong>$ sudo cp \/opt\/wildfly\/docs\/contrib\/scripts\/systemd\/launch.sh \/opt\/wildfly\/bin\/<\/strong><\/pre>\n<p>Then, make the scripts in the \/etc\/wildfly\/bin directory executable as shown:<\/p>\n<pre><strong>$ sudo sh -c 'chmod +x \/opt\/wildfly\/bi n\/*.sh'<\/strong><\/pre>\n<p>Finally, copy Wildfly systemd file to the \/etc\/systemd\/system\/ directory as shown below:<\/p>\n<pre><strong>$ sudo cp \/opt\/wildfly\/doc\/contrib\/scripts\/systemd\/wildfly.service \/etc\/systemd\/system<\/strong><\/pre>\n<p>Now start and enable the Wildfly service on your machine. Run the commands;<\/p>\n<pre><strong>$ sudo systemctl start wildfly.service<\/strong><\/pre>\n<pre><strong>$ sudo systemctl enable wildfly.service<\/strong><\/pre>\n<p>To verify Wildfly is up and running, execute the following command:<\/p>\n<pre><strong>$ sudo systemctl status wildfly.service<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"254\" class=\"wp-image-12654\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-17.png 905w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-17-300x84.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-17-768x216.png 768w\" sizes=\"auto, (max-width: 905px) 100vw, 905px\" \/><\/strong><\/p>\n<h2><strong>Step 5: Configure Wildfly<\/strong><\/h2>\n<p>Now that you have the Wildfly service running successfully on your machine, you need to create an admin user account to manage the web console. Run the console<strong>:<\/strong><\/p>\n<pre><strong>$ sudo \/opt\/wildfly\/bin\/add-user.sh<\/strong><\/pre>\n<p><strong>A <\/strong>prompt will appear. Type a and hit enter to proceed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"111\" class=\"wp-image-12655\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-18.png 732w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-18-300x45.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/p>\n<p>Next, create a new username and password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"363\" class=\"wp-image-12656\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-19.png 905w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-19-300x120.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-19-768x308.png 768w\" sizes=\"auto, (max-width: 905px) 100vw, 905px\" \/><\/p>\n<p>Type yes for the rest of the options to proceed with the installation.<\/p>\n<p>With the installation complete, fire up your browser and navigate to the address shown below to verify that WildFly is successfully installed on your local system.<\/p>\n<p><a href=\"http:\/\/localhost:8080\">http:\/\/localhost:8080<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1051\" height=\"693\" class=\"wp-image-12657\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-20.png 1051w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-20-300x198.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-20-1024x675.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-20-768x506.png 768w\" sizes=\"auto, (max-width: 1051px) 100vw, 1051px\" \/><\/p>\n<p>By default, the server console can only be accessed on localhost. To allow remote connections, edit the configuration files as shown:<\/p>\n<pre><strong>$ sudo nano \/etc\/wildfly\/wildfly.conf<\/strong><\/pre>\n<p>Append the line below to the file:<\/p>\n<pre><strong>WILDFLY_CONSOLE_BIND=0.0.0.0<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"356\" class=\"wp-image-12658\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-21.png 886w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-21-300x121.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-21-768x309.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/strong><\/p>\n<p>Then, run the following script to create an account to login to the server console<\/p>\n<pre><strong>$ sudo sh \/opt\/wildfly\/bin\/jboss-cli.sh --connect<\/strong><\/pre>\n<p>You will be required to provide the username and password you created above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"59\" class=\"wp-image-12659\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-22.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-22-300x23.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<p>Next, open the launch script<\/p>\n<pre><strong>$ sudo nano \/opt\/wildfly\/bin\/launch.sh<\/strong><\/pre>\n<p>Modify the lines below in the script as shown below:<\/p>\n<pre><strong>$WILDFLY_HOME\/bin\/domain.sh -c $2 -b $3 -bmanagement $4<\/strong><\/pre>\n<pre><strong>$WILDFLY_HOME\/bin\/standalone.sh -c $2 -b $3 -bmanagement $4<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"370\" class=\"wp-image-12660\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-23.png 722w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-23-300x154.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/strong><\/p>\n<p>Close and save the file.<\/p>\n<p>Now, restart the wildfly service for the changes to take effect. Run:<\/p>\n<pre><strong>$ sudo systemctl restart wildfly.service<\/strong><\/pre>\n<p>Next, open the systemd unit file and edit the line as shown by running the commands below.<\/p>\n<pre><strong>$ sudo nano \/etc\/systemd\/system\/wildfly.service<\/strong><\/pre>\n<p>Append the line <strong>$WILDFLY_CONSOLE_BIND<\/strong> to the line below<\/p>\n<pre><strong>ExecStart=\/opt\/wildfly\/bin\/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND<\/strong><\/pre>\n<p>Save the file and exit.<\/p>\n<p>Next, restart the systemd and the Wildfly service. Run:<\/p>\n<pre><strong>$ sudo systemctl daemon-reload<\/strong><\/pre>\n<pre><strong>$ sudo systemctl restart wildfly.service<\/strong><\/pre>\n<p>You can now access the admin console on the address.<\/p>\n<p><strong>$ localhost:9900<\/strong><\/p>\n<p>You will be prompted to sign in.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1222\" height=\"677\" class=\"wp-image-12661\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-24.png 1222w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-24-300x166.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-24-1024x567.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-24-768x425.png 768w\" sizes=\"auto, (max-width: 1222px) 100vw, 1222px\" \/><\/strong><\/p>\n<p>After logging in successfully, you will be taken to the following dashboard:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1223\" height=\"658\" class=\"wp-image-12662\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-25.png 1223w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-25-300x161.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-25-1024x551.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-25-768x413.png 768w\" sizes=\"auto, (max-width: 1223px) 100vw, 1223px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>You have successfully installed WildFly on Ubuntu 20.04.<\/p>","protected":false},"excerpt":{"rendered":"<p>WildFly (formerly JBoss) is a lightweight, quick, and highly optimized application server that lets you build outstanding Java applications. WildFly is a cross-platform and comes with a sophisticated&hellip;<\/p>","protected":false},"author":1,"featured_media":12786,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[100,732],"class_list":["post-12652","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-ubuntu-20-04","tag-wildfly"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=12652"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12652\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/12786"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=12652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=12652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=12652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}