How to deploy an application remotely with JBoss AS ?

Let’s learn how to deploy an application remotely using the latest version of WildFly or JBoss EAP. We will also cover this process for older JBoss installations.

Deploying an application remotely with WildFly

If you are running WildFly there are several choices for deploying your application remotely.  You can opt for:
  • Web Administration Console
  • Command Line Interface
1. Firstly, you need to add a management user so that you can access the application server remotely. Launch the script with username and password:
./ -m -u admin -p password1!

2. Next, connect to the Web Administration console (http://host:9990/console).

3. There, once authenticated, move to the “Deployments” tab and click on the “+” button:
jboss deploy remotely
4. Choose the “Upload Deployment” option and upload your application.
5. Finally, you will be requested to enable or not the application that will be eventually uploaded:
If you prefer the Command Line Interface, you can connect on the remote host which is running the remote controller

Connected to standalone controller at
[[email protected]:9990 /]

Now to deploy an application, all that’s necessary is to type in deploy and the path to the package (the tab-completion will help to navigate the filesystem), e.g.

[[email protected]:9990 /] deploy ../test-app.war   
 'test-app.war ' deployed successfully.

To undeploy this application its name has to be passed in as the argument to undeploy (if you type in undeploy, the tab-completion will list all the deployed applications and help complete the deployment name), e.g.

[[email protected]:9990 /] undeploy test-app.war
 Successfully undeployed test-app.war.

If you want to learn more about deploying applications on WildFly, we recommend checking this article: How to deploy applications on WildFly

JBoss AS 5-6

If you are running a JBoss AS release 5.1.x/6.x, there’s a web application named admin-console which is going to replace the jmx-console for monitoring the application server.You can launch it this way:
(Replace the xx.xx.xx.xx with your IP Address)

Now, in order to deploy an application select in the left tree view the type of Application you wish to deploy (Web, EJB or other) and click on the folder node.

jboss deploy application remotely

In the central frame just select “Add a new resource” and upload your application.

JBoss AS 4

JBoss AS 4 does not ship with a friendly management console, however you can use the twiddle  command line utility to achieve some advanced administration tasks.
We can deploy stuff with:

./ -u admin -p <password -s invoke "jboss.system:service=MainDeployer" deploy /tmp/sample.war

and we can see it is deployed with:

./ -u admin -p <password> -s query 'jboss.web.deployment:*'