Cost to prototype and run mini projects

I like serverless to prototype new ideas because they’re essentially free at the scale I run them. Is there an option to host Elixir apps?

In the meantime, I pay $7 per app per month on render.com. Although it’s a small sum, it’s still another subscription to think of and totally unused electricity and work. I’ve thought about consolidating all my apps into a single repo and app.

You can easily host Elixir apps for free on Gigalixir & Heroku. There are even Phoenix guides around that:

There are likely many more PaaS (with native support, via build packs, docker, etc) and other deployment options, I happen to have some experience with these two and can definitely recommend.

2 Likes

I use a public sandbox from OVH at less than 4€ per month, I use docker and traefik to run multiple elixir prototypes, and deploy automatically with Gitlab-CI.

A small server or a VPS and is all you need for prototypes. I like docker but you can run your apps directly from the host I guess. Though in that case I would use something like https://www.opalstack.com/ , i.e. a managed shared server. It costs more, but here too you can run more than one app.

I don’t understand why the prices are so high on the heroku-like solutions that let you only run one single app.

1 Like

For toy applications I run them at home on my PC, then proxy them out to my 5 dollar VPS so they can be accessed from the outside. I can run 20 or more if I want to, all with legit SSL cert. My residential broadband give me an uptime of >95%.

2 Likes

Would you mind pointing me to some resources on how you proxy your home server to the VPS?

I used to go with ngrok but I would like to understand more about other approaches.

Thanks for the suggestions, everyone. I forget how cheap service can be outside of AWS and 3rd layer services built on them.

Great options

  1. Gigalixir
  2. VPS with non big-tech services.

I don’t have any good write up, but it is pretty simple once you know the following tools, all bog standard:

  • run your applications in a bunch of containers in your pc, listening on a local port only, like 4001
  • in each of your container run a ssh tunnel to your VPS host ssh -N -R 8080:localhost:4001 username@your.vps.host
  • run nginx with multiple virtual hosts (with free SSL certs from let’s encript) in your VPS, each reverse proxy to a local port such as 8080

So external access to your virtual host port 443 on your VPS got reverse proxyed to the local port (such as 8086) which is in turn tunneled to your home pc through your SSH tunnel then got served by the application in your containers. I get a round trip page latency of ~75ms through all these to an dynamically generated login page in phoenix, which is even faster than a static site hosted by vercel (~125ms).

Disclaimer: your bottle neck will be the uplink bandwidth of your home broadband link. And you will have random downtime due to the stability of your broadband. For the last 30 days I have random ~1 hour downtime happening every couple days. My overall uptime for the last 30 days is around 98%. I would not recommend doing this for anything remotely closed to production. However, if you want to go cheap, this is as cheap as you can get.

3 Likes

Thank you for the detailed reply, I’m not considering any of this for production so there’s no worries.