> For the complete documentation index, see [llms.txt](https://docs.percona.com/percona-xtrabackup/9.7/llms.txt).

# Clean up

In this document you’ll learn how to:

- Exit the MySQL command client shell and the Docker container
- Remove the Docker container and the Docker image
- Remove the Docker volume.

The steps are as follows:

1. To exit the MySQL command client shell in `psmysql2` container, we use `exit`. You can also use the `\q` or `quit` commands. The execution of the statement also closes the connection.

   ```sql
   exit
   ```

   Expected output

   ```text
   Bye
   ```

1. Remove docker containers and images, if you no longer need docker containers / images or want to free up disk space. To remove a docker container, use the command `docker rm` followed by the container name or the container ID. To remove a docker image, use the command `docker rmi` followed by the image ID or name and the tag. The example uses the `-f` option to force the removal.

   - Remove `psmysql2`, `psmysql` and `pxb` Docker containers:

     ```shell
     docker container rm psmysql2 -f
     ```

     Expected output

     ```text
     psmysql2
     ```

     ```shell
     docker container rm psmysql -f
     ```

     Expected output

     ```text
     psmysql
     ```

     ```shell
     docker container rm pxb -f
     ```

     Expected output

     ```text
     pxb
     ```

   - Remove `percona/percona-server:9.7.1` and `percona/percona-xtrabackup:9.7.1` Docker images

     ```shell
     docker image rmi percona/percona-server:9.7.1
     ```

     Expected output

     ```text
     Untagged: percona/percona-server:9.7.1
     ```

     ```shell
     docker image rmi percona/percona-xtrabackup:9.7.1
     ```

     Expected output

     ```text
     Untagged: percona/percona-server:9.7.1
     Untagged: percona/percona-server@sha256:4944f9b365e0dc88f41b3b704ff2a02d1459fd07763d7d1a444b263db8498e1f
     Deleted: sha256:b2588da614b1f382468fc9f44600863e324067a9cae57c204a30a2105d61d9d9
     Deleted: sha256:1ceaa6dc89e328281b426854a3b00509b5df13826a9618a09e819a830b752ebd
     Deleted: sha256:77471692427a227eb16d06907357956c3bb43f0fdc3ecf6f8937e1acecae24fe
     Deleted: sha256:8db06cc7b0430437edc7f118b139d2195cb65e2e8025f9a4517d16778f615384
     Deleted: sha256:e5a57a2fafec4ab9482240f28927651d56545c19626e344aceb8be3704c3c397
     Deleted: sha256:f86198f39b893674d44d424c958f23183bf919d2ced20e1f519714d0972d75ed
     Deleted: sha256:db9672f7e12e374d5e9016b758a29d5444e8b0fd1246a6f1fc5c2b3c847dddcf
     ```

1. Remove docker volume if a container does not use the volume, and you no longer need it

   Remove `backupvol` and `myvol2` Docker volumes:

   ```shell
   docker volume rm backupvol
   ```

   Expected output

   ```text
   backupvol
   ```

   ```shell
   docker volume rm myvol2
   ```

   Expected output

   ```text
   myvol2
   ```

## Next step

[Next steps](https://docs.percona.com/percona-xtrabackup/9.7/quickstart-next-steps.md)
