Self Host Heroku Alternative
Tags: heroku, webdev, aws, cloud
Published: 2022-08-27 07:06:32

[Heroku is removing their free tier](https://dev.to/lukeecart/more-heroku-changes-that-will-definitely-affect-you-10o8), as a free PaaS, its free tier is very friendly for [#webdev](https://dev.to/t/webdev). As a dev, I feel a bit sad. 😥


![panic](https://media.giphy.com/media/5qoRdabXeT4GY/giphy.gif)

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

> [Heroku New Price Plan](https://blog.heroku.com/new-low-cost-plans)

## Self Host Solutions for replace Heroku

### [Caprover](https://caprover.com/)
> 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](https://aws.amazon.com/ec2/instance-types/t3/), 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](https://caprover.com/docs/get-started.html).


### [Dokku](https://github.com/dokku/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](https://github.com/piku/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](https://rancher.com/docs/k3s/latest/en/installation/installation-requirements/)

![complicated things](https://media.giphy.com/media/RNWkmkrpvW6t7em1mD/giphy.gif)

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](https://www.oracle.com/cloud/free/) 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](https://rancher.com/docs/k3s/latest/en/installation/installation-requirements/) |
| Cost (For Spec Above)   |Free tier (no more after Nov) | about $60 | about $60| $0 (Under Oracle [Always Free Tier](https://www.oracle.com/cloud/free/)) |
| 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](https://media.giphy.com/media/2D8g2rXcWx1DO/giphy.gif)

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](https://dokku.com/docs/getting-started/upgrading/). 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](https://github.com/ripienaar/free-for-dev#paas) A list of SaaS, PaaS and IaaS offerings that have free tiers of interest to DevOps and infradev
- [Awesome Self Host](https://github.com/awesome-selfhosted/awesome-selfhosted) A list of Free Software network services and web applications which can be hosted on your own servers
- [stack on a budget](https://github.com/255kb/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_


{% embed https://youtu.be/uiM1xzOX8Qg %}

> 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.


---

{% embed https://dev.to/timhub %}
[![twitter](https://res.cloudinary.com/practicaldev/image/fetch/s--opAxX3tY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://img.shields.io/badge/Twitter-1DA1F2%3Fstyle%3Dfor-the-badge%26logo%3Dtwitter%26logoColor%3Dwhite)](https://twitter.com/TechTim42)