Running Spring Boot applications as a Service is pretty simple and this tutorial will show how to do it in just 5 minutes.

In order to install your Spring Boot application as a service, you need to add an additional item into the plugin you are using to build Spring Boot. For example, if you are using Maven to build your project, then add to the configuration section the executable stanza as in this example:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
   <!-- ...all the previous code -->

Much the same way, you can make executable your application if you are using the build.gradle Gradle configuration:

apply plugin: 'spring-boot'
springBoot {
executable = true

Now, when you package your application with the following:

$ ./mvnw clean package -DskipTests=true

You can execute the JAR directly:

$ target/demoapp.war

So, if you are running a Linux environment you can just bind it to the /etc/init.d

$ ln -s /opt/demoapp.war /etc/init.d/demoapp

Then you can start your application with the following:

$ service demoapp start

That's all! Enjoy running Spring Boot apps as a Service!