# Redeploy and delete

Source: https://openpanel.sh/docs/projects/lifecycle

Roll a service out again to restart it or apply its settings, and delete a service or a project.

A service runs from its current deployment until you deploy it again or delete it. There is no separate stop, start or restart yet.

## Redeploy [#redeploy]

Deploying again makes a new deployment of the service as it is set now: its image and tag, or its branch, with its current settings and variables. The new replicas start beside the old ones, and the old ones stop once the new ones are ready, so a redeploy is also how you restart a service without downtime.

<Tabs items={["Console","CLI","API"]}>
<Tab value="Console">
Open the project and click the service on the canvas. On its **Deployments** tab, click **Redeploy** beside the newest deployment, or **Deploy** on its **Overview** tab.
</Tab>

<Tab value="CLI">
```sh
openpanel deploy web --project shop --wait
```
</Tab>

<Tab value="API">
```sh
curl -X POST https://openpanel.sh/api/v1/services/$SERVICE_ID/deployments \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"
```
</Tab>
</Tabs>

A service with a volume stops before its new replica starts, so it is down for a moment. To go back to an earlier version, [roll back](/docs/deploy/rollbacks).

## Stop, start and restart [#stop-start-and-restart]

These are not offered yet: no command or API call stops a service and keeps it. Until they are:

- to restart a service, redeploy it;
- to stop it for good, delete it.

## Delete a service [#delete-a-service]

Deleting a service deletes its volumes, variables, deployments and domains, and its servers stop its containers. It needs admin on the project and cannot be undone.

<Tabs items={["Console","CLI","API"]}>
<Tab value="Console">
Open the project and click the service on the canvas. On its **Settings** tab, click **Delete service** at the bottom and confirm.
</Tab>

<Tab value="CLI">
```sh
openpanel services delete web --project shop
```

The CLI asks you to confirm. Add `--yes` where nobody is at the terminal.
</Tab>

<Tab value="API">
```sh
curl -X DELETE https://openpanel.sh/api/v1/services/$SERVICE_ID \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"
```

The answer is `204 No Content`.
</Tab>
</Tabs>

The data in the service's volumes is not wiped from its server. See [Volumes](/docs/volumes#remove-a-volume).

## Delete a project [#delete-a-project]

Deleting a project deletes every service in it the same way. See [Create a project](/docs/projects/create#delete-a-project).

## Who can do what [#who-can-do-what]

| Action | Access needed on the project |
|---|---|
| Redeploy | deploy |
| Delete a service | admin |
| Delete a project | admin |

Every deploy and deletion is written to the organization's [audit log](/docs/monitoring/audit-log), with who did it.