How to uninstall Cytomine

On this page, you will learn how to uninstall a Cytomine instance running on a Linux machine (server or personal computer) with Docker.

This (un)installation documentation has been tested on Ubuntu 16.04LTS, 18.04LTS, Debian 9 and 10 but can be used for other platforms supported by Docker. 

In the following steps, we will use the command line. It is recommended to know how to use it

If you experiment any issue, please describe your problem precisely in our ticket system on Github.

Step 0 - (Optional) Backup your data

Before uninstall your Cytomine, please consider to backup your data, mainly if you plan to re-use it in an other Cytomine or an other application. Note that the default backup directory, as given into the Cytomine configuration file, will be deleted (the default one is /data/backup). Don't forget to keep your backup safe by moving them at another location.

Step 1 - Stop and delete the Cytomine system Docker containers

First of all, you must go to the Cytomine-bootstrap folder, the one from who you have installed Cytomine. For this exemple we will assume this folder to be in your home folder.

In this Cytomine-boostrap folder, you first have to run the clean_docker_keep_data.sh script in admin mode. It will stop and delete all the Docker containers that do not have sensible data inside :

cd Cytomine_bootstrap/
sudo sh clean_docker_keep_data.sh

Note that at this step, your data and images are still safe, so you are still able to revert this uninstallation and restore your Cytomine by running the restart script.

Step 2 - Delete the Cytomine databases and data

In this second step, we will delete the Docker containers that have sensible data inside :

sudo docker volume rm mongodb_data postgis_data singularity_images slurm_data


Step 3 - Delete all the images uploaded to Cytomine

If you have followed the install instructons, all the images uploaded to Cytomine should be in /data/images.

As this folder, and all its content, is no more useful without Cytomine, if you are sure that no other data than Cytomine data are inside, you can delete it.

To do so in command line, here is an example (to use at your own risk exclaim ):

source configuration.sh && rm -rf $IMS_STORAGE_PATH && rm -rf $ALGO_PATH && rm -rf $BACKUP_PATH


Step 4 - (Optional) Unmount your image disk

If your /data was an external disk, mounted at boot using /etc/fstab instructions, please edit this file to avoid any error message during your computer boot.  
To do so in command line, here is an example (to use at your own risk exclaim :

sudo nano /etc/fstab

And delete or comment the line that concern /data.

Step 5 - Delete the Cytomine Docker images

You can now delete the Docker images as downloaded from DockerHub at the installation :

sudo docker rmi $(sudo docker images | grep cytomine | awk '{ print $3 }')

Step 6 - (Optional) Unset your URLs if your Cytomine was installed locally

If you have installed Cytomine locally (on the same computer that the only one you use to browse Cytomine), during the installation process you should have edited your /etc/hosts file, which should contain the following lines :   localhost-core   localhost-ims   localhost-ims2   localhost-upload   rabbitmq

Remark :
For the version 1 of Cytomine, you should have also add this line too : localhost-retrieval

To unset these URL you must edit this /etc/hosts file and delete or comment all these Cytomine relative lines. Note that you must do that as an administrator, or under sudo procedure. If you whant to do it in command line, here is an example :

sudo nano /etc/hosts