To increase the maximum upload and file size for WordPress running on Coolify, you can update your
.htaccess file or mount a custom php.ini configuration via Docker. [1, 2]Method 1: Update
.htaccess (Quickest)- Open your Coolify dashboard and launch the Terminal for your WordPress container (or use SSH).
- Locate and open your
.htaccessfile in the WordPress root directory usingviornano.
- Add the following lines to the end of the file:
apache
php_value upload_max_filesize 256M php_value post_max_size 256M php_value max_execution_time 300 php_value max_input_time 300Vær forsiktig når du bruker koden
- Save and close the file, then reload your website. [1]
Note: If you encounter a
413 Payload Too Large error, your proxy or web server layer (like Nginx) may also need limits increased. [1]Method 2: Use a Custom
php.ini via Docker Compose (Persistent)If
.htaccess values are ignored by your container setup, configure a persistent PHP initialization file: [1]- Go to your WordPress service in Coolify, select Configuration, and choose Edit Compose File.
- Under your
wordpressservice, add a volume mapping for thephp.inioverride:yamlservices: wordpress: volumes: - ./wordpress.ini:/usr/local/etc/php/conf.d/wordpress.iniVær forsiktig når du bruker koden
- Click Save and Restart.
- Go to Persistent Storages, locate
wordpress.ini, and convert it to a file.
- Edit the new file to include your preferred settings:
ini
file_uploads = On memory_limit = 256M upload_max_filesize = 256M post_max_size = 256M max_execution_time = 300 max_input_time = 1000Vær forsiktig når du bruker koden
- Save and restart the service again. [1]