Knowledge Base
MilesWeb / Cloud Servers

Hosting Spring Boot Standalone and Clustered Java Apps with MilesWeb Cloud

Approx. read time : 10 min

The article comprises of the below points:

MilesWeb PaaS renovates the process of application deployments on the cloud into much easy and universal as possible. Therefore, we are happy to introduce the next deployment app within a family of certified Java-powered stacks – Spring Boot server for standalone and clustered applications on microservices.

The MilesWeb’s Spring Boot stack template allows you to run various Java-based applications within the cloud via user-friendly graphic interface or automation scripts. The Java project types that can be hosted within this server are as below:

JAR – for separate Java apps or stateless microservice instances, created using Dropwizard, Spring Boot or Spark frameworks.

WAR – for web applications with embedded servlet container.

With this, Spring Boot enables you in keeping things portable while MilesWeb helps in quickly delivering applications to production and their comprehensive management via API, GUI or Cloud Scripting.

Steps to Create Spring Boot Environment

1. Login to your MilesWeb cloud dashboard and create a New Environment – The same-named button is used to launch topology wizard. Then go to the Java language tab and select Spring Boot template under the application server layer at the left-side panel as below. Set the number of allocated resources, give the environment name and click Create to proceed further.

Versions Compatibility:

  • Indication with 1.x-2.x label implies that Jelastic-managed Spring Boot server can run any application, built upon these versions.
  • The current custom Spring Boot stack is provisioned within MilesWeb Cloud Platform.

2. When your new environment is created, you can click Open in browser to launch the pre-installed Hello World application sample.

By doing this, you can ensure your Spring Boot instance is up and running.

Next let’s learn to integrate your custom Java application into the created Spring Boot environment.

Deploying Java Applications to Spring Boot

While launching your Spring Boot project inside MilesWeb cloud powered by Jelastic, it is important to preliminary pack it into an executable archive with all the appropriately compiled classes and related resources inside (including embedded servlet container for handling self-contained applications). The archive types supported are as below:

JAR – the commonly used Java-archive type must either contain a manifest with declared entry point class or being built as all-in “fat” JAR or nested JAR file.

WAR – It is used for deploying applications with embedded servlet container but in particular should be used for JSP-based projects in order to solve known supportability issues within Spring Boot.

ZIP Bundle

ZIP bundle is any executable JAR file by default that is created by Spring Boot and comprises of property files and additional settings. But in case of production deployment, distributing these files outside of the packaged archive is of more convenience. For example, this is possible to be applied to externally configured property files (, application.yml) or logging configurations (, logback.xml).

The application deployment in these cases can be simplified as MilesWeb supports a ZIP bundle deployment that might contain the executable JAR file along with any additional files or directories.

When a ZIP bundle is getting unpacked, MilesWeb processes all the built-in folders for detecting the runnable JAR. In order to consider as an execution point, a JAR file must comprise of the Main-Class declaration inside its META-INF/MANIFEST.MF manifest file. After finding one such JAR file, MilesWeb will run JVM with “java –jar /path/to/jar” parameters within the directory corresponding to the root folder of the deployed archive.


Here is a sample directory structure of a ZIP bundle that can be used for application deployment in MilesWeb Cloud:

If such archive is deployed, MilesWeb will run JVM with the “java -jar lib/my-springboot-app.jar” arguments from a directory that corresponds to the root folder of unpacked archive.

Deployment of Application

Versatile possibilities are offered by MilesWeb for your application deployment into the Cloud, allowing you to select the most preferable one.

  • Manual Deployment

This is most evident and comfortable approach for performing the deployment through the convenient MilesWeb GUI.

For example, try a sample Spring Boot project representing a simple application for storing the messages created by you – it can be either build from the sources or deployed with the already built JAR.

For manual deployment, Upload archive with your app from Deployment Manager and start its deployment by selecting the destination environment (the spring-boot-app created initially in our case).

A new dialog box will open where you need to click on Deploy button for confirmation and wait till the corresponding task is complete.

Note: WAR archives deployment support is provided via Deployment Manager starting from Jelastic 5.0.6. For prior platform versions, this operation can be enabled via Jelastic API or Cloud Scripting.

  • Remote Deploy via CLI

Other way is by using Jelastic CLI for deploying your application to Spring Boot environment that is targeted remotely with the below command:

~/jelastic/environment/control/deployapp –envName spring-boot-app –fileUrl
http://link/to/archive –fileName my_springboot.jar –context ROOT

Checking Logs

After the deployment is done, the system needs to be given more time for running the required services (where delay is dependent on your project complexity) – the live progress of this operation can be tracked through the springboot.log server log.

When the deployment process gets completed, you can access your application web interface (if such is run on the default: 8080 port) similar to the preinstalled Hello World – by clicking Open in browser for your environment.

Ways to Build a Spring Boot Application

You can create an appropriate archive file for your application hosting inside MilesWeb Cloud by using Gradle or Marven build tools.

  • Below is the minimal base for Gradle build script (build.gradle) where parameters in curly braces must be substitutes with your custom values:

Use the command below for building an executable JAR file with this script:

./gradlew clean assemble

You can find the generated archive stored upon{app_name}-{app-version}.jar path.

  • Check the following parameters included in the minimum base for pom.xml Maven project description (where parameters in curly braces must be substituted with your custom values):

