Lab 3: On-Premises Deployments (Optional)


This Lab is considered optional to the completion of the API-Led Connectivity Workshop.

Using Runtime Manager, you can register and set up the properties of servers, server groups, and clusters that reside on-premises. Once these are set up, you can select them as the deployment target for your applications, as an alternative to deploying to CloudHub.

Runtime Manager provides a single management interface where you can manage applications running in the cloud, on local servers, on server groups that are on-premises within your data center, or on clusters of servers. Applications that are on-premises run on Mule runtime instances on a single server or on a group of servers.

In this Lab you will install and run the Mule Enterprise Edition Runtime locally, to simulate a standalone on-premises deployment. You’ll then be able to use Runtime Manager to deploy and manage the api-omni-channel-complete-v4.0 application you used in the rest of Module 7.

Directions for completing this Lab are not as specific as others, due to differences between Operating Systems and environments. If you run into a problem, please ask the MuleSoft team leading the Workshop for help.

The lab will consist of several steps

Step 1: Download the Runtime

In this step, you will download and extract the standalone version of the Mule Enterprise Edition Runtime.

If you are using a MuleSoft-provided Workshop RDP instance, Step 1 has been done for you. The Mule Runtime is already downloaded. Unzip the file into the directory C:\Users\workshop\mulesoft. Once the folder is unzipped go directly to Step 2.
  1. First, Download the Mule Enterprise Edition Runtime.

    module7 lab3 browser mule download

    MuleSoft makes available trial versions of its Enterprise Edition runtime for the purpose of evaluation. Though perfect for exploring the myriad uses of Mule and Anypoint Studio, the trial license for Enterprise limits usage of the runtime to 30 days.

    Before using a Mule Enterprise Edition Runtime in a production environment, you will need to obtain and install an Enterprise license.

  2. Now extract the archive you just downloaded. It already contains a folder (e.g. mule-enterprise-standalone-4.3.0-20210304/) so just move that folder to the path where you want your Mule Runtime to reside. For example:

    • Windows: C:\Users\<username>\mulesoft\mule-enterprise-standalone-4.3.0-20210304

    • Mac or Linux ~/mulesoft/mule-enterprise-standalone-4.3.0-20210304

  • For the rest of this Lab, instructions will refer to the path to the Mule runtime as simply <MULE_HOME>. In production installs you would define MULE_HOME as a variable.

  • For Workshop RDP instance users, <MULE_HOME> is C:\Users\workshop\mulesoft\mule-enterprise-standalone-4.3.0-20210304

You have installed the Mule EE Runtime. That’s all there is to it.

Step 2: Register your Runtime

In this step you will register your new Mule instance with Anypoint Runtime Manager via the Runtime Manager Agent. This is done by executing a command, which will be provided by Runtime Manager.

The Runtime Manager Agent is a Mule plugin that exposes the Mule Agent API as a service, allowing users to securely manipulate and monitor Mule Runtime instances from external systems such as Anypoint Runtime Manager.

In Runtime Manager, the term "Server" is used to mean a Mule runtime instance in a location other than CloudHub.

  1. Open Anypoint Runtime Manager and click on the Servers section on the left.

    module7 lab3 ap servers
  2. If your Environment already has at least one Server deployed, you will first need to click on the "Add Server" button.

    module7 lab3 ap servers add
  3. After clicking "Add Server", or if there are no other Servers in the Environment, you will see a command with a registration token (redacted in the example below) and a placeholder server-name. Copy this line to your clipboard.

    ./amc_setup -H <REDACTED>---54910 server-name

    The amc_setup -H command configures the Runtime Manager Agent to create a hybrid management connection with Runtime Manager. The connection is to a specific environment for a specific business group in Anypoint Platform. This Server registration command will need to be run from the machine where your new Mule runtime resides.

  4. From the command-prompt, use the cd command to navigate to the directory where you unzipped the Mule software distribution and then to the bin directory within.

    • Windows: cd <MULE_HOME>\bin

    • Mac or Linux: cd <MULE_HOME>/bin

  5. Paste the server amc_setup command string into your shell window (or a text editor,) but DO NOT execute it yet. You’ll want to make one or two changes before executing this command.

    Change server-name to a meaningful name for your new Server. For example, you might use your machine’s short hostname. On Windows machines, remove the ./ and append .bat so that the command will run correctly for your platform.

    • Windows: .\amc_setup.bat -H <access_token> <your-hostname>

    • Mac or Linux: ./amc_setup -H <access_token> <your-hostname>

  6. Once you have modified the registration command, press Enter/return to execute it. The command will unpack the Mule Agent and establish a secure communication channel with ARM. If successful, the last few lines of the output should look like this:

    Mule Agent configured successfully

Step 3: Start your Runtime

Your local Runtime will now show up in the Servers area of Anypoint Runtime Manager and, once started, will be available as a deployment target for your Mule applications. So let’s do that now.

