diff --git a/scripts/install b/scripts/install
index ef7b1ff..555fd5b 100755
--- a/scripts/install
+++ b/scripts/install
@@ -36,6 +36,11 @@ ynh_add_systemd_config
yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/var/log/$app/$app.log"
+mkdir "/var/log/$app"
+touch "/var/log/$app/$app.log"
+chown -R "$app:$app" "/var/log/$app"
+chmod -R 750 "/var/log/$app"
+
ynh_use_logrotate
ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --failregex="^error: maximum authentication attempts exceeded for .* from $"
diff --git a/scripts/restore b/scripts/restore
index e10dfc1..15bf90d 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -34,6 +34,8 @@ yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/
mkdir "/var/log/$app"
touch "/var/log/$app/$app.log"
chown -R "$app:$app" "/var/log/$app"
+chmod -R 750 "/var/log/$app"
+
ynh_restore_file --origin_path="/etc/logrotate.d/$app"