Mule 4 Standalone Runtime (on-premises server)

  • May 05, 2021

In this tech article, you’ll learn how to:

  • Set up Mule 4 Standalone Runtime
  • Deploy an application in Mule Standalone Runtime
  • Connect that application to the Anypoint Platform Runtime Manager

The goal is to deploy an application on a standalone server using Runtime Manager.

Set up Mule 4 Standalone Runtime

  • Download the Mule Standalone runtime.
  • After downloading the runtime, unzip the file.
  • To start the standalone runtime, navigate to the {mule-enterprise-standalone-version}/bin folder and, in the command prompt, run the command “mule.”

Deploy an application in Mule Standalone Runtime

  • Export the project from Anypoint Studio as a Mule application deployable archive and create a jar.
  • Copy this jar file to the {mule-enterprise-standalone-version}/apps folder.
  • Start the runtime by navigating to the bin folder and running the command “mule” in CMD.

As you’ll see, your Mule Standalone Runtime is now running, and the application is deployed with Mule Standalone runtime. You can use and test that application.

Connect Mule Standalone Runtime to Anypoint Platform Runtime Manager

  • Go to Runtime Manager > Servers.
  • Click Add Server, create any name you want for your server and click the Copy command.
  • Navigate to the {mule-enterprise-standalone-version}/bin folder and, in the command prompt, run the command copied from Runtime Manager.

    This command will:
    • Install the Mule agent.
    • Create $MULE_HOME/conf/mule-agent.yml with the configuration options you specified.
    • Establish communication between the Anypoint Platform Control Plane and on-premises Mule 4 Runtime Manager.

As you’ll see, an on-premises server has been added to the Runtime Manager, but it’s not running.

  • To start the server, navigate to the {mule-enterprise-standalone-version}/bin folder and, in the command prompt, run the command “mule.”

Now, if you go to Runtime Manager>Servers, you’ll see that the status of the on-premises server is running.

Deploy application on standalone server using Runtime Manager

  • Go to Runtime Manager and click Deploy Application; you’ll see one more option — your on-premises server is available in the Deployment target.
  • Select that server as the deployment target and add the jar of your application. The application should be deployed successfully.
  • Go to the {mule-enterprise-standalone-version}/apps folder. You’ll see the new folder has been created with the name of application deployed on an on-premises server using Runtime Manager as well as an anchor file for that application.

To stop the standalone runtime, press ctrl+c.

— By: Kishori Patil