WordPress Uploads Permission Fix on Nginx: 2026 Guide

Holographic folder with glowing green padlock and blue data particles in a modern server room.

If you run a WordPress site on an Nginx server, you may have seen errors when trying to upload images or files. These errors usually point to a permission problem. This guide walks you through every step of the WordPress uploads permission fix on Nginx. Whether you are new to servers or have some experience, this tutorial will help you solve the issue fast.

By the end of this guide, you will know how to find the right user, set correct file permissions, configure PHP-FPM, and handle SELinux. You will also learn how to verify that the WordPress uploads permission fix on Nginx worked and how to prevent the problem from coming back.

Quick Answer: WordPress Uploads Permission Fix on Nginx

Before we dive deep, here is the short answer. Most WordPress upload permission problems on Nginx come down to two things: wrong file ownership and wrong file permissions. If you want to fix the issue right now, follow the commands below.

The Most Common Fix in 3 Commands

Open your terminal and run these three commands. Replace /var/www/html with your actual WordPress path if it is different.

  1. sudo chown -R www-data:www-data /var/www/html/wp-content/uploads
  2. sudo find /var/www/html/wp-content/uploads -type d -exec chmod 755 {} \;
  3. sudo find /var/www/html/wp-content/uploads -type f -exec chmod 644 {} \;

These commands set the correct owner and permissions. After running them, try uploading a file in WordPress again. If it works, you are done. If not, keep reading for the full WordPress uploads permission fix on Nginx.

When the Quick Fix Doesn’t Work

Sometimes the quick fix is not enough. This happens when:

  • Your PHP-FPM runs as a different user than www-data.
  • SELinux is active and blocking access.
  • Nginx config limits the upload size.
  • The WordPress database has a wrong upload path set.

In these cases, follow the full steps below for a complete WordPress uploads permission fix on Nginx.

Why WordPress Upload Permissions Break on Nginx Servers

To fix the problem well, you need to understand why it happens. Let us look at the main reasons behind WordPress upload permission issues on Nginx.

How Nginx Handles File Access Differently from Apache

Apache uses a module called mod_php that runs PHP inside the web server process. This means Apache and PHP share the same user. Nginx works differently. Nginx does not run PHP on its own. It sends PHP requests to a separate process called PHP-FPM. This split design is faster but means two different users are involved. If those users do not match, WordPress uploads permission issues appear on Nginx.

The Role of PHP-FPM in WordPress Upload Permissions

PHP-FPM is the process that actually runs WordPress PHP code. When WordPress tries to write a file to wp-content/uploads, it is PHP-FPM that does the writing. So the PHP-FPM user must have write access to that folder. If the folder is owned by a different user, the write fails. This is the most common cause of WordPress upload permission errors on Nginx.

Common Triggers: Migrations, Updates, and Server Changes

WordPress upload permissions often break after:

  • Server migration: Moving your site to a new server can change file owners.
  • WordPress updates: Core or plugin updates may create new files with wrong ownership.
  • PHP version changes: Switching PHP versions can change the PHP-FPM user.
  • Manual file transfers: Using FTP or SCP may set files to your user instead of the web user.

Step 1 — Identify the Correct Web Server User for Your Nginx Setup

The first step in any WordPress uploads permission fix on Nginx is to find out which user your web server and PHP-FPM run as.

How to Find Your Nginx User (www-data vs nginx)

Run this command in your terminal:

ps aux | grep nginx

Look at the first column. On Ubuntu and Debian, you will usually see www-data. On CentOS, RHEL, or Fedora, you will see nginx. Write down this user name. You will need it for the next steps.

How to Find Your PHP-FPM Running User

Run this command:

ps aux | grep php-fpm

You will see several lines. Look for the pool worker processes. They show the user PHP-FPM runs as. It might be www-data, nginx, or a custom user. This user must own the WordPress upload files.

Why User Mismatch Causes WordPress Upload Failures

If Nginx runs as www-data but PHP-FPM runs as nginx, and your files are owned by www-data, then PHP-FPM cannot write to those files. This mismatch is a top cause of WordPress upload permission errors on Nginx. Both users should match, or the file group should allow write access.

Step 2 — Fix WordPress Uploads File Ownership on Nginx

Now that you know the correct user, let us fix the file ownership. This is a key part of the WordPress uploads permission fix on Nginx.

Change Ownership of wp-content/uploads with chown

Use the chown command to change the owner. Replace www-data with your actual user if different:

sudo chown -R www-data:www-data /var/www/html/wp-content/uploads

The -R flag means recursive. It changes ownership for all files and folders inside uploads.

Set Ownership for the Entire wp-content Directory

Some plugins also need write access to other parts of wp-content. To be safe, set ownership for the whole directory:

sudo chown -R www-data:www-data /var/www/html/wp-content

This ensures plugins can create cache files, update settings, and manage other tasks without permission errors.

Verify Ownership Changes with ls -la

After running the chown command, check that it worked:

ls -la /var/www/html/wp-content/uploads

You should see www-data (or your correct user) as the owner for all files and folders. If you still see a different user, run the chown command again.

Step 3 — Set Correct Directory and File Permissions for WordPress Uploads on Nginx

