Skip to content

How I personally started

Pacharapol Withayasakpunt edited this page Jun 16, 2020 · 5 revisions

The idea was originally from https://dev.to/aryaziai/complete-guide-to-hosting-wordpress-on-heroku-with-ssl-certification-4f2l, using PhilippHeuer/wordpress-heroku.

composer (a PHP package manager) has to be globally installed.

https://getcomposer.org/doc/00-intro.md#globally

Make a new repo, where you would edit the theme.

cd <YOUR_REPO>
git init
git remote add upstream git@github.com:PhilippHeuer/wordpress-heroku.git
git fetch upstream
git pull upstream master

heroku create -a <YOUR_APP_NAME>
heroku addons:create jawsdb-maria
heroku config:get JAWSDB_MARIA_URL # and copy to CUSTOM_DB_URL

# Create .env
cp .env.example .env
# Then, edit .env

composer install
# Then, edit the posts with
php wp-cli.phar server --host=0.0.0.0 --port=80 --path=web

Deployment

source .env
heroku config:set \
    AUTH_KEY=$AUTH_KEY \
    SECURE_AUTH_KEY=$SECURE_AUTH_KEY \
    LOGGED_IN_KEY=$LOGGED_IN_KEY \
    NONCE_KEY=$NONCE_KEY \
    AUTH_SALT=$AUTH_SALT \
    SECURE_AUTH_SALT=$SECURE_AUTH_SALT \
    LOGGED_IN_SALT=$LOGGED_IN_SALT \
    NONCE_SALT=$NONCE_SALT

Deploy / Update

Now you can deploy your project to heroku (or when you update your application):

git push heroku master
Clone this wiki locally