Host a fast WordPress site on Railway with Redis
Short answer: to host WordPress on Railway with better defaults than a bare container, use a template that adds a persistent Redis object cache, a MariaDB database on the private network, tuned PHP and a cron service. The Tracklayer template deploys WordPress 7.1 (PHP 8.3, Apache), MariaDB 12.3 and Redis 8.2, installs the site on first boot and keeps plugins, themes and uploads on a volume.
Deploy WordPress on RailwayWhat a default WordPress container leaves out
WordPress needs a MySQL-compatible database, a web server and durable storage for uploads, plugins and themes. A basic container install runs, but according to the template’s notes it leaves three things on the table:
- every page load rebuilds options from the database, which an object cache avoids,
- scheduled tasks only run when someone visits the site,
- default PHP limits are too small for real media libraries.
The template addresses each: Redis as the object cache, a Railway cron service that calls wp-cron.php every five minutes, and PHP and OPcache settings you can adjust with variables.
WordPress templates people deploy on Railway
| Template | Creator | Deployments | Services |
|---|---|---|---|
| WordPress | Jack | 7,564 | 2 |
| WordPress + MySQL | YAV.AI | 1,517 | 2 |
| WordPress (MPM Patched) | gzip | 466 | 2 |
| WordPress | High Performance Self-Hosted CMS Server | Heimdall | 193 | 2 |
| WordPress 7 Turbo (Redis Cache + MariaDB) | Tracklayer | 10 | 4 |
Railway marketplace data as of 2026-11-19. Full ranking: Best WordPress templates on Railway.
Check each template’s services before you choose. A WordPress template without a cache service or a persistent volume behaves differently from one with both.
Deploy WordPress on Railway, step by step
These steps use Tracklayer’s WordPress 7 with Redis cache and MariaDB template.
- Deploy the template. The only required input is
WP_ADMIN_EMAIL. It creates WordPress, MariaDB, Redis and a WP Cron service. - Wait for WordPress to turn healthy. The first boot installs WordPress and the Redis Object Cache plugin.
- Find your login. Open the WordPress service, then Variables. The username is
WP_ADMIN_USER(defaultsiteadmin) and the password is the generatedWP_ADMIN_PASSWORD. - Sign in at
/wp-adminon the service’s public domain and change the password in Users, Profile. - Check the cache. In Settings, Redis, the status should read Connected.
- Add your domain (optional). Add it to the WordPress service, set
WP_PUBLIC_URLtohttps://your-domain, redeploy, then run this once from a shell on the service:
wp search-replace 'https://old-domain' 'https://your-domain' --all-tables --allow-root
Persistence and backups
Plugins, themes and uploads are on a volume at wp-content, and MariaDB has its own volume, so both survive redeploys. The template does not include an automatic backup job. Before changing MariaDB major versions, export the database with wp db export --allow-root and keep the file somewhere outside the service.
Scaling and upgrades
The WordPress service owns a volume, so it scales vertically. Raise the service’s memory and APACHE_MAX_REQUEST_WORKERS together; the template notes about 60 MB per worker. PHP limits (PHP_MEMORY_LIMIT, PHP_UPLOAD_MAX_FILESIZE, PHP_POST_MAX_SIZE, PHP_MAX_EXECUTION_TIME) are variables too.
To upgrade WordPress, change WORDPRESS_IMAGE_TAG in the template’s Dockerfile to a newer tag and redeploy. The boot script runs wp core update-db for you.
What it costs
Railway bills usage. The template’s figures are estimates, not measurements: about $5 to $6 per month for an idle or low-traffic site, about $17 per month for a typical small business site, and about $35 to $45 per month for a busy site with PHP workers saturated. Memory drives most of it. Every service fits the Trial plan’s 1 GB per service, which is enough to evaluate; the template names Hobby as the minimum for a production site.
What the four services do
| Service | Role |
|---|---|
| WordPress | Apache, PHP 8.3, WP-CLI, a /healthz endpoint and the wp-content volume |
| MariaDB | The database, on the private network with its own volume |
| Redis | Password-protected object cache backend |
| WP Cron | Calls wp-cron.php over the private network every 5 minutes |
The cron interval is the WP Cron service’s schedule, with a minimum of 5 minutes.
Limits
- Uploads are limited by the volume size of your plan (5 GB on Hobby).
- The logged client IP may be Railway’s proxy address, because Apache trusts only private ranges by default.
- The template’s own notes say the first Railway build should confirm some build steps; check the deploy logs on your first deploy.
Other options
For more choices, see WordPress templates on Railway. If you only need a database or cache, see MySQL and MariaDB templates and Redis and Valkey templates.
FAQ
How do I log in to WordPress after deploying?
Enter WP_ADMIN_EMAIL when you deploy and wait for the WordPress service to turn healthy. Open the public domain at /wp-admin and sign in with WP_ADMIN_USER (default siteadmin) and the generated WP_ADMIN_PASSWORD from the service's Variables tab. Change the password in Users, Profile, then check that Settings, Redis shows Connected.
What persists across redeploys?
The wp-content folder (plugins, themes, uploads) and the MariaDB data are on volumes. Core WordPress files come from the container image and are refreshed on every deploy, so the dashboard's one-click core update is hidden. Plugins and themes update from the dashboard as usual.
How do I use my own domain?
Add the domain to the WordPress service, set WP_PUBLIC_URL to https://your-domain, redeploy, then run wp search-replace once from a shell on the service to rewrite stored links.
Where do I store large media libraries?
Uploads live on the wp-content volume, which is 5 GB on the Hobby plan; use Pro when uploads will exceed that. Offloading media to a Railway Bucket needs a third-party plugin and is not part of this template.
What licences are involved?
WordPress and MariaDB are GPL, the Redis Object Cache plugin is GPL-3.0-or-later, and Redis 8 is tri-licensed (RSALv2, SSPLv1, AGPLv3). This is a community template, not affiliated with WordPress.