Deploy Fast WordPress

WordPress with object cache, OPcache and tuned MariaDB

Deploy Fast WordPress

Just deployed

/var/www/html

Just deployed

/var/lib/mysql

Deploy and Host High-Performance WordPress on Railway

This template deploys WordPress 7.1.3 on PHP 8.4 with OPcache, a persistent Valkey object cache and a tuned MariaDB 12.3.3, all wired together across three Railway services with no deploy-time input. It is for anyone who wants self hosted WordPress that is fast out of the box.

About Hosting WordPress open-source software on Railway (self hosted WordPress template)

You own everything that matters: the MariaDB volume at /var/lib/mysql, uploads, themes, plugins. Nothing to configure at deploy time. Railway adds the public domain, TLS and health checks, so you skip the server patching and the installer is the only step left.

Why Deploy fast WordPress, the WP Engine alternative on Railway (Railway Free Trial)

WP Engine charges per plan for caching and support that you can only partly rebuild yourself. On Railway you pay for RAM and traffic, about $5 to $20 a month for a small to medium site, keep full control of the stack, and you can try it on the $5 trial first.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying WordPress on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for WordPress self hosting

A raw VPS hands you a server; Railway hands you the wired stack.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanThree services deployed together with private networking and a volume.A droplet you assemble by hand, including the Redis object cache and database tuning.
AWSManaged database and cache already referenced by WordPress, on one bill.EC2, RDS and ElastiCache billed apart, plus IAM and security groups.
HetznerThe same template in minutes, with OPcache and cache limits already set.Cheap compute, but patching, backups and cache tuning are yours.

Less setup on Railway, more control on a bare VPS.

Common Use Cases for hosted WordPress

  • Content sites and blogs: editorial teams get the Valkey object cache and OPcache already wired together, so repeat traffic skips most database queries.
  • Small business and brochure sites: a handful of pages, a contact form and a MariaDB buffer pool sized for modest traffic, with nothing to tune on day one.
  • WooCommerce stores up to a point: cart and checkout still hit PHP and MariaDB on every request, so watch RAM before you scale up the plan.
  • Staging and client demos: deploy a copy, run the installer, hand over a domain. Valkey has no volume, so restarts cost you a cold cache and nothing else.
  • Agencies running many small sites: one Railway project per client with all 32 variables defaulted, so onboarding is a deploy plus the standard installer form.

Dependencies for WordPress Docker hosted on Railway

This template runs three Railway services and takes no deploy-time input. WordPress comes from a pinned image, MariaDB 12.3.3 holds the data, and Valkey 9.1.2 caches objects. All 32 variables ship with defaults, so the first deploy works as is.

Deployment Dependencies for Managed WordPress Service (CMS)

  • WordPress: ghcr.io/onepush-dev/wordpress:7.1.3-php8.4, pinned by digest, built by GitHub Actions. Port 80, health check /healthz, volume at /var/www/html.
  • MariaDB: 12.3.3, volume at /var/lib/mysql, MARIADB_AUTO_UPGRADE on.
  • Valkey: 9.1.2, password protected, 256mb maxmemory with LRU eviction, no volume. It is a cache, so a restart just refills it.

Implementation Details for WordPress (PHP 8.4, OPcache, Valkey object cache, MariaDB)

OPcache runs at 256 MB and the Redis Object Cache drop-in talks to Valkey over phpredis with igbinary, so Site Health shows the cache active after setup. MariaDB gets a tuned InnoDB buffer pool via MARIADB_INNODB_BUFFER_POOL_SIZE.

How does this WordPress template compare against managed WordPress hosting

Short version: the template wins on speed per dollar and on access to the stack, and the managed hosts win on support. Here is the detail.

This Template vs Stock WordPress Templates (Docker Image Alternative)

  • What ships: stock templates pair the official image with MySQL; this one adds OPcache at 256 MB, a persistent Valkey object cache and a tuned MariaDB 12.3.3.
  • Measured gap: home page 53 ms vs 92 ms, REST posts 30 ms vs 61 ms, search 55 ms vs 94 ms in server time.
  • Where stock wins: fewer services and a smaller bill if the object cache never warms up on a tiny site.

This Template vs WP Engine (Managed WordPress Alternative)

  • What you control: no plan tiers or per-visit meters; PHP limits, cache and database tuning are 32 defaulted variables you can edit.
  • Cost shape: about $5 to $20/mo on Railway for a small to medium site.
  • Where WP Engine wins: managed patching, support and a CDN come with the subscription, and updates are not your job.

