# Server lifecycle events

This topic describes Datalore server lifecycle events, such as restart or shutdown.

> **Note:**
> None of the currently running computations and notebook agents will be affected by Datalore restart. Once the connection is lost, the agent will attempt to re-establish the connection back, unless either it succeeds or the agent is terminated manually.

Kubernetes:

As Datalore's pod is controlled by a StatefulSet, there are two ways to restart Datalore:

* Do a rollout restart: ``` kubectl rollout restart sts datalore ```

* Delete the pod manually: ``` kubectl delete pod/datalore-0 kubectl wait pod/datalore-0 --for=delete --timeout=600s ```

> **Tip:**
> When using the second approach, the pod will be automatically redeployed by Kubernetes, as the StatefulSet replicas condition will not be met once the original pod is deallocated.

Docker:

As the Datalore deployment is controlled by Docker Compose, use the native Compose mechanism for the lifecycle events.

```

# start server
docker compose up

# gracefully stop and start back
docker compose restart

# gracefully stop
docker compose stop
```

