diff --git a/lib/private/setup.php b/lib/private/setup.php
index a96dade0665599d1dc7da553cf37cf29a9c1c615..b9f8828227e63844f7d977bfc1b16af7fcc7f143 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -194,7 +194,9 @@ class Setup {
 		// Create data directory to test whether the .htaccess works
 		// Notice that this is not necessarily the same data directory as the one
 		// that will effectively be used.
-		@mkdir($dataDir);
+		if(!file_exists($dataDir)) {
+			@mkdir($dataDir);
+		}
 		$htAccessWorking = true;
 		if (is_dir($dataDir) && is_writable($dataDir)) {
 			// Protect data directory here, so we can test if the protection is working