Deploy Wordpress to Heroku in < 60 seconds or your money back
Project maintained by mchungHeroku WP is a template for installing and running WordPress on the Heroku cloud application platform with the official Heroku stack. Automattic engineer Xiao Yu created Heroku WP with the goal of keeping it simple, fast, secure, and scalable. He used Heroku’s new PHP buildpack which incorporates nginx and HHVM. Aug 08, 2014 Heroku WP is a template for installing and running WordPress on the Heroku cloud application platform with the official Heroku stack. Automattic engineer Xiao Yu created Heroku WP with the goal of keeping it simple, fast, secure, and scalable. He used Heroku’s new PHP buildpack which incorporates nginx and HHVM. Wordpress-for-Heroku is based on Wordpress Version 5.5. It is made for Developers and Learners to learn Wordpress or test Themes/Plugins. May 26, 2020 You're required to update the Wordpress version number in our Composer.json file, and manually add themes/plugins into our local Wordpress repo before pushing to heroku. This may sound time consuming, but it'll only require an extra 1-2 minutes each time that you need to make a Wordpress version, theme, or plugin update.
Heroku Postgres provides a managed SQL database as a service that is easily accessible from your Heroku applications to persist and manipulate data. All plans feature automatic health checks, off-premises storage, daily backups, SSL-protected access, dataclips, Postgres extensions, and a web Ul.
Hosted on GitHub Pages — Theme by mattgrahamThis is a Heroku buildpack for running Wordpress on Heroku
It uses this Wordpress project template to bootstrap a highly tuned Wordpress site built on the following stack:
nginx
- Nginx for serving web content. Built specifically for Heroku. See compile options.php
- PHP-FPM for process management. See compile options.wordpress
- Downloaded directly from wordpress.org.MySQL
- ClearDB for the MySQL backend.Sendgrid
- Sendgrid for the email backend.MemCachier
- MemCachier for the memcached backend.
You can see a live demo at Wordpress on Heroku.
Getting started in 60 seconds
Fork and rename the Wordpress project template.
Let's clone the repository for a new blog, 99catfacts.com
Create Wordpress on Heroku.
Don't have the Heroku Toolbelt installed? Follow these quickstart instructions. Takes about 2 minutes.
Deploy your Wordpress site to Heroku.
Open your new Wordpress site in a web browser.
Happy? Add your site to the growing list of Wordpress sites runnning on Heroku.
Overview
The buildpack bootstraps a Wordpress site using the mchung/wordpress-on-heroku project template. That repo contains everything required to run your own Wordpress site on Heroku.
There are several files available in config
for configuring your new Wordpress site.
When you deploy Wordpress to Heroku, everything in config
is copied over to Heroku. You can configure your blog by making changes to these files.
A few Wordpress environment variables can be controlled via Heroku using heroku config:set
:

