Run Google Chrome 24/7

Posted November 4, 2019 2.8k views
Ubuntu 18.04

I want to run Google Chrome 24/7 because there is an extension I need to use.

I have installed XFCE and TightVNC as described here:

and is working fine, I can login, see the desktop, execute chrome, my extension is running, everything is ok.

The problem is if I kill the vncserver then Chrome stops working (I think this is because vncserver is starting xfce?)

I’m very noob on these things please could you tell me what is the best way to keep Google Chrome open 24/7 (even if the system restarts or Chrome stops working).

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @enriquepiatti,

You can create a bash script to check if the service vncserver is actually running. If the service is not running start it.

You can see if a service is running with the following

systemctl show -p ActiveState NameOfService

It will show if the service is active,inactive or dead. Based on this output, you can actually decide whether to try and start it or leave as it is.

Once you create the bash script, add it as a cron job to be executed every minute. This should be enough to solve your problem.


  • Thanks I will try it, that will work even if I close the SSH terminal right? I was thinking in adding a @reboot line to crontab too, but what will be the owner in that case? I mean, if the system is reboot, the cron will run the @reboot line with “root” instead of my user?

    • Hi @enriquep,

      Yes this will work even if you close your SSH session.

      As for the reboot option, this is not a good idea as it will reboot it every time, even when the service is active.

      As for the user itself, you can create the cron to be executed under the user you wish like

      crontab -u UserName -e