# Restarting the app

**URL:** <https://community.plotly.com/t/restarting-the-app/67807>\
**Category:** Dash Python\
**Created:** [September 9, 2022, 1:40pm UTC](https://community.plotly.com/t/restarting-the-app/67807 "2022-09-09T13:40:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispWizard](https://avatars.discourse-cdn.com/v4/letter/w/ee7513/32.png) [@wispWizard](https://community.plotly.com/u/wispWizard)\
**Post date:** [September 9, 2022, 1:40pm UTC](https://community.plotly.com/t/restarting-the-app/67807/1 "2022-09-09T13:40:34Z")

</div>

We are trying to restart the dash app via code. Our software runs the dash app in a thread as we have lots of other things going on in our **main** that we use to monitor if any of our other threads crash or restart the whole system automatically in case of an update. Unfortunately dash is the only thing we are unable to restart successfully. We’ve tried moving it to a process without luck. We can’t move it to the **main** as once you start the server no code executes beyond that so we would be unablemonitor our system or to restart our software. We have searched high and low for a solution to no avail.

We use the command os.execl(sys.executable, os.path.abspath( **file** ), \*sys.argv) in python. We have tried others as well.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Badhon](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/badhon/32/21212_2.png) [@Badhon](https://community.plotly.com/u/Badhon)\
**Post date:** [October 23, 2022, 9:20am UTC](https://community.plotly.com/t/restarting-the-app/67807/2 "2022-10-23T09:20:04Z")

</div>

@wispWizard I am trying to do the same but no luck. Any idea how to restart dash app with code?

---

<div class="post-metadata">

**Author:** ![denisor](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denisor](https://community.plotly.com/u/denisor)\
**Post date:** [January 5, 2023, 12:39pm UTC](https://community.plotly.com/t/restarting-the-app/67807/3 "2023-01-05T12:39:28Z")

</div>

I am also trying to do this, did you have any luck??

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 5, 2023, 3:48pm UTC](https://community.plotly.com/t/restarting-the-app/67807/4 "2023-01-05T15:48:59Z")

</div>

Hello @denisor,

What you could do is have the dash app associated with a supervisor, then you should be able to restart from a python command. As gunicorn is normally used to cater the server. 🙂

> <https://stackoverflow.com/questions/89228/how-do-i-execute-a-program-or-call-a-system-command>
