---
title: Restart an app from its own code
project: SuperAdmin
version: 9.0
section: recipes
language: en
license: MIT
url: https://totaljs.es/docs/superadmin/9-0/recipes/restart-from-code/
updated: 2026-11-19T08:00:40.593Z
---

# Restart an app from its own code

> Let an app ask SuperAdmin for a restart by creating a file.

An app can ask SuperAdmin to restart it: it creates an empty file named `restart` in its own folder. SuperAdmin checks for this file about once a minute. When it finds it, it removes the file and restarts the app.

This works in debug and in release mode.

Your app can create the file with any file function of Node.js. From the shell on the server:

```bash
touch /www/www/example_com-shop/restart
```

Replace `example_com-shop` with the folder of your app. The folder of `shop.example.com` is `example_com-shop`; [File browser](../../guides/file-browser/) and the [Folders and files](../../reference/folders-and-files/) table help you find it.

The restart happens within about a minute. The process id in `superadmin.pid` changes when it is done.