Execute the below command to produce an executable JAR with Maven:

mvn clean package

 You will find your app archive at the …target/{app_name}-{app-version}.jar location.

MilesWeb Maven Plugin

MilesWeb Maven plugin allows you to build and deploy application by facilitating it’s delivery to the Cloud. You can integrate it within your Maven project’s pom.xml configuration file and get the ability of building application archive and pushing it instantly to a target environment with a single command.

CI/CD Tools for Java Applications in the Cloud

Dedicated Maven Build Node in the Cloud

If you prefer working via GUI, leveraging dedicated Maven build node provided by the MilesWeb Platform out-of-box.  It is included to an environment alongside with Java application server and can be used for fetching, compiling and deploying application from its sources within a particular remote GIT/SVN repository.

CI/CD Automation Add-On

A special Git-Push-Deploy add-on is also offered by Jelastic for continuously deploying application from GitLab and GitHub repositories via the CI/CD pipeline integrated automatically. This add-on can be useful if your project is under intensive deployment still that implies repetitive commits in numbers. This solution will help you in rebuilding your application automatically and delivering to a target server when any changes are done within its code that will make the newest version available through the corresponding domain in few minutes.

How to Maintain Your Spring Boot Server?

You can perform the majority of basic server management operations via Magento Cloud UI with the appropriate embedded tools, e.g.:

  • use Configuration Manager that is in- built to create or upload new files, delete or edit the existing ones as well as set up mount points and manage exported data from other servers.
  • check the server Logs for getting details on run operations for competent service administration and troubleshooting.
  • track the consumed resources’ Statistics for checking the actual capacities your server requires and define the best approach for their allotment.

In case of more complex maintenance operations, you can use the MilesWeb SSH Gate. You get full root access which helps in remote container management. You need to connect to your account with the SSH key pair generated at the start.

Below are some tips that will help you in working with your Spring Boot server:

  • You can locate your application files in the /opt/shared/apps/APP directory, that is considered as “working” or “current” for Java process.
  • If you want to customize Java Virtual Machine (JVM) configuration parameters, it is possible within /opt/shared/conf/variables.conf file (e.g. to pass any additional arguments to JVM or enable remote debugging).
  • Log files can be inspected via /opt/repo/logs directory.
  • You can consider /opt/shared/home location as home directory.
  • JDK is placed in the /usr/java/default directory.
  • Execute the sudo service cartridge restart command for restarting your application.

Ability to operate server through console can be especially useful while handling a non-web Spring Boot applications.

Automatic Scaling for Spring Boot Server

A real-time elastic scalability is offered by MilesWeb Platform that is available off the shelf for any server.

Automatic Vertical Scaling

Automatic vertical scaling is by default enabled and during load spikes it ensures your service remains available and also, allows you to pay for only the used resources. You just need to decide on maximum resource limit (set with cloudlets) your application may consume and MilesWeb will adjust the maximum memory size (-Xmx) for your application based on these capacities, for example:

  • 8 cloudlets (1GiB RAM) set the maximum heap size to 819 MB
  • 16 cloudlets (2GiB RAM) set the maximum heap size to 1638 MB

For customizing –Xmx or any other JVM options, you need to edit the /opt/shared/conf/variables.conf file either via MilesWeb SSH Gate or Configuration Manager.

Automatic Horizontal Scaling

With automatic horizontal scaling you can adjust the quantity of web and application servers based on the resources consumption of your application. The tunable monitoring triggers implement the scaling functionality based on the usage of a particular resource type:

  • CPU
  • Memory (RAM)
  • Network
  • Disk I/O
  • Disk IOPS

Note: When a server scales out (either manually or with trigger), there is automatic addition of an NGINX load balancer to your environment with pre-configurations for sticky session load balancing. The used balancer stack can be switched to HAProxy, Apache-LB or Varnish with the Change Environment Topology option.

With this, all nodes that are newly added will be created at different hardware servers for ensuring high-availability for your application.

Traffic Encryption with SSL

If there are some complex configurations to be done on your project for requests handling, like load balancing and HTTPS, you can leverage the below options:

When any of these settings are applied to Load Balancer node, it will enable traffic encryption on environment level further removing the need to configure it inside your application. Therefore, the received encrypted traffic will be concluded at the load balancing layer and proxied to application server further in a plain view.

Custom Ports & HTTP/HTTPS Usage Considerations

The maximum Java applications listen to port 8080 on HTTP level by default and so, it is considered as the standard Spring Boot endpoint for HTTP traffic.

When the environment link is searched on Internet, the ports get mapped automatically:

  • internal HTTP port 8080 refers to the port 80
  • secure HTTPS port 8043 refers to the ports 443 and 80

While working on standard HTTP/HTTPS ports, your application is accessible directly via environment URL with the specified corresponding protocol, without the need to enter the appropriate port number.

MilesWeb permits you to expose private container TCP and UDP ports via Endpoints if your applications doesn’t require processing the requests on some custom interface. After this, the corresponding port will be enabled automatically in server firewall settings, further making it accessible worldwide.


Discover more possibilities of the Spring Boot server by trying it out within MilesWeb cloud powered by Jelastic. Simply create your own account and deploy a scalable Java application to run in the cloud with ease.

Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.
Need help? We’re always here for you.
Register Your Free Domain Name