Ownership alone is not enough. You also need the right permission levels. This step is crucial for a full WordPress uploads permission fix on Nginx.

Recommended Permissions: 755 for Directories, 644 for Files

Here are the standard permission values:

Item Permission Meaning
Directories 755 Owner can read/write/enter. Others can read/enter.
Files 644 Owner can read/write. Others can read.

These values give enough access for WordPress to work while keeping your site secure.

How to Apply Permissions Recursively Using find and chmod

Use the find command to set permissions for directories and files separately:

sudo find /var/www/html/wp-content/uploads -type d -exec chmod 755 {} \;

sudo find /var/www/html/wp-content/uploads -type f -exec chmod 644 {} \;

The first command sets 755 for all directories. The second sets 644 for all files. This is the safe and correct way to set permissions for WordPress uploads on Nginx.

When to Use 775 Instead of 755 (Group Write Access)

If you have multiple users who need to manage WordPress files, you might use 775 for directories. This gives group write access. To do this, make sure all users are in the same group:

sudo usermod -a -G www-data your-username

Then set directory permissions to 775. Only use this if you truly need it. For most sites, 755 is enough.

Why You Should Never Use 777 for WordPress Uploads

Some guides tell you to use chmod 777 to fix permission issues. Do not do this. A 777 permission means anyone on the server can read, write, and execute those files. This is a major security risk. Hackers can upload malicious files to your site. Always use 755 for directories and 644 for files instead. If 755 does not work, the problem is with ownership, not permissions.

Step 4 — Configure PHP-FPM Pool Settings to Match Nginx Permissions

If ownership and permissions are correct but uploads still fail, check your PHP-FPM settings. This step is often missed in WordPress uploads permission fix on Nginx guides.

Locate Your PHP-FPM Pool Configuration File

The PHP-FPM pool config file is usually in one of these locations:

  • /etc/php/8.x/fpm/pool.d/www.conf (Ubuntu/Debian)
  • /etc/php-fpm.d/www.conf (CentOS/RHEL)

Open the file with a text editor:

sudo nano /etc/php/8.2/fpm/pool.d/www.conf

Set the Correct user and group in php-fpm.conf

Find these lines in the config file:

user = www-data

group = www-data

Make sure the user and group match the owner you set in Step 2. If your files are owned by nginx, change these lines to:

user = nginx

group = nginx

Save the file after making changes.

Restart PHP-FPM and Nginx to Apply Changes

After editing the PHP-FPM config, restart both services:

sudo systemctl restart php8.2-fpm

sudo systemctl restart nginx

Replace 8.2 with your actual PHP version. You can check your PHP version with php -v.

How to Confirm PHP-FPM Is Running as the Right User

Run this command to check:

ps aux | grep php-fpm

The pool worker processes should show the user you set in the config file. If they show a different user, check your config file again and restart PHP-FPM.

Step 5 — Fix WordPress Uploads Permission on Nginx with SELinux (CentOS/RHEL/Fedora)

If you use CentOS, RHEL, or Fedora, SELinux may block WordPress uploads even when permissions look correct. This step covers the WordPress uploads permission fix on Nginx for SELinux systems.

Check If SELinux Is Blocking WordPress Uploads

First, check if SELinux is active:

sestatus

If you see SELinux status: enabled, then SELinux is active. Next, check the audit log for denied actions:

sudo grep denied /var/log/audit/audit.log | grep php-fpm

If you see denied entries related to your WordPress upload path, SELinux is the problem.

Set the Correct SELinux Security Context for uploads

Run this command to set the right context:

sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/wp-content/uploads

This tells SELinux that the upload folder can be written to by the web server.

Make SELinux Permission Changes Permanent

The chcon command may not survive a file system relabel. To make the change permanent, use semanage:

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/wp-content/uploads(/.*)?"

sudo restorecon -Rv /var/www/html/wp-content/uploads

Now the SELinux context will persist across reboots and relabels.

Step 6 — Verify Nginx Configuration for WordPress Upload Paths

Sometimes the problem is not about file permissions at all. It may be an Nginx config issue. Check these items as part of your WordPress uploads permission fix on Nginx.

Check client_max_body_size in Nginx Config

Nginx limits the size of uploaded files by default. The default is often just 1MB. To change it, open your Nginx config:

sudo nano /etc/nginx/nginx.conf

Add or update this line inside the http block:

client_max_body_size 64M;

Save and restart Nginx. Now WordPress can accept larger file uploads.

Verify the WordPress Upload Path in Settings → Media

Log in to your WordPress dashboard. Go to Settings → Media. Check the “Store uploads in this folder” field. It should be empty or set to wp-content/uploads. If it shows a wrong path, WordPress will try to write to a folder that does not exist or has wrong permissions.

Clear the upload_path Option in wp_options Database Table

If you cannot access the WordPress dashboard, you can clear the upload path via the database. Run this SQL query:

UPDATE wp_options SET option_value = '' WHERE option_name = 'upload_path';

This resets the upload path to the default. After this, WordPress will use wp-content/uploads again.

Common WordPress Upload Error Messages on Nginx and How to Fix Them

