WordPress (Managed)
About
This app targets users who want a managed WordPress installation. The Cloudron team tracks upstream WordPress releases and publishes updates. The WordPress code is read-only. Extend WordPress using plugins. For full control over the installation including editing the WordPress code, use the WordPress (unmanaged) app instead.
- Questions? Ask in the Cloudron Forum - WordPress
Admin page
The WordPress admin page is located https://<my.example.com>/wp-login.php.
Admin user
WordPress with Cloudron user management creates an admin user by default with a
random password and the email admin@cloudron.local. Delete the admin user
post-installation by logging in as a Cloudron admin. The admin user is not deleted automatically because
the default posts auto-generated by WordPress installer are assigned to admin.
Administration email address
WordPress uses the Administration Email Address to send important administrative emails.
Change that address in the Settings section to receive those emails.
Using SFTP
The Managed WordPress app does not support editing files via SFTP. If you require SFTP access to edit WordPress files, use the WordPress (Developer) app instead.
Memory limits
Adjust memory allocated for WordPress by editing /app/data/wp-config.php using the File manager
and adding the following line at the end of the file:
define('WP_MEMORY_LIMIT', '128M');
define('WP_MAX_MEMORY_LIMIT', '256M');
Note that the app also has a separate memory limit controlled by the app's memory limit. If you increase WP_MEMORY_LIMIT, increase the app's memory limit. A good formula is to provide the app 6 times the WP_MEMORY_LIMIT value at the bare minimum.
WP_MAX_MEMORY_LIMIT is the limit for administration tasks, which often require more.
A detailed explanation can be found in the WordPress docs.
Cron tasks
The app is configured to run WordPress cron tasks every 5 minutes.
To run the cron tasks manually run the following command using the Web terminal:
wp cron event run --due-now
WordPress' built-in cron task schedule wp-cron is disabled since
it is not effective
for low traffic websites.
To add custom cron events, use Cloudron's built-in cron or use a plugin like WP Crontrol.
Plugins
Cloudron does not support plugins that modify the code. Code is read-only and immutable. This property is essential for Cloudron to update apps correctly.
Use the WordPress (unmanaged) app to install plugins that modify the code.
Disabling plugin
If a plugin is preventing WordPress from starting, open the File manager. Navigate to
/app/data/wp-content/plugins and rename the offending plugin directory from plugin-name to say plugin-name-broken.
Note that to enable it back, you have to not only rename the folder but also activate the plugin in the WordPress dashboard.
Disabling all plugins
To disable all plugins, rename /app/data/wp-content/plugins to /app/data/wp-content/plugins-broken using
the File manager.
Note that to enable back all the plugins, you have to not only rename the folder but also activate the plugins in the WordPress dashboard.
Performance
GTmetrix is a great site for getting performance metrics on the WordPress installation.
-
To set the expires headers for all pages, the WP Fastest Cache plugin can be installed.
-
For CDN caching, we recommend WP Fastest Cache or W3 Total Cache for CDN based cache. Ryan Kite has a good tutorial on how to setup AWS Cloudfront with WP Fastest Cache.
Database access
Cloudron does not support PHPMyAdmin. Access the database using other methods:
-
Open a Web terminal and press the 'MySQL' button to get console access. Execute SQL commands directly.
-
Use a plugin like WP phpMyAdmin
WP CLI
WP CLI is a command line interface to WordPress. Run commands using the CLI tool by opening a Web terminal and executing WP CLI commands. For example,
wp user list
If one or more plugins/themes are erroring, you can make WP CLI skip loading plugins/themes as follows:
wp --skip-plugins --skip-themes
Additional php settings can be configured, when running the cli with php -d key=value:
sudo -E -u www-data php -d max_execution_time=100 /app/pkg/wp
In this case setting the maximum execution timeout to 100 seconds.
Disable themes
To list the themes:
sudo -E -u www-data /app/pkg/wp --skip-plugins --skip-themes theme list
To disable a theme, just activate another theme:
sudo -E -u www-data /app/pkg/wp --skip-plugins --skip-themes theme activate sometheme
PHP settings
Add custom PHP settings in /app/data/htaccess
using the File manager. Settings with a mode of PHP_INI_SYSTEM cannot be set in htaccess files.
For example:
#example
php_value post_max_size 600M
php_value upload_max_filesize 600M
php_value memory_limit 128M
php_value max_execution_time 300
php_value max_input_time 300
php_value session.gc_maxlifetime 1200
Migrating existing site
See our blog on how to migrate an existing WordPress site to Cloudron.
File editing
For security reasons, WordPress' built-in file editing functionality is disabled by default. Enable this
by editing /app/data/wp-config.php and setting DISALLOW_FILE_EDIT to false.
define('DISALLOW_FILE_EDIT', false);
Unfiltered HTML
For security reasons, non-admins are not allowed to post unfiltered HTML content. Enable this by editing
/app/data/wp-config.php and setting DISALLOW_UNFILTERED_HTML to false.
define('DISALLOW_UNFILTERED_HTML', false);