DEV Community

Tech Tim (@TechTim42)
Tech Tim (@TechTim42)

Posted on • Updated on

Self Host Heroku Alternative

Heroku is removing their free tier, as a free PaaS, its free tier is very friendly for #webdev. As a dev, I feel a bit sad. 😥

panic

However, don't need to be panic, because there are alternative for Heroku.

Heroku New Price Plan

Self Host Solutions for replace Heroku

Caprover

CapRover is an extremely easy to use app/database deployment & web server manager for your NodeJS, Python, PHP, ASP.NET, Ruby, MySQL, MongoDB, Postgres, WordPress (and etc...) applications!

It is a docker compose based solution, so basically you can run any application in any language you prefer

I moved my apps from Heroku to Caprover and used it for about 2 years. It does not give me any problems. It was hosted on an AWS EC2 t3a.micro, it costs me about $60 per year.

Otherwise, Digital Ocean could be a good option to host Caprover too, this is a tutorial to create a Digital Ocean Droplet with on click.

Dokku

Dokku: A docker-powered PaaS that helps you build and manage the lifecycle of applications

Dokku is very similar to Caprover, actually the project started much earlier than Caprover. I didn't really used it for my application, the reason is Dokku does not offer a UI for the management, and that time I really would like to have some web Gui for management. Dokku has very good documentations.

There is another project inspired by Dokku => Piku/: The tiniest PaaS you've ever seen. Piku allows you to do git push deployments to your own servers.

K8s, Ok, let's move to K8s/k3s

complicated things

K8s is more and more popular nowadays, even it is complicated, as is an open-source system for automating deployment, scaling, and management of containerized applications. K8s is not designed to replace PaaS like Heroku.

This is another kind of self host solution, it is surely more complicated than a simple PaaS, but this solution will solve your problem once for all.

I moved my own applications from Caprover to k8s last year, actually I used Oracle ARM Ampere A1 instances + K3s to host a free k8s cluster.

Compare

Servive Heroku Caprover Dokku (Piku) Oracle Free Tier + k3s
Self Host No Yes Yes Yes
Recommended Min Ram Spec ~ 1G 1G 1G
Cost (For Spec Above) Free tier (no more after Nov) about $60 about $60 $0 (Under Oracle Always Free Tier)
UI Yes Yes No Yes/No (UI through k8s dashboard)
Easy to Set (1 to 5, higher is better) 5 4 4 2
Documentation (higher is better) 5 4 5 4.1
Maintenance Cost (lower is better) 0 1 1 2

Overall, compare Self Host Solution to Heroku

Self host may cost a small amount of money, but it can help make your application independent(free) from a specific platform, (no more panic to migrate application when a platform change their free tier policy).

free resources

It may cost you some time for set up, but the maintenance cost for it is not big, most of them the maintenance is a few single docker commands. So it is basically once for all of the set-up cost.

Other Free Tier/Budget cloud resources

Besides the self host solutions, there are other free PaaS/cloud services as well.

  • more at this list for free PaaS A list of SaaS, PaaS and IaaS offerings that have free tiers of interest to DevOps and infradev
  • Awesome Self Host A list of Free Software network services and web applications which can be hosted on your own servers
  • stack on a budget A collection of services with great free tiers for developers on a budget.

This article is based on personal experience on PaaS platform and K8s, the rating for them may be subjective.


Continue

AWS Elastic Beanstalk

Added 2022 Sept 12

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker.

It is a PaaS solution from AWS, technically it is not self-hosted, because AWS hosts it for you.

Beanstalk itself is free, but AWS charge users through the resources you used. For example, you run a container application the data stores in AWS RDS. So users will be charged for the RDS and EC2 used for running the container application.



twitter

Top comments (5)

Collapse
 
maxfindel profile image
Max F. Findel • Edited

Hey Tim, have you checked fly.io? I would very much compare it with Dokku, but the free tier is enough for a single Heroku app with it's database. I migrated some of my old projects over there and I like it a lot. I hope it helps!

Collapse
 
lukeecart profile image
Luke Cartwright

Great article!
I will certainly miss Heroku's ease of deployment. This news has kind of shaken the dev community.

Thank you for sharing those 3 github repos. They look like they have a lot of useful information!

Collapse
 
devarshishimpi profile image
Devarshi Shimpi

Nice!!
You Probably missed another self hosted alternative called Coolify.
Has a lot of tools and self hosted.
coolify.io/

Collapse
 
tomf247 profile image
Tom Foley • Edited

railway.app/ is an offering I've come across as a possible Heroku replacement. I think it requires a credit card on file, but only gets charged if you exceed the $5 monthly free allowance.

I can't vouch for it personally, but it would be on my checklist if/when I need an alternative.

Collapse
 
aaronmeza_29 profile image
Aaron Meza

Korifi would be a closer match in experience (github.com/cloudfoundry/korifi/). It's a bit more to set up as at runs atop Kubernetes, but you could potentially use kind, k3s, or minikube.