If you are trying to update or install a WordPress plugin and get hit with the “Update failed: Could Not Create Directory” or “WordPress needs to access your web server” errors, you are likely facing a classic permission glitch.
This guide will show you exactly why this happens on HestiaCP and how to fix it in under two minutes.
🔍 Why Does This Happen?
When you add multiple domains very quickly in HestiaCP, the backend setup scripts can sometimes overlap.
The server creates the folders as the system administrator (root) first, then is supposed to hand ownership over to your user account. If the script rushes or glitches, the files stay locked under root. Because your WordPress site runs under your regular user account, it is completely blocked from modifying or adding new files.
🛠️ The Permanent Fix (SSH Terminal)
If you have SSH access to your server, you can instantly reset the permissions for your user account.
Step 1: Log in to your server via SSH
Open your terminal and log in as the root user.
Step 2: Run the Ownership Reset Command
Run the following command. Make sure to replace your_panel_username with your actual HestiaCP user account name.
bash
chown -R your_panel_username:your_panel_username /home/your_panel_username/web/*/public_html/
Use code with caution.
What this command does:
chown -R: Changes the ownership recursively (for all folders and files inside).your_panel_username:your_panel_username: Assigns the files back to your specific user and group.*/public_html/: The wildcard asterisk (*) automatically applies this fix to all domains under that user at once, fixing any hidden permission bugs across your sites.
📂 Alternative Fix: Using HestiaCP File Manager
If you don’t want to use the command line, you can fix this right from your browser:
- Log into your HestiaCP Dashboard.
- Click Files in the top menu to open the File Manager.
- Navigate to:
web➡️your-domain.com➡️public_html. - Check the Owner column. If it says
rootoradmin, select all files. - Click the More button (three dots) and click Chown (Change Owner).
- Change the Owner and Group to match your personal HestiaCP username.
💡 Pro-Tip for the Future
To prevent this from happening again, slow down when creating new domains. Give HestiaCP about 10 to 15 seconds between adding websites so the background setup tasks can finish cleanly without choking!