Ask HN: How do you deploy your side-projects?

50 points by gerimate ↗ HN
I've been looking for alternatives since the Heroku announcement.

81 comments

[ 4.5 ms ] story [ 147 ms ] thread
I've got a cheap VPS where I put them running in a Tmux session behind Nginx.
I've been using Render and Fly.io

Render is the closest thing to Heroku's ease of deployment currently. Major disadvantage is the larger build times.

If you're interested in sharing more: What determines if you choose render or fly for a given project?

What makes fly not as easy as render?

(I am contemplating moving off heroku, and these seem to be the major contenders for analogous ease of operations).

For existing Heroku projects, I chose Render. For newer projects, I mostly use Fly.io. It also depends on a few more factors like Postgres need of the project, in which case I choose Fly's managed services. Fly.io also makes it easier to deploy docker based projects. Render is more like plug-a-GitHub-repo-and-play.

Bear in mind that I'm only comparing these too in terms of their free tiers.

Thanks! why not fly for existing heroku projects?

I thought that fly didn't actually have a managed postgres, I guess I need to look more into it!

Scalingo, because EU company and hosting in EU. They are a great alternative to Heroku with awesome customer service. If I don't need a PaaS I use Hetzner (e.g. for my newsletter with Ghost). Clever Cloud is also a good EU hosting service.

I've used Render before and was happy, but I now prefer keeping all my stuff in the EU =)

Cloudflare Workers is a big time saver for my side projects. I don’t use JavaScript/TypeScript/WASM at work, but it’s been great.
How do you deal with persistant data? What DB service etc?
Workers has a few persistent options.

KV is the obvious one but Durable Objects themselves have interesting persistence properties. There is a sqlite DB service called D1 landing and there is an object service called R2 which is is actually really nice. Also there is a new queuing service which is also fully persistent, even if queues are a non-traditional persistence mechanism.

However Workers is a strange runtime and has strange billing/pricing. I wish there was better visibility into the "bundled" vs Unbound pricing models, namely I wish it could just tell you how much it would cost if you switched from bundled (this bitching could be specific to Enterprise plans though so YMMV).

Overall I'm pretty happy with it in a professional context. Cloudflare's network is second to none. The rest of their stuff... I could do without but Workers and the world's best edge makes up for it's other shortcomings.

Just been using azure. Their free tiers are pretty good
Render. But, they just jacked up prices - which makes it less appealing to me.

If I had to start over, I'd just do AWS App Runner. AWS is complex, but it's reliable - you won't have to pay huge minimums or subscriptions to host a side project. And, it will (hopefully) be dependable as a host long-term.

Digital Ocean's managed Kubernetes offering has been great for me.

There's lots of potential complexity to K8s, but if you're not managing the cluster and you have simple workloads the ratio of "stuff you have to learn" to "benefits you get" is pretty high. You can deploy anything that runs in a container, so it's really good for experimenting and not being tied down to one language or platform.

I can add a new service by copying and pasting a yaml file or two and it's up and running within a half hour or so.

If you are going down the k8s path and want to learn both a cool config language and make it easier to be able to deploy abitrary things in a more consistent way I suggest checking out Jsonnet and Tanka.

This combination allows me to make use of Helm charts, off-the-shelf YAML and custom Jsonnet in a cohesive way.

It's probably overkill for personal projects but I picked up the stack in a previous professional role and for me it's scaled down well enough.

I'm in the middle of migrating off Tanka's predecessor ksonnet to pure Helm at $work because the migration effort was deemed too challenging :cry: Did you use ksonnet before?
I didn't. Before Tanka we had built our own Jsonnet based system that shelled out to kubectl apply, we also had our own Jsonnet libraries.

When I started using Tanka I picked up the version of the ksonnet k8s lib that is managed by Grafana now.

What's your approach for ensuring that you've sufficiently secured your Kubernetes cluster?

I'd go down the same road as you, but I'm worried that I leave my cluster vulnerable as I don't know much about hardening Kubernetes. For example, I know I shouldn't run my apps under privileged user in Docker, but overall I'm not familiar with a managed Kubernetes attack vector.

