diff --git a/monkey/monkey_island/cc/server_utils/encryptor.py b/monkey/monkey_island/cc/server_utils/encryptor.py
index dd088530f..36fff735c 100644
--- a/monkey/monkey_island/cc/server_utils/encryptor.py
+++ b/monkey/monkey_island/cc/server_utils/encryptor.py
@@ -16,7 +16,9 @@ class Encryptor:
     _PASSWORD_FILENAME = "mongo_key.bin"
 
     def __init__(self, data_dir):
-        password_file = os.path.join(data_dir, self._PASSWORD_FILENAME)
+        password_file = os.path.expanduser(
+            os.path.join(data_dir, self._PASSWORD_FILENAME)
+        )
 
         if os.path.exists(password_file):
             self._load_existing_key(password_file)
diff --git a/monkey/monkey_island/cc/test_encryptor.py b/monkey/monkey_island/cc/test_encryptor.py
index 9a424cc01..3380d1d43 100644
--- a/monkey/monkey_island/cc/test_encryptor.py
+++ b/monkey/monkey_island/cc/test_encryptor.py
@@ -27,3 +27,11 @@ def test_create_new_password_file(tmpdir):
     initialize_encryptor(tmpdir)
 
     assert os.path.isfile(os.path.join(tmpdir, PASSWORD_FILENAME))
+
+
+def test_expand_home(monkeypatch, tmpdir):
+    monkeypatch.setenv("HOME", str(tmpdir))
+
+    initialize_encryptor("~/")
+
+    assert os.path.isfile(os.path.join(tmpdir, "mongo_key.bin"))