> For the complete documentation index, see [llms.txt](https://docs.portainer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.portainer.io/faqs/installing/your-portainer-instance-has-timed-out-for-security-purposes-error-fix.md).

# "Your Portainer instance has timed out for security purposes" error fix

You may encounter the following message in your Portainer logs after installation:

```
the Portainer instance timed out for security purposes, to re-enable your Portainer instance, you will need to restart Portainer
```

#### Cause

When you first install Portainer, if you do not log in and complete the initial setup within 5 minutes the Portainer service within the container stops. This is a security measure to prevent a malicious user taking over a fresh Portainer installation and configuring it themselves. To avoid this happening, we suggest completing the initial setup within 5 minutes of starting the Portainer container for the first time.

#### Resolution

If you are receiving the above error message, you can resolve this by stopping and restarting the Portainer container. This will give you another 5 minutes to complete the initial setup.

{% tabs %}
{% tab title="Docker" %}

```
docker stop portainer
docker start portainer
```

In some cases you may also need to remove the Portainer container with `docker rm portainer` then start it again with the `docker run` command from the installation instructions.
{% endtab %}

{% tab title="Kubernetes" %}

```
kubectl -n portainer rollout restart deployment/portainer
```

{% endtab %}
{% endtabs %}

If you are receiving this message on a previously working Portainer installation, check to ensure your `portainer_data` volume is correctly mounted to the Portainer container and that it contains your Portainer configuration files. If your `portainer_data` volume is not mounted correctly or the configuration files are missing, Portainer assumes you are performing a fresh installation and will act accordingly.
