Deploy Wordpress
Self host Latest Wordpress with Railway
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
| Dependency | Purpose |
|---|---|
| MariaDB | Stores WordPress content, users, settings, and metadata. |
| Railway Volume | Persists uploads, themes, plugins, and other WordPress files. |
Deployment Dependencies
| Resource | Link |
|---|---|
| WordPress Website | https://wordpress.org |
| WordPress Installation Guide | https://developer.wordpress.org/advanced-administration/before-install/howto-install/ |
| Official Docker Image | https://hub.docker.com/_/wordpress |
| WordPress Requirements | https://wordpress.org/about/requirements/ |
Implementation Details
Docker
This template deploys:
| Service | Image |
|---|---|
| WordPress | wordpress (Official Docker Image) |
| MariaDB | mariadb |
Railway automatically deploys both services without requiring custom build commands.
Public Networking
| Setting | Value |
|---|---|
| Proxy Type | HTTP Proxy |
| Target Port | 80 |
Generate a Railway domain from Settings → Networking → Generate Domain to access your WordPress site over HTTPS.
Environment Variables
| Variable | Required | Description |
|---|---|---|
WORDPRESS_DB_HOST | Yes | Railway MariaDB private hostname. |
WORDPRESS_DB_NAME | Yes | WordPress database name. |
WORDPRESS_DB_USER | Yes | MariaDB username. |
WORDPRESS_DB_PASSWORD | Yes | MariaDB password. |
WORDPRESS_TABLE_PREFIX | No | Custom database table prefix. |
WORDPRESS_DEBUG | No | Enables 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:
- Open the WordPress service.
- Navigate to Settings → Volumes.
- Select Add Volume.
- 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:
- Generate a Railway public domain.
- Open the generated URL.
- Complete the WordPress installation wizard.
- Create the administrator account.
- 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