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.
Requirements
Section titled “Requirements”| Requirement | Minimum |
|---|---|
| Server memory | 1 GB free (512 MB WordPress + 512 MB MySQL) |
| Server disk | 2 GB free |
| CPU | 1 core (0.5 WordPress + 0.5 MySQL) |
| Agent version | v0.6.18 or later (persistent volume support) |
| Service | Image | Port | CPU limit | Memory limit |
|---|---|---|---|---|
| WordPress | wordpress:6-apache | 80 | 0.5 cores | 512 MB |
| MySQL | mysql:8 | 3306 | 0.5 cores | 512 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.
Environment variables
Section titled “Environment variables”WordPress
Section titled “WordPress”| Variable | Value | Description |
|---|---|---|
WORDPRESS_DB_HOST | Auto-set (companion host) | Hostname of the MySQL container. Configured automatically by Clank. |
WORDPRESS_DB_USER | wordpress | Database user for WordPress. |
WORDPRESS_DB_PASSWORD | Auto-generated secret | Shared with the MySQL MYSQL_PASSWORD variable. |
WORDPRESS_DB_NAME | wordpress | Name of the WordPress database. |
| Variable | Value | Description |
|---|---|---|
MYSQL_ROOT_PASSWORD | Auto-generated secret | Root password for MySQL. Store securely; needed for admin operations. |
MYSQL_DATABASE | wordpress | Database created on first start. |
MYSQL_USER | wordpress | Non-root user granted access to MYSQL_DATABASE. |
MYSQL_PASSWORD | Auto-generated secret | Password for MYSQL_USER. Shared with WORDPRESS_DB_PASSWORD. |
Volumes
Section titled “Volumes”| Service | Mount path | Contents |
|---|---|---|
| WordPress | /var/www/html | WordPress core files, themes, plugins, and uploads (wp-content) |
| MySQL | /var/lib/mysql | Database 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.
Post-deploy setup
Section titled “Post-deploy setup”- Open your WordPress service URL in a browser. You will see the WordPress installation wizard.
- Navigate to
/wp-admin/install.phpif the wizard does not appear automatically. - Choose your language, then set the site title, admin username, admin password, and admin email.
- Click Install WordPress. The setup takes a few seconds.
- Log in at
/wp-adminto access the WordPress dashboard.
Configuration
Section titled “Configuration”Custom domain
Section titled “Custom domain”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).
SMTP for email
Section titled “SMTP for email”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.
PHP memory limit
Section titled “PHP memory limit”The default PHP memory limit is 128 MB. To increase it, add these environment variables to the WordPress service in Clank:
| Variable | Example value |
|---|---|
PHP_MEMORY_LIMIT | 256M |
PHP_UPLOAD_MAX_FILESIZE | 64M |
PHP_POST_MAX_SIZE | 64M |
PHP_MAX_EXECUTION_TIME | 300 |
Multisite
Section titled “Multisite”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.
Upgrading
Section titled “Upgrading”Upgrading WordPress
Section titled “Upgrading WordPress”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
Section titled “Upgrading MySQL”Upgrading MySQL across major versions (e.g., 8.0 to 8.4) requires a database dump and restore:
- Create a database dump: connect to the MySQL container and run
mysqldump -u root -p --all-databases > /var/lib/mysql/backup.sql - Update the MySQL image tag in Clank and redeploy
- Import the dump if the new version cannot read the old data files
WP-CLI
Section titled “WP-CLI”To run WP-CLI commands, exec into the WordPress container from your server:
docker exec -it <container_name> wp --allow-root plugin update --alldocker exec -it <container_name> wp --allow-root core update