If you are using a MuleSoft-provided Workshop RDP instance, there is already a shortcut on the Desktop to start the Mule Runtime. Just double-click it and skip to Step 4.
  1. To start the Mule runtime, use the command appropriate for your platform within the <MULE_HOME>/bin directory

    • Windows: mule.bat

    • Mac or Linux: ./mule

      Mule Runtime Command-line Options
      Parameter Description


      Starts the Mule server in the terminal background.


      Stops the Mule server. The stopping process stops inbound endpoints to process in-flight messages. However due to a timeout duration not all messages are ensured to be processed before final shutdown occurs.


      Restarts the Mule server.


      Displays the status of the Mule server (running or not running) and the process PID if running.


      (Unix only.) Dumps the Mule wrapper’s core to $MULE_HOME/log/mule_ee.log.


      Start Mule in the terminal foreground (console mode). Same as running mule with no parameters.


      (Windows only.) Install Mule as a Windows service.


      (Windows only.) Remove Mule from your Windows services.

  2. Once the runtime starts, on Windows machines, you may get a Windows Security Alert, saying you need to set a firewall exception. You will need to choose which networks and "Allow access".

    module7 lab3 mule win fw

Step 4: Deploy to your Runtime

Now your new on-premises Mule is probably feeling lonely. Let’s give it something to run.

  1. If you don’t already have it open, re-open Anypoint Runtime Manager in your browser

  2. Click the Deploy Application button

  3. Type a new application name for your local application instance

  4. From the box labeled "Deployment Target", choose your new on-premises Mule Runtime

    module7 lab3 ap arm deploy target
  5. Then on the right, click Choose File and choose select Import file from Exchange.

    A popup window will appear.

  6. Choose Example.

  7. In the Search Box, look for omni channel

  8. Select the omni-channel-api.

  9. Press Select button

    module7 lab3 from exchange
  10. Now you are ready to click the box for "Deploy Application"

    module7 lab3 ready deploy

Step 5: Manage your Application

Once your application has started, you can go view and manage it from Runtime Manager, as with the CloudHub example. With on-premises runtimes, you can deploy more than one application to a runtime, or you can allocate more than one runtime per application by using Server Groups and Clusters.

  1. Visit the Local API Console of your application and submit some results to your get:/products/search flow. It should look and behave identically to the API console running on CloudHub.

  2. Click on the hybrid instance and enter to the dashboard.

    module7 lab3 ap arm hybrid

    This interface should already be somewhat familiar. Take a moment to note similarities and differences in how you can manage your new on-premises Application compared to one on CloudHub Workers.

    module7 lab3 onprem dashboard

    The onprem server gives you the possibility to manage the flow.

  3. Go to the Flow link, placed on the left side of the screen.

    You will find all the API flows.

    module7 lab3 flows
  4. Select get:\products\search:api-config flow and then press the Stop Button.

    module7 lab3 stop flow
  5. Once the flow is stopped, go back to the Local API Console and try to search a product.

    You should see an error similar to this.

    module7 lab3 stop flow console

Step 6: Manage your onprem server

  1. Once you’ve managed your application, you also have the ability to manage the local runtime instance itself. You can do this by visiting the Servers section of Runtime Manager.

    module7 lab3 ap servers pane
  2. As with the Application management, you just click on the row containing your Server’s name and select Manage Server

    module7 lab3 ap arm manage server
  3. From this page, you can access information about your on-premises Runtime, as well as configure plugins, set server properties, and view alerts. Notice your deployed Application is also shown below.

    module7 lab3 ap arm server view
  4. You can view how your new Mule Runtime is performing by visiting the Dashboard on the left

    module7 lab3 ap arm server dash
  5. The Dashboard shows you metrics about how your on-premises Runtime is performing. Additional detail is available on the "Breakdown" tab.

  6. At the bottom of this page, you can also view metrics associated with your Application instance on this Runtime by clicking the circle next to your Application name.

    module7 lab3 ap arm dash app details
  7. When you’re finished, remember to shutdown your local Mule runtime

    1. You can take advantage of our hybrid management approach by simply clicking Shutdown on the top of the Server Dashboard

      module7 lab3 ap arm servers shut
    2. You can also stop your Mule Runtime instance locally from <MULE_HOME>/bin by running ./mule stop or mule.bat stop


In this Lab, within the space of a few minutes, you saw how easy it is to setup an on-premises Mule Runtime. You downloaded, registered, and managed it with minimal overhead. More importantly, you deployed and managed the same Application in CloudHub and on-premises with zero modification and both from the same interface.

Mule Runtime is the engine of Anypoint Platform. Anypoint is the industry’s only unified platform that combines data and application integration across legacy systems, SaaS applications, and APIs with hybrid deployment options for maximum flexibility. Connect anything, change everything.

In this lab, we completed these steps

If you’d like to learn more

Congratulations! You have completed Lab 3.

Please proceed to Lab 4