Can I use WordPress on Heroku?

Issue

I want to run a site using WordPress on Heroku.

Resolution

Like any other application, WordPress can be made to work on Heroku but there are some considerations to take into account before deploying a WordPress site.

Like many modern hosting solutions based on containers (such as Docker), the Heroku filesystem is ephemeral - that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy.

This ephemeral filesystem means that any framework like WordPress needs to be used with care as files shouldn't be used for permanent storage. To make WordPress work on Heroku, any uploads will need to be stored on an external service such as Amazon S3. Also, any other plugins that try to use the filesystem (such as W3TotalCache) may behave strangely as the filesystem changes are not shared between running dynos.

To run WordPress on Heroku successfully, we recommend exercising caution in the choice of plugins and storage of uploaded files. There are some more useful starting points here:

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support