Solving Nextcloud Large Files Upload Issue on Debian 12 Bare Metal Server with MariaDB Database

Abstract: Resolve Nextcloud large file upload failures on Debian 12 by increasing PHP and Nginx size limits.

Created: 2026-09-14 by
Uploading large files to Nextcloud on Debian 12 often fails due to restrictive web server limits rather than database issues. To resolve this, you must increase the upload_max_filesize and post_max_size values in your PHP configuration files. Additionally, adjusting the Nginx or Apache client body size limit ensures the reverse proxy does not reject the request before it reaches the application.

Understanding the Upload Bottleneck

When a user attempts to upload a file larger than the configured limit, the transfer is silently dropped or results in a generic error. On a bare metal Debian 12 server, the bottleneck is almost always at the web server or PHP layer, not the MariaDB backend. The database handles metadata storage efficiently, but the HTTP layer enforces strict size caps for security and stability reasons. If you encounter timeouts or connection resets during large transfers, these limits are the primary suspects.

Configuring PHP Limits

The first step is to modify the PHP settings that control incoming data sizes. You need to edit the main php.ini file used by your web server. On Debian 12, this is typically located at /etc/php/8.2/fpm/php.ini for PHP-FPM or /etc/php/8.2/apache2/php.ini if using Apache modules. Open the file with a text editor like nano or vim.

  • upload_max_filesize: This defines the maximum size of an individual file. Set this to your desired limit, such as 50G for very large datasets.
  • post_max_size: This must be greater than upload_max_filesize. It controls the total size of POST data. A common practice is to set this slightly higher than the upload limit, for example, 51G.
  • max_execution_time: Large uploads take time. Increase this value (e.g., to 3600) to prevent PHP from timing out before the transfer completes.
  • memory_limit: Ensure this is sufficient to handle the script overhead, though it rarely needs to match the file size entirely.

After making these changes, save the file. If you are using PHP-FPM, restart the service using sudo systemctl restart php8.2-fpm. For Apache, use sudo systemctl restart apache2. Always verify the changes by creating a simple info.php file in your web root and checking the loaded configuration values.

Adjusting Web Server Proxy Settings

Even with correct PHP settings, your reverse proxy may block large requests. Most modern Nextcloud installations on Debian use Nginx. You must check the Nginx configuration file, usually found in /etc/nginx/sites-available/ or /etc/nginx/conf.d/.

Look for the client_max_body_size directive within the server or location block. By default, this is often set to 1m or 10m. Change this value to match or exceed your PHP post_max_size. For example:

server {
    listen 443 ssl;
    # ... other directives ...
    client_max_body_size 51g;
    
    location / {
        # ... proxy pass directives ...
    }
}

If you are using Apache with mod_proxy, ensure that LimitRequestBody is either unset or set to a high value, as Apache’s default can also restrict payload sizes. After modifying Nginx, test the configuration with sudo nginx -t and reload it with sudo systemctl reload nginx. This step is critical because Nginx will return a 413 Request Entity Too Large error if the limit is hit before PHP ever sees the request.

Tuning Chunked Uploads

Nextcloud supports chunked uploads, which break large files into smaller pieces. This feature is enabled by default in recent versions and helps stabilize transfers over unstable connections. However, if you are experiencing specific issues with chunked uploads, you can adjust related settings in config.php. Note that you do not need to manually enable "chunked_upload" as it is controlled internally. Instead, ensure that the memcache.local and memcache.distributed settings are configured correctly if you have Redis installed, as this improves performance for locking mechanisms during concurrent uploads.

For pure stability without Redis, you can rely on the database transaction logs. If your uploads still fail, check the Nextcloud log at data/nextcloud.log for entries related to "Chunked upload" or "Locking". These logs will tell you if the issue is related to temporary file storage permissions or disk space exhaustion on the /tmp partition.

Verifying Disk Space and Permissions

A common oversight is assuming that because the server has space, the upload will succeed. Temporary files are stored in /tmp or a designated upload_tmp_dir. If your /tmp partition is small (common on systems with limited RAM), large uploads will fail even if your main data directory has terabytes of free space. Check the mount point for /tmp using df -h /tmp. If it is full, consider mounting a larger partition there or setting upload_tmp_dir in php.ini to a directory on a larger volume.

Ensure that the web server user (www-data) has write permissions to the Nextcloud data directory and the config folder. Incorrect permissions can cause silent failures where the upload starts but cannot finalize the file move. Use sudo chown -R www-data:www-data /var/www/nextcloud/data to fix ownership issues.

Optimizing Network and Timeout Settings

If you are uploading over slow networks, TCP window scaling and keep-alive settings might need adjustment. While less common on local bare metal servers, ensuring that your firewall allows sustained connections is vital. Some firewalls drop idle connections after a few minutes. Since large uploads can take hours, ensure that any intermediate load balancers or proxies support long-lived connections.

Additionally, consider enabling gzip compression for static assets to free up bandwidth for the actual file data. In Nginx, this is handled by the gzip module, which should be active by default. This optimization reduces the load on your network interface, allowing more consistent throughput for large binary transfers.

Frequently Asked Questions

Why does my upload fail immediately with a 413 error?

This error indicates that the web server (Nginx or Apache) rejected the request before PHP processed it. You must increase the client_max_body_size in Nginx or LimitRequestBody in Apache to match your PHP limits. Restarting the web server after changing these settings is required for them to take effect.

Do I need Redis to upload large files successfully?

No, Redis is not strictly required for large file uploads to function. It primarily improves performance by handling distributed locking and caching. Without Redis, Nextcloud uses the database for locking, which is slower but fully functional for most users. Focus on PHP and web server limits first before adding caching layers.

How do I check if my /tmp partition is too small?

Run the command df -h /tmp in your terminal. Look at the "Use%" column and the available space. If the partition is nearly full or significantly smaller than the files you are trying to upload, change the upload_tmp_dir in php.ini to a location with more free space.

What is the difference between upload_max_filesize and post_max_size?

upload_max_filesize limits the size of a single uploaded file, while post_max_size limits the total size of all POST data, including file uploads and form fields. post_max_size must always be larger than upload_max_filesize, otherwise, PHP will reject the entire request even if the file itself is under the limit.

Can I monitor the progress of a large upload in real-time?

Nextcloud’s web interface shows progress bars, but for debugging, you can monitor the server-side activity. Use tail -f data/nextcloud.log while attempting an upload to see real-time events. Additionally, monitoring disk I/O with iostat or iotop can help confirm that the server is actively writing data during the transfer.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More