# Uninstall dropshelf

Source: https://dropshelf.ai/docs/self-host/operate/uninstall

Remove a dropshelf Helm release, then the Secret, certificate, bucket, database and DNS records it leaves behind.

Uninstall dropshelf when you retire an instance or start over. `helm uninstall` removes the release,
but the data and the resources you created yourself stay until you remove them.

## Prerequisites [#prerequisites]

- `kubectl` and `helm` pointed at the cluster.
- A [backup](/docs/self-host/operate/backup), if you might need the drops again.

## Remove the release [#remove-the-release]

To remove the release, uninstall it from its namespace:

```bash
helm uninstall dropshelf -n dropshelf
```

This removes the Deployment, the Service, the Ingress, the ConfigMap, the ServiceAccount and the
other objects the chart rendered. Every drop stops answering.

## Remove what stays behind [#remove-what-stays-behind]

The release leaves these behind:

- **The Secret `dropshelf-secrets`**, which you created before the install.
- **The TLS Secret `dropshelf-tls`**, when cert-manager issued the certificate. Helm removes the
  Certificate, but cert-manager keeps the Secret it wrote.
- **Hook leftovers**: the ConfigMap `dropshelf-config-migrate` when `migrations.mode` is `job`, and a
  `dropshelf-migrate`, `dropshelf-demo` or `dropshelf-test-readyz` that failed. Helm does not track
  the objects its hooks create.
- **The bucket** with every drop's files, and **the Postgres database** with every drop, member and
  comment.
- **The DNS records** for `drop.example.com` and `*.drop.example.com`, and the OIDC client at your
  identity provider.

If nothing else runs in the `dropshelf` namespace, delete the namespace to remove every Kubernetes
leftover at once:

```bash
kubectl delete namespace dropshelf
```

Otherwise, delete each one by name:

```bash
kubectl -n dropshelf delete secret dropshelf-secrets dropshelf-tls --ignore-not-found
kubectl -n dropshelf delete configmap dropshelf-config-migrate --ignore-not-found
kubectl -n dropshelf delete job dropshelf-migrate dropshelf-demo --ignore-not-found
kubectl -n dropshelf delete pod dropshelf-test-readyz --ignore-not-found
```

## Delete the data [#delete-the-data]

<Callout type="warn">
Deleting the bucket and the database cannot be undone. Every drop, version, comment and member record
is gone, and no dropshelf command brings it back.
</Callout>

To delete the database, connect with `psql` as a user allowed to drop it:

```sql
DROP DATABASE dropshelf;
```

Delete the bucket with your cloud provider's console or CLI. If the bucket holds other data, delete
only the objects under the `prefix` set in your storage configuration. A bucket with versioning keeps
earlier copies of every object, so delete those versions too.

Then remove the DNS records at your DNS provider, and the OIDC client at your identity provider.

## Confirm it worked [#confirm-it-worked]

`helm list -n dropshelf` no longer shows `dropshelf`, and `https://drop.example.com` no longer
answers.

## Next steps [#next-steps]

- [Back up and restore](/docs/self-host/operate/backup)
- [Install with Helm](/docs/self-host/install/helm)
- [Object storage](/docs/self-host/configure/storage)
