Running Spring boot application as a service (linux)

You can easily make your application run as a service on your hosts.
If you have few machines, you can use simple init.d service

To make your built application start as a service, all you need to do is :

sudo link -s /path/to/your/app/yourapp.jar /etc/init.d/yourappservice

And directly after that you can start the yourappservice as you have the service configured

./etc/init.d/yourappservice start

That’t it!

On more complicated environments (many instances, or cloud env) you should probably use supervisor to control your services.
You can check it out here : http://supervisord.org/running.html#adding-a-program

Leave a Reply