Autorestart of blynk local server in raspberry pi wont work

Hi everyone, I need some help here
I recently install blynk local server on raspberry pi 3 and run it but the problem is that if I close the terminal the server also disconnect(goes offline)
And also the autorestart of server if raspberry pi 3 is rebooted wont work
I follow the instruction of opening the crontab -e, and paste it there but still wont auto restart my server when rebooted…

Can somebody has a solution?

To make the process still working after you close the terminal you run the command, you have to put the process to work in background by putting an Ampersand & at the end of the command.

For example:

java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &

not just

java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk

To make the Blynk Server working after restarting the RPi, you need to put the command in /etc/rc.local. You can use nano text editor to do that.

pi@raspberrypi-02:~ $ sudo nano /etc/rc.local


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

# Add this line before exit 0
java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &

exit 0

then press Ctrl-O to Write-Out or Save. Finally Ctrl-X to exit.

Try to restart by

pi@raspberrypi-02:~ $ sudo shutdown -r now