Updated: 11 October 2026 · Applies to: AlmaLinux 9, Rocky Linux 9, Ubuntu 24.04 and Debian 12
Nginx fails to start with "could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)" when its log folder is missing or not writable.
Fix (root)
mkdir -p /var/log/nginx chown -R nginx:nginx /var/log/nginx # www-data:www-data on Ubuntu/Debian nginx -t && systemctl restart nginx
Check which user Nginx runs as with the user line in /etc/nginx/nginx.conf.
Ucartz services for this topic
- Managed cPanel VPS: cPanel included; we handle updates, security and monitoring.
- cPanel server management: hardening, migrations and 24/7 monitoring, with no long-term contract.
- cPanel, Plesk and LiteSpeed licences: for VPS and dedicated servers, with installation help on demand.