This Template vs Kinsta (Kinsta Alternative)

  • Caching model: Kinsta bundles edge and page caching; this gives you object caching and OPcache, so add a page cache plugin for full-page HTML.
  • Where Kinsta wins: support and infrastructure tuning are their job, not yours, and that matters when a plugin breaks at 2am.

This Template vs WordPress.com (Hosted Alternative)

  • Plugin freedom: lower WordPress.com plans limit plugins; here you install anything and the Valkey cache is already wired.
  • Where WordPress.com wins: nothing to operate, and the free tier costs nothing to test.

How to use WordPress after deploying?

Five things to do on day one, in order.

  1. Open the Railway public domain and finish the standard installer: site title, admin user, password. Nothing else needs input at deploy time.
  2. Open Tools, Site Health and check that the Redis Object Cache drop-in is active and talking to Valkey.
  3. Add your custom domain in Railway, then set WP_HOME to https://your-domain and redeploy so links and the admin stay correct.
  4. Raise PHP_UPLOAD_LIMIT, PHP_MEMORY_LIMIT or PHP_MAX_EXECUTION_TIME only if your theme or plugins need more headroom.
  5. Install your theme and plugins. If you want full-page caching, add a page cache plugin; this template ships object caching only.

How to self host WordPress on other VPS Services (WordPress self hosting guide)

The same stack runs on any Ubuntu VPS: PHP 8.4, MariaDB 12.3.3, Valkey 9.1.2 and WordPress 7.1.3. Three commands and one config file.

Clone the Repository

Clone the image repo to read the Dockerfile and Apache config.

git clone https://github.com/onepush-dev/wordpress
cd wordpress

Install Dependencies

Install PHP 8.4 with phpredis and igbinary, MariaDB, Valkey and OPcache.

sudo apt install php8.4 php8.4-redis php8.4-igbinary mariadb-server valkey

Configure Environment Variables

Copy the sample env, fill in database and Valkey values, set your domain.

WP_HOME=https://your-domain
PHP_MEMORY_LIMIT=512M
PHP_UPLOAD_LIMIT=256M
WP_REDIS_HOST=127.0.0.1

Start the WordPress Application

Point Apache at the docroot, open the domain and finish the installer. Site Health should show the object cache drop-in active.

On Railway all of this is already wired: three services, generated passwords, volumes and health checks.

Official Pricing of WordPress (WordPress pricing)

WordPress is free software under GPLv2, so there is no license fee, no per-seat charge and nothing to pay Automattic. You pay for the machines it runs on. On Railway that means three services on one bill: WordPress, MariaDB and Valkey. A small to medium site usually lands around $5-20 per month depending on traffic and RAM, and the cache is capped at 256 MB so it can't quietly grow. The $5 Railway trial covers the first deploy and first run.

WordPress on Railway vs WP Engine cost comparison (Pricing, features, costs, and more)

Monthly cost of self hosting WordPress on Railway

Railway bills for what you use, so a small to medium WordPress site runs about $5-20/mo depending on traffic and RAM, and the $5 trial covers your first checks. WP Engine sells plan tiers instead, bundling its own caching and support into a fixed monthly price.

System Requirements for Hosting WordPress on a VPS

Plan on 512 MB to 1 GB RAM for WordPress plus MariaDB, with Valkey capped at 256 MB. This template already runs PHP 8.4, MariaDB 12.3.3 and serves port 80, so a 1 GB instance covers a small site with room for the database.

Frequently Asked Questions (FAQs)

Do I need to finish the WordPress installer?

Yes. Open the public domain and complete the standard setup screen: site title, admin user, password. Nothing is asked of you at deploy time.

How do I confirm the object cache is active?

Open Tools, then Site Health, and confirm the Redis Object Cache drop-in shows as active. If WP_REDIS_DISABLED is set to true, the cache is off by design.

How do I raise the upload limit?

Change PHP_UPLOAD_LIMIT, which defaults to 256M, on the WordPress service and redeploy. PHP_MEMORY_LIMIT and PHP_MAX_EXECUTION_TIME sit right next to it.

Can I use a custom domain?

Yes. Add the domain in Railway, then set WP_HOME to https://your-domain so WordPress builds correct URLs. Leave the internal database and Valkey references untouched.

Are plugins and page caching included?

No full-page cache plugin ships with the image; add one if you want it. Object caching is already wired to Valkey, and WP_REDIS_DISABLED turns it off.

How do I back up the site?

Snapshot the WordPress volume at /var/www/html and dump MariaDB on a schedule. Valkey holds nothing worth saving, so skip it.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
2
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
170