WordPress on Heroku and S3
- By Jessica Lord
- heroku, web dev, wordpress
The other week I moved two WordPress sites to Heroku and their media uploads to S3. How happy it’s made me!
For the first I used this tutorial, which sets up WordPress with Postgres using this Github repo - but then I moved the other site (this one!) with this tutorial and used the new-ish on Heroku ClearDB for mySQL. I used the tantan-s3 Wordpress plugin to connect to a bucket on my S3 account. And BAM.
A couple of notes:
- If you’re using the second tutorial, on step 8, I changed the database creds in my wp-config.php file (not wp-admin.php).
- Also, remember, you won’t be able to update WordPress or add themes or plugins when hosting on Heroku. But it’s not hard, you’ll just add the files/folders to your set of WordPress files and re-push them to Heroku.
Multiple SSH Keys
Unfortunately, it turned out to be a hot mess for me because the first site is a project for work, so it’s on an Heroku account with my work email, the second is this site, my site, so it’s on my personal Heroku account. Actively working on both and needing different SSH keys is a pain. If you run into this, here’s what I’m doing (suggestions welcome!). First, add a new key. Then, when you’re trying to push and it tells you:
! Your key with fingerprint blahblahblah is not authorized to access blahblah
Remove that key and add the one your stored earlier.
ssh-add -d ssh-add ~/.ssh/heroku_rsa
Pointing your domain to the site is easy, too. Heroku has the steps here.