DEV Community

Discussion on: Complete Guide To Hosting Wordpress On Heroku With SSL Certification

Collapse
 
aryaziai profile image
aryaziai • Edited

Hey Pacharapol, thank you for reaching out!

1) The Heroku free plan allows up to 1,000 free dyno hours (upon CC activation) which is more than enough. The main limitation is that the site goes to sleep after 30 minutes, which can easily be avoided if you ping your site before it goes to sleep. There are lot's of services that can help accomplish this. There are zero database costs, we are using the "Kitefin Shared" plan: elements.heroku.com/addons/jawsdb-....
2) Let's Encrypt is awesome. We're using Cloudflare for free SSL, plus many other benefits (i.e. minifying code, security.. )

There are zero costs involved with this guide. I'd say overall the biggest limitation is the 5MB max db size, which is more than enough for most basic Wordpress sites.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I've had a problem with Heroku when need a custom domain. SSL is immediately removed, unless paid dyno (hobby 7 USD/mo fixed). That's why I moved to Docker and Google Cloud Run, which automatically provision SSL. It's Pay As You Go and very cheap.

The only time I have to touch Let's Encrypt is on Digital Ocean. Luckily, there is Nginx-le Docker image with auto renew.

Thread Thread
 
aryaziai profile image
aryaziai

Thats so odd. Have you tried following Steps 5-7? I simply update the nameservers at GoDaddy to point to Cloudflare. I then click custom domain in my heroku app's setting (insert my url without www or https), and grab the dns target. Then I go over to Cloudflare and and add the two CNAME rows with the DNS target.

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Anyways Heroku freeTier dyno will shut down after an idle. So not sure if I will use it for something serious.

Thread Thread
 
aryaziai profile image
aryaziai

Just set up a cron job that pings your site every 30 minutes medium.com/better-programming/keep...

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Now, I made it with free everything.

  • Free Heroku
  • Free MongoDB Atlas
  • Free Cloudflare
  • Free subdomain (I already owned the domain name and used it elsewhere)

I think I currently don't need to keep it awake, or cron job; but I will consider it.

BTW, for your WordPress, it seems to be possible to build pages in advance, to static page; and host it on Netlify, where it is always awake anyway.

The search bar inside WordPress would probably be dead, without Heroku or some kind of serverless function, though.

Thread Thread
 
aryaziai profile image
aryaziai

Awesome! Glad to hear this. Will it work with a dynamic site as well? I've been using cron-job.org (for free) and haven't had any issues