Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep springboot application alive after exiting putty

Tags:

java

maven

tomcat

I am running my spring boot application on my server using putty via command mvn spring-boot:run and it runs only when I have open ssh session. Is it possible to keep application alive after I disconnect session? Or do I have to make executable war file and deploy to installed tomcat server on my ubunntu 14.04. I know others ways to deploy boot apps but I want to know if it is possible in my approach.

like image 822
MagGGG Avatar asked Dec 11 '22 14:12

MagGGG


2 Answers

You can run the command in the background and with nohup like so

nohup mvn spring-boot:run &

When you do this, the application runs in background even after you close ssh session.

like image 118
M S Avatar answered Dec 13 '22 04:12

M S


In putty, you need to use nohup mvn spring-boot:run > spring-log.txt & to run the command in the background and this generates the spring-log.txt file.

like image 21
developer Avatar answered Dec 13 '22 03:12

developer