diff --git a/lib/private/preview/office-cl.php b/lib/private/preview/office-cl.php
index 6e4d4321eb7e4276d338a1e407803ef85dcb3a4b..81e0cf4b6ae9ed8f24a1b930a59600a07a7ea11e 100644
--- a/lib/private/preview/office-cl.php
+++ b/lib/private/preview/office-cl.php
@@ -29,13 +29,12 @@ if (!\OC_Util::runningOnWindows()) {
 
 			$tmpDir = get_temp_dir();
 
-			$defaultParameters = ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ';
+			$defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir) . ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ';
 			$clParameters = \OCP\Config::getSystemValue('preview_office_cl_parameters', $defaultParameters);
 
 			$exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath);
-			$export = 'export HOME=/' . $tmpDir;
 
-			shell_exec($export . "\n" . $exec);
+			shell_exec($exec);
 
 			//create imagick object from pdf
 			try{