# How to deploy WordPress on Cloider Kubernetes Engine

> Deploy WordPress with a managed MySQL database to a Cloider Kubernetes cluster: the official image, two replicas sharing a wp-content volume, and a free HTTPS subdomain, from the dashboard, the cloider CLI or an AI coding agent, with a screenshot of every step.

By Marei Morsy, published December 6, 2026. Source: https://cloider.com/blog/deploy-wordpress-cloider-kubernetes

## Key takeaways

- WordPress itself comes from the official image; only wp-content lives on a ReadWriteMany volume that every replica mounts.
- Set all eight keys and salts in a Secret, or each replica signs login cookies differently and logs you out.
- Pods reach the managed MySQL database on its private host, encrypted with MYSQL_CLIENT_FLAGS.
- A target serves the Service on a free cloider.app subdomain with HTTPS, no Ingress needed.
- Update WordPress by changing the image tag; plugins and themes still update from its dashboard.

WordPress runs more websites than any other content management system. The classic setup is one server with PHP, MySQL and the uploads on its disk. Run it on Kubernetes instead and you get several replicas behind one address, rolling updates without downtime, and the same setup on every environment. [Cloider Kubernetes](https://cloider.com/kubernetes) gives you a managed cluster in a couple of minutes, with no control plane or nodes to look after, and a managed MySQL database next to it.

In this guide you deploy WordPress with a MySQL database to a Cloider Kubernetes cluster, three ways:

1. **The classic way, from the dashboard**: create the cluster and the database, apply the Kubernetes manifests, put the site on a free subdomain and install WordPress.
2. **With the cloider CLI**: the same in a few commands, without a password on screen.
3. **With an AI coding agent**: "using cloider cli deploy wordpress to cloider kubernetes engine".

Options 1 and 2 show every step with a screenshot. Your site ends up on a free subdomain with HTTPS, `<subdomain>.cloider.app`, running two replicas of the official WordPress image.

## What you need

- A Cloider account. New accounts get a welcome credit.
- `kubectl`, and for option 2 the cloider CLI and `jq`.
- A folder with the four manifests below in a `k8s/` subfolder. Step 4 of option 1 shows each one.

| File | What it creates |
| --- | --- |
| k8s/config.yaml | ConfigMaps wordpress-config (the site address and the database TLS setting) and wordpress-php (upload limits) |
| k8s/content.yaml | PersistentVolumeClaim wp-content: a 5 GiB ReadWriteMany volume for uploads, themes and plugins |
| k8s/deployment.yaml | Deployment wordpress: 2 replicas of wordpress:7.1-php8.5-apache on port 80 |
| k8s/service.yaml | Service wordpress: port 80 to the pods |

The database password and WordPress's keys and salts are not in any file. You create them as a Secret with kubectl, so they never land in git.

## How WordPress fits in Kubernetes

A WordPress server keeps three kinds of state: the WordPress code, the files in `wp-content`, and the database. On Kubernetes each one gets its own place:

- **The code comes from the image.** The official `wordpress` image copies WordPress into the container when it starts and writes `wp-config.php` from `WORDPRESS_*` environment variables. Every new pod starts with a clean copy, so you update WordPress by changing the image tag, not from its dashboard.
- **wp-content lives on a shared volume.** Uploads, themes and plugins are written at runtime and must survive restarts, so `/var/www/html/wp-content` is a volume. Two replicas write to it at the same time, so it is **ReadWriteMany**, on the `cloider-standard-rwx` storage class. Why a container should never keep files on its own disk is the topic of [another post](https://cloider.com/blog/why-your-application-should-never-store-files-locally).
- **The database is managed MySQL.** No StatefulSet to look after: Cloider runs it, with backups and point-in-time recovery. Pods reach it on its private host, and the connection is encrypted.

Two details matter once there is more than one replica. WordPress signs its login cookies with eight keys and salts, and the image generates random ones in each container when you don't set them: with two replicas, every request that lands on the other pod would log you out. So the Secret sets all eight. And Cloider terminates HTTPS in front of your pods: the image's `wp-config.php` trusts the `X-Forwarded-Proto` header, so WordPress knows the request was HTTPS and its links start with `https://`.

---

## Option 1: the classic way, from the dashboard

## Step 1: Create the cluster

Open **Kubernetes** and click **Create Cluster**. A name is all it needs, here `wordpress`:

![The Create new cluster form with the cluster name wordpress](https://cloider.com/blog/media/01d82597f08462450a194d5f0f67b468.webp "A cluster needs only a name.")

![The clusters list with the wordpress cluster on Kubernetes v1.36 in the Creating status](https://cloider.com/blog/media/cd25f65a6c675dfd5ef162dc018e6c4c.webp "The cluster is ready in a couple of minutes.")

## Step 2: Create the database

Open **Databases** and click **Create Database**. Name it `wordpress-db` with the user `wordpress`, pick **MySQL v9**, and add the `wordpress` cluster to **Trusted sources**, so only pods in that cluster can connect. Leave **SSL Mode** on and pick the **Hobby** plan.

![The new database form with the name wordpress-db, the user wordpress, MySQL v9, the wordpress cluster as the only trusted source, SSL Mode on and the Hobby plan selected](https://cloider.com/blog/media/55ad1ef266664865bff2a24833cfceac.webp "A managed MySQL database that only the cluster can reach.")

Once it is **Ready**, its page shows the **Connection Details**: the username, the password, the database name, the private host and the port. Keep the page open, you need them in the next step. Pods in your Cloider clusters reach the database on its private host, `...db.cloider.internal`.

![The Connection Details of wordpress-db: username wordpress, a hidden password, DB name wordpress-db, a private host ending in db.cloider.internal, a public host, port 23724 and SSL enabled](https://cloider.com/blog/media/77608e49248117fcb70b78628fe0aed3.webp "WordPress uses the private host and the port.")

## Step 3: Connect kubectl and create the Secret

When the cluster is ready, click it. The cluster page lists your workloads, and has **Apply YAML**, a **Terminal** with kubectl, and a button to download the kubeconfig.

![The wordpress cluster page with the workload views on the left, no Deployments yet, and the Apply YAML, Terminal and kubeconfig buttons](https://cloider.com/blog/media/1085213bfb22c24880da3d9c51563ab1.webp "Everything about the cluster in one page.")

Download the kubeconfig from the cluster page, or let the CLI merge it into yours. Then create the `wordpress` namespace and the Secret with the database credentials and eight random keys and salts. `read -rs DB_PASSWORD` waits for you to paste the password from the database page without showing it; press Enter after pasting. Replace `<private-host>:<port>` with the private host and port from the same page:

```bash
cloider cluster kubeconfig wordpress --merge --use
kubectl create namespace wordpress
read -rs DB_PASSWORD
kubectl -n wordpress create secret generic wordpress-secrets \
  --from-literal=WORDPRESS_DB_HOST=<private-host>:<port> \
  --from-literal=WORDPRESS_DB_NAME=wordpress-db \
  --from-literal=WORDPRESS_DB_USER=wordpress \
  --from-literal=WORDPRESS_DB_PASSWORD="$DB_PASSWORD" \
  $(for k in AUTH_KEY SECURE_AUTH_KEY LOGGED_IN_KEY NONCE_KEY \
             AUTH_SALT SECURE_AUTH_SALT LOGGED_IN_SALT NONCE_SALT; do
      echo "--from-literal=WORDPRESS_$k=$(openssl rand -hex 32)"; done)
```

![The terminal merging the cloider-wordpress context, creating the wordpress namespace, and creating the wordpress-secrets Secret with the database host, name, user, password and eight generated keys and salts](https://cloider.com/blog/media/fdcfa1cdb0d6d2520de6306816f943cc.webp "The credentials live only in the cluster.")

## Step 4: Apply the Kubernetes manifests

The first file holds two ConfigMaps. `wordpress-config` adds a few lines to `wp-config.php` through the image's `WORDPRESS_CONFIG_EXTRA` variable: the site address, TLS for the database connection, and no automatic core updates, since a core update inside one pod would be gone at its next restart. Replace `<subdomain>` with the subdomain you will serve the site on. `wordpress-php` raises PHP's upload limit from 2 MB to 64 MB.

```yaml
# Settings that aren't secret. The database credentials and WordPress's keys
# and salts live in the Secret wordpress-secrets, created with kubectl.
# Set WP_HOME and WP_SITEURL to the domain you serve the site on.
apiVersion: v1
kind: ConfigMap
metadata:
  name: wordpress-config
  namespace: wordpress
data:
  WORDPRESS_CONFIG_EXTRA: |
    define('WP_HOME', 'https://<subdomain>.cloider.app');
    define('WP_SITEURL', 'https://<subdomain>.cloider.app');
    // Encrypt the connection to the managed MySQL database
    define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
    // WordPress itself comes from the image: update it by changing the image tag
    define('WP_AUTO_UPDATE_CORE', false);
---
# PHP accepts uploads up to 64 MB instead of its default 2 MB
apiVersion: v1
kind: ConfigMap
metadata:
  name: wordpress-php
  namespace: wordpress
data:
  uploads.ini: |
    upload_max_filesize = 64M
    post_max_size = 64M
    memory_limit = 256M
```

The volume for `wp-content`. ReadWriteMany is what lets both replicas mount it:

```yaml
# wp-content holds uploads, themes and plugins. ReadWriteMany lets every
# replica mount it at the same time.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: wp-content
  namespace: wordpress
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: cloider-standard-rwx
  resources:
    requests:
      storage: 5Gi
```

The Deployment runs two replicas of the official image. It reads its settings from the ConfigMap and the Secret, mounts the volume on `wp-content` and the PHP settings into PHP's config folder. The readiness probe asks for `/wp-login.php`, so a pod only gets traffic once PHP answers. The liveness probe only checks the port, so a slow database makes pods unready instead of restarting them.

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress
  namespace: wordpress
  labels:
    app: wordpress
spec:
  replicas: 2
  selector:
    matchLabels:
      app: wordpress
  template:
    metadata:
      labels:
        app: wordpress
    spec:
      containers:
        - name: wordpress
          image: wordpress:7.1-php8.5-apache
          ports:
            - name: http
              containerPort: 80
          envFrom:
            - configMapRef:
                name: wordpress-config
            - secretRef:
                name: wordpress-secrets
          volumeMounts:
            - name: wp-content
              mountPath: /var/www/html/wp-content
            - name: php
              mountPath: /usr/local/etc/php/conf.d/uploads.ini
              subPath: uploads.ini
          readinessProbe:
            httpGet:
              path: /wp-login.php
              port: http
            periodSeconds: 10
            timeoutSeconds: 5
          livenessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            periodSeconds: 10
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 512Mi
      volumes:
        - name: wp-content
          persistentVolumeClaim:
            claimName: wp-content
        - name: php
          configMap:
            name: wordpress-php
```

And a ClusterIP Service in front of the pods:

```yaml
apiVersion: v1
kind: Service
metadata:
  name: wordpress
  namespace: wordpress
spec:
  selector:
    app: wordpress
  ports:
    - name: http
      port: 80
      targetPort: http
```

Apply all four with **Apply YAML** on the cluster page: paste them one after the other, separated by `---`, and click **Apply**. `kubectl apply -f k8s/` does the same from your terminal. In the screenshot the subdomain is filled in.

![The Apply YAML dialog with the wordpress-config ConfigMap, its site address filled in, and the start of the wordpress-php ConfigMap in the editor](https://cloider.com/blog/media/2a09706c69c8dba90e919eab7ee6d420.webp "Paste the manifests and apply them.")

Within a minute both replicas are running, on different nodes:

![The Pods view of the cluster page with two wordpress pods Running and ready](https://cloider.com/blog/media/0e30faf5c13db8777b3f1913843dceb1.webp "Two replicas of WordPress.")

The **PersistentVolumeClaims** view shows the `wp-content` volume bound, and mounted by both pods:

![The PersistentVolumeClaims view with wp-content Bound, 5Gi, class cloider-standard-rwx, ReadWriteMany, mounted by both wordpress pods](https://cloider.com/blog/media/3690e219cc01f68b2c8911d45123785d.webp "One volume, mounted by every replica.")

## Step 5: Put it on a free HTTPS subdomain

You don't need an Ingress controller or a load balancer. Open **Domains**, click **Add Domain** and choose **Subdomain**. Type the name you put in the ConfigMap and check that it is free. On the next step, **Connect your apps**, click **Add target**, choose **Cluster**, then the `wordpress` cluster, namespace and Service, on port 80:

![The Add a new target dialog with the Cluster type, the wordpress cluster, the wordpress namespace, the wordpress Service, port 80 TCP and the path /](https://cloider.com/blog/media/faba083eb55e9ddae6e575ab37c3a3bf.webp "A target routes the subdomain to the Service.")

Save the target, then click **Add subdomain** to claim it:

![The Connect your apps step listing one Cluster target to the wordpress Service in the wordpress namespace on port 80](https://cloider.com/blog/media/f361f23bcac98c3fb64abfa3bc78f1a1.webp "Click Add subdomain to claim it with this target.")

Cloider serves the subdomain over HTTPS straight away, and its load balancer accepts uploads up to 100 MB.

## Step 6: Install WordPress

Open `https://<subdomain>.cloider.app`. WordPress already has its database, so the installer starts at the language. Finish it right away: until it is done, anyone who opens the address could install the site for themselves.

![The WordPress installer asking for a default language, with English (United States) selected](https://cloider.com/blog/media/56f2fdb499e86b9d04ed1e21ae061bc1.webp "The installer skips the database step: the Secret already configured it.")

Give the site a title and create your admin account:

![The WordPress Information needed form with the site title Jane Doe, the username jane, a strong password, the email jane@example.com and the Install WordPress button](https://cloider.com/blog/media/1595c3f4e18d97a7a24900011cdf02ea.webp "Your admin account. The password is hidden in this screenshot.")

![The WordPress Success page saying WordPress has been installed, with the username jane](https://cloider.com/blog/media/aea815baab63faa938d71bcb8c105de5.webp "Installed.")

The site is live, served by two replicas over HTTPS:

![The new WordPress site with the title Jane Doe and its Hello world! post](https://cloider.com/blog/media/ffb8dad39b2c43132eadfd7ed908bd2e.webp "WordPress on Kubernetes, on a free subdomain.")

---

## Option 2: deploy with the cloider CLI

This time every step is in the terminal, and neither the database password nor the keys are ever printed. Install the CLI and log in first: `curl -fsSL https://cloider.com/install.sh | sh`, then `cloider login`. Run the commands from the folder that holds `k8s/`.

## Step 1: Create the cluster and the database

Create the cluster, then a MySQL database that only the cluster may reach:

```bash
cloider cluster create wordpress-cli --wait
cloider db create wordpress-cli-db --engine mysql --user wordpress --trusted-source cluster:wordpress-cli --wait
```

![cloider cluster create wordpress-cli --wait creating a Kubernetes 1.36 cluster and reporting it ready](https://cloider.com/blog/media/f412d3a2a69aac55070973a030561452.webp "The cluster is ready.")

![cloider db create wordpress-cli-db creating a MySQL 9 database on the Hobby plan with the trusted source cluster:wordpress-cli, ready](https://cloider.com/blog/media/ef1bc5064c85cde4c972736236394fac.webp "The database trusts only the cluster.")

## Step 2: Connect kubectl and create the Secret

Point kubectl at the cluster and create the namespace:

```bash
cloider cluster kubeconfig wordpress-cli --merge --use
kubectl create namespace wordpress
```

![cloider cluster kubeconfig adding the cloider-wordpress-cli context and kubectl creating the wordpress namespace](https://cloider.com/blog/media/34d621555e057b490fc9862acdf7236d.webp "kubectl now uses the new cluster.")

Create the Secret straight from the CLI's output. `cloider db get -o json` has the private host, port, database name and user, and `cloider db password` prints the password into the command, not on screen:

```bash
DB=$(cloider db get wordpress-cli-db -o json)
kubectl -n wordpress create secret generic wordpress-secrets \
  --from-literal=WORDPRESS_DB_HOST="$(jq -r '.private_host + ":" + .database_port' <<<$DB)" \
  --from-literal=WORDPRESS_DB_NAME="$(jq -r .database_name <<<$DB)" \
  --from-literal=WORDPRESS_DB_USER="$(jq -r .database_user <<<$DB)" \
  --from-literal=WORDPRESS_DB_PASSWORD="$(cloider db password wordpress-cli-db)" \
  $(for k in AUTH_KEY SECURE_AUTH_KEY LOGGED_IN_KEY NONCE_KEY \
             AUTH_SALT SECURE_AUTH_SALT LOGGED_IN_SALT NONCE_SALT; do
      echo "--from-literal=WORDPRESS_$k=$(openssl rand -hex 32)"; done)
```

![The terminal creating wordpress-secrets from cloider db get and cloider db password, with eight generated keys and salts](https://cloider.com/blog/media/bb335582399840af504f349af31ba85f.webp "The Secret, without a secret on screen.")

## Step 3: Apply the manifests

Set the subdomain you will claim in step 4, apply the manifests and wait for the rollout. On Linux, write `sed -i` without the empty quotes:

```bash
sed -i '' 's/<subdomain>/your-subdomain/' k8s/config.yaml
kubectl apply -f k8s/
kubectl -n wordpress rollout status deployment/wordpress
```

![sed setting the subdomain in k8s/config.yaml, kubectl apply -f k8s/ creating two ConfigMaps, the PersistentVolumeClaim, the Deployment and the Service, and the rollout finishing](https://cloider.com/blog/media/b8cefe05eec6d79e2eb9c11041ff8b79.webp "Applied and rolled out.")

## Step 4: Expose it on a free HTTPS subdomain

Claim the subdomain and add a target that routes it to the Service:

```bash
cloider cluster services wordpress-cli
cloider domain create <subdomain>.cloider.app
cloider target create <subdomain>.cloider.app --cluster wordpress-cli --service wordpress/wordpress
```

![cloider cluster services listing the wordpress Service, cloider domain create claiming a cloider.app subdomain, and cloider target create routing it to wordpress-cli/wordpress/wordpress:80](https://cloider.com/blog/media/e17a25025209e049680aeebe7a1a093f.webp "The subdomain routes to the Service.")

Open `https://<subdomain>.cloider.app` and install WordPress as in step 6 of option 1.

---

## Option 3: let an AI coding agent deploy it

With the CLI installed and logged in, open a folder in your AI coding agent and ask:

```
using cloider cli deploy wordpress to cloider kubernetes engine
```

`cloider --help` points agents to [docs.cloider.com/llms.txt](https://docs.cloider.com/llms.txt), the deployment strategy they follow on Cloider. It tells them to start with `cloider whoami`, to use a managed database rather than running MySQL in the cluster, and to use Kubernetes when you ask for it, as this prompt does. The commands are the ones in option 2, and the same commands are available as tools through the Cloider MCP server, `cloider mcp`. See [AI coding agents in the docs](https://docs.cloider.com/mcp/ai-coding-agents).

---

## Running it day to day

- **Update WordPress**: change the image tag in `k8s/deployment.yaml` and apply it. The new pods start with the new version, one at a time. If the release changes the database, WordPress asks you to update it the next time you open `/wp-admin`. Plugins and themes update from the WordPress dashboard as usual, since they live on the shared volume.
- **Change a setting**: pods read the ConfigMaps and the Secret when they start, so after changing one, run `kubectl -n wordpress rollout restart deployment/wordpress`.
- **Scale**: `kubectl -n wordpress scale deployment/wordpress --replicas=3`. Every replica mounts the same volume. Each busy PHP worker holds a database connection, and the Hobby plan allows 20, so pick a bigger plan before you add many replicas.
- **Use your own domain from the start**: WordPress writes the site address into posts and settings, so moving to another domain later means updating those too. Add the domain under **Domains** with a target to the same Service, and put it in `WP_HOME` and `WP_SITEURL`.
- **Back up**: the managed database keeps point-in-time recovery for 14 days, so you can restore any second of that window into a new database. For `wp-content`, copy it out with `kubectl -n wordpress exec deploy/wordpress -- tar czf - -C /var/www/html wp-content > wp-content.tgz`, or keep your media in object storage with an S3 offload plugin. Which belongs where is covered in [persistent volumes vs object storage](https://cloider.com/blog/persistent-volumes-vs-object-storage).

## Troubleshooting

- **Error establishing a database connection**: the host, port or password in `wordpress-secrets` is wrong, or the cluster isn't in the database's trusted sources. Fix the Secret (`kubectl -n wordpress delete secret wordpress-secrets`, create it again) and restart the Deployment.
- **Pods stay Pending**: the `wp-content` claim isn't bound. Check `kubectl -n wordpress get pvc`: it needs the `cloider-standard-rwx` storage class for ReadWriteMany.
- **Logged out at random**: the keys and salts differ between replicas. Set all eight in the Secret, as in step 3.
- **Links or styles point to the wrong address**: `WP_HOME` and `WP_SITEURL` in `k8s/config.yaml` don't match the domain. Fix them, apply, and restart the Deployment.
- **The uploaded file exceeds the upload\_max\_filesize directive**: the `wordpress-php` ConfigMap isn't mounted, or the file is over 64 MB. Raise both values in `uploads.ini` up to 100 MB, the most Cloider's load balancer accepts.
- **Too many connections**: more PHP workers than the database plan allows connections. Use fewer replicas or a bigger plan.

## What it costs

A cluster is billed for the CPU and memory its workloads use, and volumes at $0.50 per GiB a month, so the 5 GiB `wp-content` volume is $2.50 a month. The Hobby MySQL plan is $3.99 a month. Everything is charged by the hour, and targets on a free subdomain cost nothing extra. A new account's welcome credit covers this guide. Delete the cluster, the database and the subdomain when you're done.

## Frequently asked questions

### Can WordPress run with more than one replica on Kubernetes?

Yes, when wp-content is on ReadWriteMany storage that every replica mounts and the eight keys and salts are the same in every pod. Set them in a Secret: the official image otherwise generates random ones per container, and users get logged out whenever a request reaches another replica.

### Should I run MySQL inside the Kubernetes cluster for WordPress?

A managed database is simpler: Cloider runs MySQL with backups and 14 days of point-in-time recovery, and pods reach it on its private host over TLS. Add the cluster as the database's trusted source so nothing else can connect.

### How do I update WordPress on Kubernetes?

Change the image tag in the Deployment and apply it. Each new pod starts with the new version, and WordPress asks to update the database in /wp-admin if the release needs it. Turn off automatic core updates (WP_AUTO_UPDATE_CORE false), since an update inside a pod is lost when it restarts.

### Do I need an Ingress controller for WordPress on Cloider Kubernetes?

No. Claim a free cloider.app subdomain or add your own domain, and add a target that routes it to the wordpress Service. Cloider terminates HTTPS, and the official image trusts the X-Forwarded-Proto header, so WordPress generates https links.

### How large can WordPress uploads be on Cloider?

This guide sets PHP's upload_max_filesize and post_max_size to 64 MB in a ConfigMap. Cloider's load balancer accepts request bodies up to 100 MB.


Tags: kubectl, Kubernetes, MySQL, PHP, Tutorial, WordPress
