Deploy Your SpringBoot App as a Service in Under-a-Minute!

Sanjeev Pandey
1 min readSep 14, 2022

If you want to do a quick deployment of your spring-boot application as a service on Linux, here’s how you can quickly do it through a fully executable jar.

Step 1

Create your service file under `/lib/systemd/system/` as `/lib/systemd/system/myapp.service`

nano myapp.service

Add this content:

Description=myapp port 8086
ExecStart=java -jar /home/ubuntu/myapp/target/myapp-1.0.jar --server.port=8086

Specifying ‘- - server.port=8086’ in above file is optional, you can specify this at runtime as well.

Step 2

Reload daemon and enable the service:

systemctl reload daemon
systemctl enable myapp

Check status by testing the app or by checking the service status:

systemctl status myapp

Prerequisites & Tips:

1. Use ‘sudo’ in front of above commands if you’re not already running as root or are tired of typing password every time.

2. This solution requires you jar to be fully executable. To create a ‘fully executable’ jar with Maven, use the following plugin configuration:



The following example shows the equivalent Gradle configuration:

tasks.named('bootJar') {

3. If your application fails to start, check the log file written to /var/log/<appname>.log for errors.



Sanjeev Pandey

Co-Founder of <indvideotech> community for Video Engineers in India. Solution Architect, Full-Stack Developer, Ad Insertion Evangelist, and Think Tank.