Most applications running in Docker containers on Unraid will create a folder in your /mnt/user/appdata/
directory. These folders are then mapped as persistent volumes in the Docker container template. As the name persistent volume suggests, these folders aren’t deleted when you kill the app and remove its Docker container. Despite what you may think, this is a good thing and one of Docker’s advantages over traditional installation methods. It allows you to reinstall an application without loosing any of the settings you might have previously adjusted.
The downside of this approach is that when you are frequently testing different Docker containers or are yet undecided on what you want to run on your Unraid system, the directory can overflow with unused folders. To counteract this problem, you could, of course, manually delete the corresponding folder every time you remove a Docker container. Or, you could install the Appdata Cleanup plugin for Unraid and let it take care of the issue. This plugin can also help if your appdata folder is taking up too much space on your cache disk.
How to install the Appdata Cleanup plugin
The Appdata Cleanup plugin can be found in the Community Applications from your Unraid dashboard. Installing it is a simple as searching for its name and clicking the installation button. If you visit the support thread in the Unraid forums, you will see a note that the plugin has been deprecated, however, in a later post, the developer announced that the plugin would be un-deprecated and work on it continued. I can confirm that the plugin is working for me on the latest Unraid stable release.
Using Appdata Cleanup: Welcome to the danger zone
Before you continue, a word of warning: In the case of grave user error, the Appdata Cleanup plugin can delete your entire appdata directory. You could potentially destroy your application server using this Unraid plugin. Only use this plugin if you know what you are doing and are prepared to take the time to carefully read all hints.
If you are still prepared to use the plugin, you can launch it by clicking on its icon in the Unraid dashboard’s plugins tab. You will first be greeted by some more warnings from the developer themselves, and below you will see a list of folders that the plugin thinks should be deleted. Make sure you double-check that each folder really is unused and delete them by clicking on the appropriate button.
Sounds like a VERY dangerous app.
What is the manual/safe way to delete all those unneeded folders?
You can open up the console and navigate to the parent folder. Then simply use the
rm -rv folder-to-delete/
command.