First step if you're hosting it at home is separating your home connection from your business connection, physically. If you don't have that, do at least two VLANs.

Second step, don't expose anything unless you explicitly know what it's for. Start with everything 100% locked down, and only open things up you know want to be open. If you're just hosting a "home" cloud, nothing have to be exposed externally, so expose nothing. Otherwise go service/port by service/port to expose things.

The Kubernetes nodes and control plane are not something I manage directly. DigitalOcean perform regular upgrades to keep the cluster at a minimum supportable and secure version. They're reasonably sophisticated, and if they can't upgrade the cluster without downtime they'll notify you with what's wrong - which is great, because I don't know much in depth about K8s administration.

The configuration you use is pretty explicit about which ports are internal and which are published externally as a service, so it's unlikely you'll get it wrong by accident. Nevertheless, you can still verify that you haven't done anything daft like opened a DB port to the internet by e.g. trying to connect to it.

Finally, there's a whole class of difficult administration, hardening and access problems that can come with Kubernetes multi-tenanted operations that you just side-step as a sole administrator/user. You don't need to worry about who has access to which services or namespaces, or what privileges they have via RBAC - it's just you. I'd want to do some really serious research before letting other users launch containers on my cluster, or execute their own code in it; but that's not one of my use-cases, so it's not a problem.

