---
title: "Deploy WordPress (MariaDB, WP-CLI)"
description: "WordPress 7 on MariaDB: 128 MB uploads, HTTPS behind the proxy, WP-CLI"
category: "CMS"
url: https://railway.com/deploy/wordpress-mariadb-wp-cli
---

# Deploy WordPress (MariaDB, WP-CLI)

WordPress 7 on MariaDB: 128 MB uploads, HTTPS behind the proxy, WP-CLI

**[Deploy WordPress (MariaDB, WP-CLI) on Railway](https://railway.com/template/wordpress-mariadb-wp-cli)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/wordpress-mariadb-wp-cli/manifest.json

- **Creator:** Dektion Studio
- **Category:** CMS
- **Total deploys:** 2

## Template content

### MariaDB https://cdn.jsdelivr.net/gh/devicons/devicon@v2.16.0/icons/mariadb/mariadb-original.svg

- **Image:** mariadb:11.8

### WordPress https://cdn.jsdelivr.net/gh/devicons/devicon@v2.16.0/icons/wordpress/wordpress-plain.svg

- **Source:** dektionstudio/railway-template-images
- **Health check:** /wp-admin/install.php
- **Public domain:** Yes

## Documentation

# Deploy and Host WordPress (MariaDB, WP-CLI) on Railway

This template runs the official WordPress 7.1 image on PHP 8.4 with MariaDB 11.8 LTS. Uploads go up to 128 MB, WordPress knows it's served over HTTPS behind Railway's proxy, and WP-CLI is installed. The site files and the database each live on a volume.

The official WordPress image doesn't start on Railway as is. Apache stops with "More than one MPM loaded". I traced it: the image turns off one Apache module by deleting its link in a later layer, and on Railway that link is back at runtime. The popular WordPress templates here work around it with a long start command that also patches `php.ini` on every boot, and they run unpinned `latest` images. This one fixes it inside the image and pins the versions.

## About Hosting WordPress (MariaDB, WP-CLI)

When the deploy finishes, open `WORDPRESS_URL` from the Variables tab of the WordPress service. You land on the WordPress installer: pick a site title and an admin login, and you're done.

Before publishing I ran the whole thing end to end. The installer finished, and the home page had 30 links on https and none on http. I created an application password, which WordPress only allows over HTTPS, and used it to upload an 8 MB file through the REST API in 1.1 seconds. Then I restarted WordPress and MariaDB at the same time. The site was back 51 seconds later, still installed, and the file downloaded fine.

At idle WordPress used 246 MB of RAM and MariaDB 163 MB, about $4 a month together.

## Common Use Cases

- A blog or a small business site on your own domain
- A headless CMS: the REST API and application passwords work over HTTPS, so a Next.js or Astro front end can read and write content

## Dependencies for WordPress (MariaDB, WP-CLI) Hosting

None. The database, its password and the connection between the two services are set up for you.

### Deployment Dependencies

- WordPress image: `wordpress:7.1-php8.4-apache` (https://hub.docker.com/_/wordpress)
- MariaDB image: `mariadb:11.8` (https://hub.docker.com/_/mariadb)
- The Dockerfile this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/wordpress

### Implementation Details

To use your own domain, add it in the WordPress service's Settings on Railway, then change WordPress Address and Site Address under Settings, General in WordPress.

WordPress core, themes, plugins and uploads live on the WordPress volume, so updates from the WordPress dashboard stick. The image version only matters for the first install.

WP-CLI is in the image. Open a shell with `railway ssh` from the Railway CLI and run it as root, for example `wp --allow-root plugin list`.

WordPress sends email with PHP's `mail()`, and there's no mail server in this setup, so password reset emails won't arrive until you install an SMTP plugin and connect a provider such as Resend or Postmark.

The PHP limits (128 MB uploads, 256 MB memory) are set in the image. Apache takes the visitor's address from Railway's `X-Real-IP` header, so the access logs and security plugins that block by IP see visitors instead of Railway's proxy.

## Why Deploy WordPress (MariaDB, WP-CLI) on Railway?

You get a WordPress site without renting and patching a server, and the bill follows the RAM it uses. Both volumes survive redeploys, so updating the image or restarting doesn't touch your content.


## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/wordpress-mariadb-wp-cli
