How to add Wildfly 10 as service in Ubuntu

When you need to distribute Wildfly on an Ubuntu-server you have to:

Install JDK

Download Wildfly<
and copy wildfly to /opt
sudo cp wildfly-10.1.0-Final /opt/wildfly-10.1.0-Final

Create an user for Wildfly
sudo adduser --no-create-home --disabled-password --disabled-login wildfly

Make a symbolic link to new folder:
ln -s /opt/wildfly-10.1.0-Final /opt/wildfly

Change ownership of directory and symbolic link to wildfly:
sudo chown -R wildfly:wildfly /opt/wildfly*

Now we copy the provided init-Files from Wildfly to /etc/init.d
sudo cp /opt/wildfly/docs/contrib/scripts/init.d/ /etc/init.d/wildfly

Run update-rc.d to ensure wildfly starts on reboot:
sudo update-rc.d wildfly defaults

Copy the wildfly.conf file to /etc/default:
sudo cp /opt/wildfly/docs/contrib/scripts/init.d/wildfly.conf /etc/default/wildfly

nano /etc/default/wildfly

Uncomment and/or Edit the following lines:
JBOSS_CONFIG=standalone.xml — Change configuration file name in order to run full Java EE 7 Stack
STARTUP_WAIT=120 –Probably overkill wait time
SHUTDOWN_WAIT=120 –Probably overkill wait time

Try out the init.d and wildfly.conf settings and make sure the service can start:
service wildfly start

To stop:
service wildfly stop

Don’t foget to run the – script
Wildfly is listening only to localhost per default. To change this refer to bgasparotto – Enable Wildfly remote access

:9990 (it’s better not to enable the remote access for the management console)

gesker – WildFly 10 on Ubuntu 15.10
bgasparotto – Enable Wildfly remote access

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to How to add Wildfly 10 as service in Ubuntu

  1. tsvetatsvetov says:

    Not working at all…

    • Sandor says:

      Check the JAVA_HOME path at /etc/default/wildfly.conf. Uncomment it and locate the root JDK directory. If it doesn’t help, run ‘systemctl status wildfly.service’ OR check the log file at /var/log/wildfly/server.log

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s