Skip to content

WordPress

WordPress is the most widely used content management system for building websites, blogs, and online stores. The Clank WordPress template deploys a production-ready WordPress instance backed by a MySQL 8 database, with persistent storage for both services out of the box.

RequirementMinimum
Server memory1 GB free (512 MB WordPress + 512 MB MySQL)
Server disk2 GB free
CPU1 core (0.5 WordPress + 0.5 MySQL)
Agent versionv0.6.18 or later (persistent volume support)
ServiceImagePortCPU limitMemory limit
WordPresswordpress:6-apache800.5 cores512 MB
MySQLmysql:833060.5 cores512 MB

WordPress runs Apache with mod_php and connects to the companion MySQL instance over an internal Docker network. Only the WordPress container is exposed externally; MySQL is not reachable from outside the project network.

VariableValueDescription
WORDPRESS_DB_HOSTAuto-set (companion host)Hostname of the MySQL container. Configured automatically by Clank.
WORDPRESS_DB_USERwordpressDatabase user for WordPress.
WORDPRESS_DB_PASSWORDAuto-generated secretShared with the MySQL MYSQL_PASSWORD variable.
WORDPRESS_DB_NAMEwordpressName of the WordPress database.
VariableValueDescription
MYSQL_ROOT_PASSWORDAuto-generated secretRoot password for MySQL. Store securely; needed for admin operations.
MYSQL_DATABASEwordpressDatabase created on first start.
MYSQL_USERwordpressNon-root user granted access to MYSQL_DATABASE.
MYSQL_PASSWORDAuto-generated secretPassword for MYSQL_USER. Shared with WORDPRESS_DB_PASSWORD.
ServiceMount pathContents
WordPress/var/www/htmlWordPress core files, themes, plugins, and uploads (wp-content)
MySQL/var/lib/mysqlDatabase files

Both volumes are named Docker volumes that persist across redeployments. Deleting the service without opting in to volume cleanup will preserve the data for recovery.

  1. Open your WordPress service URL in a browser. You will see the WordPress installation wizard.
  2. Navigate to /wp-admin/install.php if the wizard does not appear automatically.
  3. Choose your language, then set the site title, admin username, admin password, and admin email.
  4. Click Install WordPress. The setup takes a few seconds.
  5. Log in at /wp-admin to access the WordPress dashboard.

After configuring your endpoint access mode, point your domain’s DNS to the server and set the WordPress URL in Settings > General:

  • WordPress Address (URL) — the URL where WordPress core files are served
  • Site Address (URL) — the URL visitors use to reach your site

Both should match your custom domain (e.g., https://example.com).

WordPress needs an SMTP connection to send password resets, notifications, and contact form submissions. Install and activate a mail plugin such as WP Mail SMTP from the Plugins menu, then configure it with your SMTP provider credentials.

The default PHP memory limit is 128 MB. To increase it, add these environment variables to the WordPress service in Clank:

VariableExample value
PHP_MEMORY_LIMIT256M
PHP_UPLOAD_MAX_FILESIZE64M
PHP_POST_MAX_SIZE64M
PHP_MAX_EXECUTION_TIME300

To enable WordPress Multisite, add WORDPRESS_CONFIG_EXTRA as an environment variable:

define('WP_ALLOW_MULTISITE', true);

After saving the variable and redeploying, go to Tools > Network Setup in the WordPress admin panel to complete the multisite configuration.

WordPress can be updated through the admin dashboard (Dashboard > Updates). This updates WordPress core, themes, and plugins in-place on the persistent volume. No redeployment is required for in-app updates.

To upgrade the underlying WordPress Docker image (e.g., from wordpress:6-apache to a newer tag), update the image tag in the Clank service settings and redeploy. The new container will use the existing volume data. WordPress will run its database migration automatically on first access after an image upgrade.

Upgrading MySQL across major versions (e.g., 8.0 to 8.4) requires a database dump and restore:

  1. Create a database dump: connect to the MySQL container and run mysqldump -u root -p --all-databases > /var/lib/mysql/backup.sql
  2. Update the MySQL image tag in Clank and redeploy
  3. Import the dump if the new version cannot read the old data files

To run WP-CLI commands, exec into the WordPress container from your server:

Terminal window
docker exec -it <container_name> wp --allow-root plugin update --all
docker exec -it <container_name> wp --allow-root core update