GGideondevops

Deploying Strapi on a Kubernetes Cluster

25 Jul 2026, 1:41 pm

Strapi is a headless CMS with an intuitive admin dashboard, custom content types, and role-based permissions, well-suited to Kubernetes for its scalability and multi-environment support. This guide builds a Strapi app, containerizes it, and deploys it to Kubernetes behind an Nginx Ingress Controller with cert-manager TLS.

Prerequisites: a Kubernetes cluster with kubectl/helm configured, a PostgreSQL database, Docker on your workstation, a domain (this guide uses strapi.example.com) pointed at the ingress load balancer once provisioned.

Build the Strapi Application Install Node.js: Configure Git if not already set up: Scaffold a project:

Once it's running, press Ctrl+C to stop the dev server and continue configuring it.

Containerize the Application Point it at PostgreSQL — edit .env in the project directory:

Replace config/server.js:

Set the URL, install the PostgreSQL driver, rebuild, run:

Visit http://:1337 and confirm the admin registration screen loads. Build and Push the Docker Image Dockerfile:

.dockerignore:

Build, tag, push:

Prepare the Cluster Install the Nginx Ingress Controller

A LoadBalancer provisions automatically:

It may take a few minutes for EXTERNAL-IP to populate. Install cert-manager and a ClusterIssuer

Point your domain's A record at the Ingress controller's EXTERNAL-IP, then:

READY: True confirms it's live.

Deploy Strapi Deployment (2 replicas):

regcred is a pull secret if your image lives in a private registry. Service:

Ingress with TLS:

Visit https://strapi.example.com — you should hit the login page over HTTPS.

Scale the Deployment

Scale back down:

Test fault tolerance by deleting a pod. Kubernetes replaces it and the Ingress routes around the gap with no downtime:

Next Steps

Strapi is running on Kubernetes with TLS termination and horizontal scaling. From here: • Add a HorizontalPodAutoscaler to scale on CPU/memory instead of manually • Move media uploads to S3-compatible object storage via a Strapi upload provider plugin • Set resource requests/limits on the Deployment to avoid noisy-neighbor scheduling issues

For the full guide, visit the original article on Vultr Docs.

https://dev.to/vultr/deploying-strapi-on-a-kubernetes-cluster-384b

Join the conversation

Sign up to like, save, comment, and connect with techies who think like you.

Log in / Sign up