diff --git a/collector/utils/comKey/index.js b/collector/utils/comKey/index.js
index 0e96a6972..77ec1c612 100644
--- a/collector/utils/comKey/index.js
+++ b/collector/utils/comKey/index.js
@@ -1,11 +1,14 @@
 const crypto = require("crypto");
 const fs = require("fs");
 const path = require("path");
-
 const keyPath =
   process.env.NODE_ENV === "development"
     ? path.resolve(__dirname, `../../../server/storage/comkey`)
-    : path.resolve(process.env.STORAGE_DIR, `comkey`);
+    : path.resolve(
+        process.env.STORAGE_DIR ??
+          path.resolve(__dirname, `../../../server/storage`),
+        `comkey`
+      );
 
 class CommunicationKey {
   #pubKeyName = "ipc-pub.pem";
diff --git a/server/utils/comKey/index.js b/server/utils/comKey/index.js
index e545a6be5..aec436bbd 100644
--- a/server/utils/comKey/index.js
+++ b/server/utils/comKey/index.js
@@ -4,7 +4,10 @@ const path = require("path");
 const keyPath =
   process.env.NODE_ENV === "development"
     ? path.resolve(__dirname, `../../storage/comkey`)
-    : path.resolve(process.env.STORAGE_DIR, `comkey`);
+    : path.resolve(
+        process.env.STORAGE_DIR ?? path.resolve(__dirname, `../../storage`),
+        `comkey`
+      );
 
 // What does this class do?
 // This class generates a hashed version of some text (typically a JSON payload) using a rolling RSA key