• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

TechLila

Bleeding Edge, Always

  • Home
  • About
  • Contact
  • Deals and Offers
Techlila Logo
Share
Tweet
Share
Pin
Logomaster.ai
Up Next

How to Create a Logo Online Using Logomaster

Deploy WordPress on Heroku

TechLila Web Design and Development

How to Deploy WordPress on Heroku

Avatar of Virendra Rajput Virendra Rajput
Last updated on: January 7, 2016

In our previous tutorial, we showed you how to deploy a simple PHP web-page on Heroku which involved setting up Heroku toolbelt, configuring it, and deployment. In this tutorial we will be hosting a WordPress blog on Heroku. It will require the same procedure as involved in setting up PHP application, along with it we will be configuring our application to work with a database, which is also provided by Heroku known as Heroku Postgres (database as a service).

Note: This tutorial does not show how to migrate your existing blog to Heroku.

Deploy WordPress on Heroku

Heroku provides a free 5 MB database, which should be enough for getting started with WordPress. If you are looking for more space for your database please refer to the Heroku Pricing plans.

Here will be using a custom built of WordPress, it is available here. It comes built with PostgreSQL for WordPress and WordPress Read-only. Since Heroku does not provide MySQL, will be using PostgreSQL as our DB. (Also, Heroku does not provide write access on the file system, will be using a WordPress Read-only built).

Lets start by cloning the custom build of WordPress using Git. Please refer to using Git on Windows for more information on how to use Git. Clone the repository as `wordpress-heroku`, or download the repository from https://github.com/bkvirendra/wordpress-heroku/archive/master.zip

[html]
$ git clone [email protected]:bkvirendra/wordpress-heroku.git
[/html]

Change your current directory to `wordpress-heroku`-

[html]
$ cd wordpress-heroku
[/html]

Now create a Heroku app using:

[html]
$ heroku create
[/html]

Heroku Create

This will create a Heroku app using the cedar stack, and will return the name and URL of the app created. Here the name of the app created is `fierce-wildwood-8395` and the URL is

It will automatically add the Git remote, you can verify that using –

[html]
$ git remote -v
>> heroku [email protected]:shrieking-castle-2891.git (fetch)
>> heroku [email protected]:shrieking-castle-2891.git (push)
[/html]

Now you need to add the database add-on to your app, this can be done using:

[html]
$ heroku addons:add heroku-postgresql:dev
[/html]

Heroku DB Add

It will return the attached as color name, (in the above output the color name is `HEROKU_POSTGRESQL_RED_URL`)

Now promote the database attached to the app. (replace the HEROKU_POSTGRESQL_COLOR_NAME with the color name you get from the previous step)

[html]
$ heroku pg:promote HEROKU_POSTGRESQL_COLOR_NAME –app APP_NAME
[/html]

Heroku Promote

Now edit the `wp-config.php` file and update the unique keys and salts on lines 48-55. You can get the random values at here.

[html]
define(‘AUTH_KEY’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
define(‘NONCE_KEY’, ‘put your unique phrase here’);
define(‘AUTH_SALT’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_SALT’, ‘put your unique phrase here’);
define(‘LOGGED_IN_SALT’, ‘put your unique phrase here’);
define(‘NONCE_SALT’, ‘put your unique phrase here’);
[/html]

Commit the files.

[html]
$ git add .
$ git commit -m “first wordpress commit”
$ git push heroku master
[/html]

And you’re WordPress blog will be deployed. You can visit the sample blog created at http://shrieking-castle-2891.herokuapp.com/

Deployed

After deployment, WordPress will ask you to setup your site title, username and password. And that’s all.

Please note that, since Heroku does not provide the write access to the file-system, all the plugin installations and updates have to been made locally, and then pushed to Heroku. Please refer to this wiki for more information for setting up local environment, database syncing and media uploads.

If you’re facing any problems to deploy WordPress on Heroku let us know in form of comments below. Don’t forget to share this article with your friends on Facebook and Google+.

Share
Tweet
Share
Pin

Disclosure: Content published on TechLila is reader-supported. We may receive a commission for purchases made through our affiliate links at no extra cost to you. Read our Disclaimer page to know more about our funding, editorial policies, and ways to support us.

Sharing is Caring

Share
Tweet
Share
Pin
Avatar of Virendra Rajput

Virendra Rajput

Virendra Rajput is an avid programmer and hacker. He is a Co-Founder at Markitty. He is a hardcore Python programmer who is passionate about hacking with various APIs. In his spare time, he loves working on side-projects.

Category

  • Web Design and Development

Tags

Heroku

Reader Interactions

What people are saying

  1. Avatar of RobertRobert

    Virendra, thank you for yor explain how to deploy WordPress on Heroku. I was looking for this a few days! :-)
    Well done.

    Reply
  2. Avatar of NhickNhick

    Very informative, I just hope I can properly implement this on my next project..

    Thanks,
    Nhick

    Reply
  3. Avatar of EodyEody

    Thank you for nice blog.
    I have a problem. I deployed succesfuly a existing wordpress website to heroku, so I don’t want to run wordpres install again. But at the first time I accessed to mywebname.herokuapp.com, it lets me reinstall wordpress agian.
    How to fix this ?

    Reply

Add Your Comment Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular

How to Increase Broadband Speed on Windows

10 Best Android Launchers of 2021

Things to Do After Installing Windows 10 – Windows 10 Tips and Tricks

Top 10 Search Engines You Can Use to Search the Web Privately

55 Interesting Computer Facts That Will Blow Your Mind

What to Look for When Buying a Laptop – A Laptop Buying Guide

Fusion Drive Vs SSD – Things Nobody Tells you About Fusion vs SSD Storage

Useful Tools

• Grammarly – Free Grammar Checker
• SEMrush – The Best SEO Tool Trusted by Experts
• Setapp – One-stop subscription for Mac and iOS

Trending Topics

  • Android
  • Internet
  • iPhone
  • Linux
  • Macintosh
  • Security
  • Social Media
  • Technology
  • Windows

Worth Checking

10 Best Sound Equalizer for Windows 10 (2022 Edition!)

14 Best VLC Skins that are Highly Recommended and Free

Footer Logo Footer Text Logo

Footer

About

Hello and welcome to TechLila, the famous technology blog where you can find resourceful articles for mastering the basics and beyond.

At TechLila, our main goal is to provide unique information, such as quality tips and tricks, tutorials, how-to guides on Windows, Macintosh, Linux, Android, iPhone, Security and a few miscellaneous sub-topics such as reviews.

Links

  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms

Follow

Custom Theme Using Genesis Framework

Cloud hosting by Cloudways

Language

en English
bg Българскиzh-CN 简体中文nl Nederlandsen Englishtl Filipinofr Françaisde Deutschid Bahasa Indonesiait Italianoja 日本語pl Polskipt Portuguêsro Românăru Русскийsr Српски језикes Españolsv Svenskatr Türkçeuk Українськаvi Tiếng Việt

© Copyright  2012–2023 TechLila. All Rights Reserved.