Deploy WordPress (Node.js/Docker)

Node.js/Docker & Seamless Local Dev (custom plugins/themes/uploads)

Deploy WordPress (Node.js/Docker)

WordPress Application

Just deployed

/var/lib/mysql

Just deployed

/var/www/html

WordPress on Railway

Easily deploy WordPress on Railway with seamless support for local development out of the box.

This templates does not crash on deployment due to the more than one MPM loaded error.

Focal point of this template compared to the others is the local development, so you can easily create/manage custom WordPress plugins, themes and uploads without relying on Railway's SSH to access the files.

The template is flexible and extendable so you can even use it in a monorepo or other project structures.

Common Use Cases

  • You prefer self-hosting WordPress.
  • You want to develop WordPress plugins and themes.
  • You want to use WordPress as a headless CMS (API) for your frontend application.
  • You have an existing WordPress installation and want to migrate/use it on Railway.
  • You can't deploy the other WordPress templates due to crashes from the more than one MPM loaded error.

Deploy and Host

  1. Click the button to use the template.
  2. Follow the instructions (zero-config).
  3. Open the URL assigned by Railway in your browser (eg. https://your-app-name.up.railway.app).
  4. Enjoy!

Deployment Dependencies

About Hosting

This template creates the Apache server (WordPress) and MySQL database for you.

The domain for the WordPress application will be the provided public domain by Railway or your own domain.

Local Development

In case you want to develop WordPress locally.

  • Manage plugins, themes and uploads locally in these directories:
    • ./data/plugins
    • ./data/themes
    • ./data/uploads
  • Will automatically sync local changes to WordPress.
  • Add an existing WordPress installation in ./data/migrate to use it as the base installation.
  • Only plugins, themes and uploads are synced, the rest are ignored by default to avoid messing up the core files of WordPress.
    • Feel free to add more directories if you need them.

Dependencies for this template

Prerequisites for local development.

  • Docker
  • Node.js & npm (optional)
    • Only required for running yarn dev which is easier to remember, but you can run docker compose -f compose.yaml up instead.

Setup

Assuming you have already deployed the template on Railway:

  1. Clone the upstream repository or create a new one using it as a template.
  2. Publish the repository to GitHub.
  3. At Railway change the Source Repo to your cloned repository to automatically redeploy the service from your own GitHub commits (optional).
  4. Either run:
    • yarn install and then yarn dev to start the server.
    • or docker compose -f compose.yaml up.
  5. Open http://localhost:8080 in your browser to access WordPress.

Troubleshooting

Report any issues or suggestions here.

  • If you accidentally delete the directories data/plugins, data/themes, data/uploads or data/migrate you can run yarn dirs to recreate them.

Why Deploy this template 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 (Node.js/Docker) 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.

License


Template Content

More templates in this category

View Template
Strapi
A popular self-hosted CMS

View Template
WordPress with Redis
Deploy WordPress with MariaDB and Redis

View Template
Directus (docker/websocket/extensions) + PostGIS (docker/TCP) + S3/Local
Directus (Docker) + PostGIS (Docker/TCP) + S3