How can I install WildFly 8.0.0.Final as service on Ubuntu Linux?

WildFly includes an init.d script in the bin folder...

Follow this steps:

sudo cp $WILDFLY_HOME/bin/init.d/wildfly-init-debian.sh /etc/init.d/wildfly
sudo cp $WILDFLY_HOME/bin/init.d/wildfly.conf /etc/default/wildfly
sudo adduser --system --group --disabled-login wildfly
sudo chown -R wildfly:wildfly $WILDFLY_HOME
sudo update-rc.d wildfly defaults

Modify /etc/default/wildfly to fit your needs... Test.


In my opinion the best way is to use installation script:

wildfly-8.0.0.Final/bin/init.d/wildfly-init-debian.sh

it will create you init script so if you want WildFly to start automaticly you should execute command:

update-rc.d wildfly defaults

after execution of wildfly-init-debian.sh script


[EDIT]

The accepted answer is outdated, the scripts have been moved to:

The accepted answer is actually technically correct, since the question is about WildFly 8. Thanks @JorSol for pointing that out!

However, I got here while searching for "installing WildFly 10 as a service on Ubuntu", and I am sure others will too.

In WildFly 10, the location of the init.d file has been moved to:

$WILDFLY_HOME/docs/contrib/scripts/inid.d