Let us look at the most common error messages and how to fix each one as part of your WordPress uploads permission fix on Nginx.

“Unable to Create Directory wp-content/uploads”

This error means WordPress cannot create the upload folder. Check:

  • Does the wp-content folder exist?
  • Is it owned by the correct user?
  • Does the parent folder have write permission?

Fix with: sudo chown www-data:www-data /var/www/html/wp-content && sudo chmod 755 /var/www/html/wp-content

“The Uploaded File Could Not Be Moved to wp-content/uploads”

This means PHP-FPM cannot write to the uploads folder. Check ownership and permissions as shown in Steps 2 and 3. Also make sure PHP-FPM runs as the correct user (Step 4).

“Is Its Parent Directory Writable by the Server?”

This error often appears when the parent folder lacks write access. Check that wp-content is owned by the web server user and has 755 permission. If you use a custom upload path, make sure that path exists and is writable.

403 Forbidden Error on Uploaded Files in Nginx

A 403 error means Nginx can see the file but cannot serve it. Check:

  • File permissions are 644 for files and 755 for directories.
  • Nginx user has read access to the file.
  • SELinux context is correct (if using SELinux).

How to Verify Your WordPress Uploads Permission Fix on Nginx Worked

After applying the WordPress uploads permission fix on Nginx, you need to confirm it worked. Follow these steps.

Test a Media Upload from the WordPress Dashboard

Go to Media → Add New in your WordPress dashboard. Upload a small image. If it uploads without errors, the fix worked. Try uploading different file types (JPG, PNG, PDF) to be sure.

Check Nginx and PHP-FPM Error Logs

If the upload fails, check the error logs:

sudo tail -f /var/log/nginx/error.log

sudo tail -f /var/log/php8.2-fpm.log

Look for permission denied errors. These logs will tell you exactly which file or folder has a problem.

Confirm Uploaded Files Are Accessible via Browser

After a successful upload, copy the file URL and open it in a new browser tab. If the image loads, both the upload and the file serving are working. If you see a 403 or 404 error, check Nginx config and file permissions again.

Best Practices to Prevent WordPress Upload Permission Issues on Nginx

Once you complete the WordPress uploads permission fix on Nginx, follow these tips to prevent the problem from coming back.

Set Up Proper File Permissions from the Start

When you first install WordPress on Nginx, set the correct ownership and permissions right away. Do not wait for errors to appear. Use the commands from Steps 2 and 3 as part of your initial setup.

Use a Deployment Workflow That Preserves Ownership

If you use Git, FTP, or a CI/CD tool to deploy WordPress, make sure the deployment process sets the correct file owner. Many deployment tools let you run post-deploy commands. Add a chown command to your workflow to keep ownership correct.

Monitor Permissions After WordPress Core or Plugin Updates

WordPress updates sometimes create new files with wrong ownership. After each update, check the upload folder:

ls -la /var/www/html/wp-content/uploads

If you see files owned by a different user, run the chown command again. You can also add a cron job to check permissions weekly.

FAQ: WordPress Uploads Permission Fix on Nginx

What Are the Correct Permissions for wp-content/uploads on Nginx?

Directories should be 755 and files should be 644. The owner should be the same user that PHP-FPM runs as (usually www-data or nginx).

Should I Use www-data or nginx as the File Owner?

Use the same user that your PHP-FPM pool runs as. On Ubuntu/Debian, this is usually www-data. On CentOS/RHEL/Fedora, it is usually nginx. Check your PHP-FPM config to be sure.

Why Do WordPress Upload Permissions Break After a Server Migration?

When you move files to a new server, the file owner often changes to your SSH user instead of the web server user. The new server may also have a different PHP-FPM user. Always run chown after a migration as part of your WordPress uploads permission fix on Nginx.

Can I Fix WordPress Upload Permissions Without SSH Access?

It is hard to fix permission issues without SSH. Some hosting panels (like cPanel or Plesk) let you change file permissions through a file manager. But for a full WordPress uploads permission fix on Nginx, SSH access is needed to run chown, chmod, and restart services.

How Do I Fix Upload Permissions on a WordPress Multisite with Nginx?

For WordPress Multisite, the process is the same. The upload path may be different (often wp-content/uploads/sites/). Make sure the entire wp-content folder has the correct ownership and permissions. If you use subdirectory or subdomain installs, the same rules apply. Run the chown and chmod commands on the full wp-content directory to cover all sites.

Summary: Key Takeaways

This guide covered the full WordPress uploads permission fix on Nginx. Here are the main points:

  • Find the correct web server and PHP-FPM user.
  • Set file ownership with chown to match the PHP-FPM user.
  • Use 755 for directories and 644 for files. Never use 777.
  • Configure PHP-FPM pool to run as the correct user.
  • On CentOS/RHEL/Fedora, set SELinux context for upload folders.
  • Check Nginx config for upload size limits and correct paths.
  • Test uploads and check error logs to confirm the fix.

Follow these steps and your WordPress site will handle uploads without permission errors. If problems come back, check for recent updates or server changes that may have reset file ownership. With the right setup, the WordPress uploads permission fix on Nginx will keep your site running smoothly.