Hetzner 5€ vps with nginx as reverse proxy
devs don't want to work with nginx
What do they want to work with then? nginx is solid, easy to configure, good docs and does -exactly- what it says on the tin.
I love it, just heard that lot of them are just want to code, nothing more :(
If "devs" don't want to play with my side project because of nginx, that sounds like a problem for "devs" not for me.
Really? First I've heard of this. All the devs I know love nginx and it has been my go to tool for almost a decade. Although I recently switched jobs and haven't worked with anything web or deployment related for over 6 months now, so my information might be out of date.
who cares? most devs don't want to work with anything else than their "beloved" $IDE and $LANGUAGE on $OS

imho. this was the reason, why the DevOps movement was founded in the first place - until it got "yet another" buzzword for plain/old system-administration ...

However, currentlly I'm migrating to Oracle free vps (4CPU, 24GB ram)
I would like to try Oracle but those offers aren't sustainable so I don't trust any of the pricing they currently have
I deploy to AWS with a serverless architecture and infa-as-code written in the same language as my app using CDK.

Serverless is great for side-projects because the scale based pricing effectively makes things free unless they really take off. And if it ever does go to decent scale, there's a good chance you don't need to re-architect or even tune anything to scale up with traffic. If you wanted to prioritize 100% predictable fixed costs over everything else, then maybe a VPS would be a better option.

If it can be a static site, then I build the site using GitHub Actions, and then use GitHub Page to serve. I absolutely love GitHub Actions and the speed of which it can build my site, and the syntax of the config is bliss.

I don't really like any of the static site generator's out there, so I just build an ejs site and parse it using a project I built called statictron [1]. I'm using it for a site [2] I'm building at the moment, and it's a pretty smooth and cleap deployment. I did end up pushing the files to bunny.net (a EU based CDN), as its surprisingly much faster than GitHub pages. But I'm just being picky, as Pages is practically more than fast enough.

For anything that requires server side hosting, render.com is great, or digitalocean if I want something I can control more. I don't really want to buy into the whole ecosystem of things like Heroku, GCP, AWS as I like to make sure I can leave when/if they do bad things.

I'm also increasingly moving stuff back to dedicated hosting. I do try and automate as much of the deployment stuff as possible, and use docker to wrap the services.

It's actually amazing how much cheaper a dedicated server is, vs cloud companies, once you're using more than a few services. I'd normally say one of the benefits is your DevOps teams should be cheaper, but in the end I've found the teams that would be managing the dedicated servers, end up being just as big to support the cloud infrastructure platforms.

[1]. https://github.com/markwylde/statictron

[2]. https://github.com/markwylde/webcodeup

Just started using Oracle Cloud Container Engine. Deploying all my side projects for free on ARM boxes, feels good man.

Previously I was self-hosted on a colo box I have using a PaaS I used to work on called Flynn - but it's about time to retire that machine, it's a 7 year-old Xeon and the power it draws has to be insane compared to the 3 ARM instances it's now running on.

The world has moved on from Flynn sadly and now it's my turn too.

My blog was temporarily hosted on cloud storage. It's a static site which I developed using Scully.
Been using fly.io - Started to move professional projects over too
I deploy to actual VPCs, the old way. No containers. No PaaS. Just get a Linux machine with a static IP and install. I use ansible to automate the deployment.

If I need some storage of undefined quantity, in the case of say image uploads, I might bring in S3 (or equivalent) service. But other than that, just a VPC.

Great to hear some people still follow the KISS method. I've done the same for years and this very simple setup can scale to tens of millions of (database intensive) requests per week.
Also a big fan of directly running my projects on VPCs. I do a lot of development on my Linux machine so I really enjoy not having any substantial differences between my local and deployed environments.
Check https://dokku.com. Easy to set on your VPS, support Heroku buildpacks and almost-zero-to-none management (assuming you update your server from time to time). And you get Heroku-style deployment.

Running some projects with it for the last 5-6 years and had couple of Dokku versions upgrades - zero issues so far.

Keep in mind that depending on use case it will build your project on the same machine your production app runs. There are also a few things to keep in mind.. it depends on docker so a docker update might stop your services, disk space might fill up and needs to be checked on. Plugins such as databases also need to be updated once in a while. If you're very unlucky you may cause a crash/outage by deploying an update. What I do instead sometimes is to build and push container images of my apps in a pipeline on commit and then deploy those to dokku using git-from.
Trying to fit them in a github pages, behind Cloudflare, with a json file as a database. All deployed with a bash script
Hatchbox https://hatchbox.io/

I deploy to single Linode instance with multiple projects.

Super easy interface to deploy a GitHub repo.

Auto provisions the server with nginx, MySQL, redis, etc.

My static website is exposed by Nginx in a managed Linux box at $whatever_cheap_vps. Deployment is done simply with rsync.
I can highly recommend fly.io. I have been using it for my Elixir projects [0][1][2]. The interface is easy to use, and you can come very far with the free layer. Another selling point for me was, that I can easily migrate away (in case I want to move to Hetzner later).

[0] https://slashdreamer.com/

[1] https://articletoimage.ai/

[2] https://ogtester.com/

I deploy to a virtual machine. I use Ansible to set up the machine and install a container runtime, then i set up traefik + containers using Ansible and docker compose files. If I ever do need to scale it's easy to switch to docker swarm which is quite capable. It's also easy to deploy the full stack somewhere else quickly. I wish it was easier to do firewall configuration when using docker, since it basically occupies iptables even though I'd rather use nftables. I also keep secrets out of source code and add them during deployment using envsubst and ansible vault. One thing also, i think the Ansible documentation is quite terrible. The only saving grace is `ansible-docs -s` which can print snippets. I don't particularly like ansible but i guess it's currently the best there is and has a big ecosystem.
Would you happen to have that ansible setup on github for others to learn from? Now that docker is actually fast enough to be usable on mac, I'm leaning in the direction of a fast VPS plus docker compose for simple app deploys like you (with the option to move to swarm if growth occurs). Would be great to learn how others are automating the VPS setup itself.
Sadly I do not have it publicly available as I built this for work and the code is on an internal platform. But there are tons of similar examples on github. If you want to do the same, I mainly used the geerlingguy/docker role, the docker module for ansible and an internal module for provisioning vms.
Have you thought about using a single node Docker Swarm? That gives you benefits such as healthchecks for containers so unhealthy containers are replaced, support for rolling upgrades and some other goodies like secrets and configs managed by swarm.
Yup, I do that as well, my ansible scripts can provision either a single node swarm or regular docker on a host, both using traefik. Mostly even swarm is overkill for us though.