FORCE_SSL_LOGIN
FORCE_SSL_ADMIN
WP_CACHE
DISABLE_WP_CRON
To add a Heroku environment variable: heroku config:set GOOG_UA_ID=UA=1234777-9
See wp-config.php
and documentation from Wordpress for details.
Enabling and configuring the following Wordpress plugins will also speed up Wordpress on Heroku significantly.
heroku-sendgrid
- Configures phpmailer to send SMTP email with Sendgrid.heroku-google-analytics
- Configures Google Analytics to display on your Wordpress site.- GOOG_UA_ID=UA-9999999
wpro
- Configures Wordpress to upload everything to S3.batcache
- Configures Wordpress to use memcached for caching.memcachier
- Use a modern memcached plugin.cloudflare
- OPTIONAL, but very awesome.- If Cloudflare is installed, the plugin configures Wordpress to play nicely with CloudFlare. It sets the correct IP addresses from visitors and comments, and also protects Wordpress from spammers.
- Keep in mind that the free version doesn't support SSL, so you'll need to set both
FORCE_SSL_ADMIN
andFORCE_SSL_LOGIN
to false in order to login.
Usage
Creating your Wordpress site on Heroku
Adding a custom domain name
Note: Adding a domain still requires some DNS setup work. Basically you'll want to do something like this:
I use DNSimple and you should too.
Adding a theme
Adding a plugin
Plugins and themes must be activated via the Plugins panel.
Adding custom secret keys to wp-config.php
Use the Wordpress.org secret-key service to override the default ones in wp-config.php
.
Configuring cron
By default, wp-cron is fired on every page load and scheduled to run jobs like future posts or backups. This buildpack disables wp-cron so that visitors don't have to wait to see the site.
Heroku allows you to trigger wp-cron from their scheduler.
Alternatively, you may also re-enable wp-cron.
Enable system access
The alternative PHP cache and a generic PHPINFO page is available at /apc.php and /phpinfo.php.
Remove the PHP-FPM status page /status.html
Delete the directive from nginx.conf.erb
.
Add a favicon.ico
drop one into public
See #22 for details.
Choosing specific versions of vendored packages
See VERSIONS for how to pick specific versions of Nginx, PHP, and Wordpress
Workflow (optional)
By keeping your changes separate, it'll be easier to pull in changes from the Wordpress site template.
Heroku Wordpress
Assign a remote upstream
Track changes in a separate branch called production
.
Pull changes from upstream into master
.
Pull changes from upstream into production
.
How fast is this?
Pretty freaking fast.
System setup
- Single Heroku dyno
- Default Wordpress installation
- Default twentytwelve theme
- Caching turned up
- Cron disabled
- Memcachier + ClearDB
Here are some benchmarks from Google PageSpeed, Blitz.io, and Web Page Test.
Google PageSpeed
Results from PageSpeed Insights: 94/100
blitz.io
Results from a blitz.io rush
Over 200 page views per second with less than 100ms response time sustained for a minute.
Web Page Performance Test
These tests are periodically rerun on Wordpress on Heroku.
But doesn't Heroku only run Ruby applications?
Not anymore. Heroku's latest offerings (See Celadon Cedar stack) makes it easy (well, easyish) for developers to install and run any language, or service.
Constraints with Heroku
The ephemeral filesystem
- End-users cannot upload media assets to Heroku. WORKAROUND: Enable
wpro
and use that plugin to upload media assets to S3 instead. - End-users cannot update themes or plugins from the admin page. WORKAROUND: Add them to
config/public/wp-content/themes
orconfig/public/wp-content/plugins
then push to Heroku.
Security disclosure
Each time Wordpress is deployed, Heroku will fetch the latest buildpack from GitHub and execute the instructions in compile
and deploy
. This buildpack will download the latest precompiled versions of Nginx, PHP, and Wordpress from my personal S3 bucket then add in config files from the config
directory.
Hacking and Contributing
Not comfortable downloading and running a copy of someone else's PHP or Nginx executables? Not a problem! The support
directory also contains a handful of compilation and deployment scripts to automate several processes, which are currently used for maintenance and repo management.
package_nginx
- Used to compile and upload the latest version of Nginx to S3.package_php
- Used to compile and upload the latest version of PHP to S3.wordup
- Really useful helper script for creating and destroying Wordpress sites.
TODO
- End-users shouldn't be able to do things that aren't supported on Heroku. Write plugins to hide everything.
- Integrate New Relic.
- CDN support.
- Combine CSS/JS files
Authors and Contributors
- Marc Chung - Follow @mchung on GitHub and also @heisenthought on Twitter
Thanks
Thanks for reading this all the way through.
If you use this buildpack in production, please update the list of Wordpress sites running on Heroku.
License
The MIT License - Copyright (c) 2013 Marc Chung
Hello Friends,
Today I am going to demonstrate how to deploy your application directly to heroku. Following commands are helpful:
1. Go to your project folder
$ cd myapp
2. Initialize git
$ git init
3. Add your project files and directory
$ git add .
4. Commit your added files and directory
$ git commit -m “First Commit”
5. Create heroku remote
$ heroku create
6. Verify remote in git configuration
$ git remote -v
Heroku Wordpress Login
7. Deploy your code
$ git push heroku master
8. Rename your app (optional)
$ heroku apps:rename newname
9. Open heroku app (optional)
$ heroku open
Thanks,
Mayank Jani
