diff --git a/collector/utils/comKey/index.js b/collector/utils/comKey/index.js
index 0e96a6972bd9eb3e00179974c06fd7082d251225..77ec1c612df481cb9c9919518106770d8f64353d 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 e545a6be518be49286c143fb56abba6a7f1abcc0..aec436bbd693b9ab2c33c067c4a698dd298492e8 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