Railway

Deploy Wordpress

Self host Latest Wordpress with Railway

Deploy Wordpress

MariaDB

mariadb

Just deployed

/var/lib/mysql

wordpress

wordpress

Just deployed

/var/www/html

Deploy and Host Wordpress on Railway

WordPress is the world's most popular open-source content management system (CMS) for building websites, blogs, business sites, and online stores. With thousands of themes and plugins, including WooCommerce, WordPress enables users to create highly customizable websites without extensive programming knowledge while remaining flexible enough for enterprise-scale deployments.

About Hosting Wordpress

Hosting WordPress on Railway provides a managed environment for running your website without maintaining servers or web infrastructure. This template deploys the official WordPress container alongside a MariaDB database for persistent content storage. A Railway Volume stores uploaded media, themes, plugins, and other WordPress content so it persists across deployments. Railway automatically provisions HTTPS, public networking, and secure service-to-service communication between WordPress and MariaDB. As your website grows, Railway makes it easy to scale resources while continuing to manage infrastructure, networking, and deployment for you.

Common Use Cases

  • Create blogs, business websites, portfolios, and content-driven publications.
  • Build e-commerce stores using WooCommerce and the WordPress plugin ecosystem.
  • Develop membership sites, documentation portals, landing pages, and online learning platforms.

Dependencies for Wordpress Hosting

DependencyPurpose
MariaDBStores WordPress content, users, settings, and metadata.
Railway VolumePersists uploads, themes, plugins, and other WordPress files.

Deployment Dependencies

ResourceLink
WordPress Websitehttps://wordpress.org
WordPress Installation Guidehttps://developer.wordpress.org/advanced-administration/before-install/howto-install/
Official Docker Imagehttps://hub.docker.com/_/wordpress
WordPress Requirementshttps://wordpress.org/about/requirements/

Implementation Details

Docker

This template deploys:

ServiceImage
WordPresswordpress (Official Docker Image)
MariaDBmariadb

Railway automatically deploys both services without requiring custom build commands.

Public Networking

SettingValue
Proxy TypeHTTP Proxy
Target Port80

Generate a Railway domain from Settings → Networking → Generate Domain to access your WordPress site over HTTPS.

Environment Variables

VariableRequiredDescription
WORDPRESS_DB_HOSTYesRailway MariaDB private hostname.
WORDPRESS_DB_NAMEYesWordPress database name.
WORDPRESS_DB_USERYesMariaDB username.
WORDPRESS_DB_PASSWORDYesMariaDB password.
WORDPRESS_TABLE_PREFIXNoCustom database table prefix.
WORDPRESS_DEBUGNoEnables WordPress debug mode.

Example:

WORDPRESS_DB_HOST=${{MariaDB.RAILWAY_PRIVATE_DOMAIN}}
WORDPRESS_DB_NAME=${{MariaDB.MYSQL_DATABASE}}
WORDPRESS_DB_USER=${{MariaDB.MYSQL_USER}}
WORDPRESS_DB_PASSWORD=${{MariaDB.MYSQL_PASSWORD}}

WORDPRESS_TABLE_PREFIX=wp_
WORDPRESS_DEBUG=false

Use Railway reference variables for the MariaDB connection details.

Persistent Storage

WordPress requires persistent storage for uploaded media, installed themes, plugins, and other content.

Add a Railway Volume:

  1. Open the WordPress service.
  2. Navigate to Settings → Volumes.
  3. Select Add Volume.
  4. Mount the volume at:
/var/www/html/wp-content

This ensures uploads and customizations persist across deployments and container updates.

Database

This template requires a MariaDB service.

  • Add the Railway MariaDB service.
  • Configure the WORDPRESS_DB_* environment variables using Railway reference variables.
  • WordPress automatically initializes its database during the installation process.

Build & Start

The application runs from the official WordPress Docker image.

No custom build or start commands are required.

Accessing the Application

After deployment:

  1. Generate a Railway public domain.
  2. Open the generated URL.
  3. Complete the WordPress installation wizard.
  4. Create the administrator account.
  5. Begin installing themes, plugins, and creating content.

If you later connect a custom domain, update the WordPress Address (URL) and Site Address (URL) in the WordPress settings if required.

Why Deploy Wordpress on Railway?

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.


Template Content

MariaDB

mariadb

wordpress

wordpress

More templates in this category

View Template
Libredesk - Complete Setup
[Jul'26] Complete self-hosted omnichannel customer support desk.

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

Instatic
91
View Template
Strapi
A popular self-hosted CMS

Milo
7.7K