diff --git a/server/scripts/create_jailkit_user.sh b/server/scripts/create_jailkit_user.sh
index 5e1060be2503bc713842d3ef83910e675cf8d2d7..efefafe3ea808210639dd15021988a78221087dd 100755
--- a/server/scripts/create_jailkit_user.sh
+++ b/server/scripts/create_jailkit_user.sh
@@ -21,6 +21,12 @@ CHROOT_SHELL=$4
 CHROOT_P_USER=$5
 CHROOT_P_USER_HOMEDIR=$6
 
+### Check if USERHOMEDIR already exists ###
+if [ ! -d $CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR ]; then
+ mkdir -p $CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR
+ chown -R $CHROOT_USERNAME $CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR
+fi
+
 ### Reconfigure the chroot home directory for the user ###
 usermod --home=$CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR $CHROOT_USERNAME 2>/dev/null