Ask HN: Can any Hetzner user please explain your workflow on Hetzner?
I use Hetzner, Contabo, Time4VPS and other platforms in pretty much the same way (as IaaS VPS providers on top of which I run software, as opposed to SaaS&#x2F;PaaS), but here&#x27;s a quick glance at how I do things, with mostly cloud agnostic software.<p>&gt; deploy from source repo? Terraform?<p>Personally, I use Gitea for my repos and Drone CI for CI&#x2F;CD.<p>Gitea: <a href="https:&#x2F;&#x2F;gitea.io&#x2F;en-us&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gitea.io&#x2F;en-us&#x2F;</a><p>Drone CI: <a href="https:&#x2F;&#x2F;www.drone.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.drone.io&#x2F;</a><p>Some might prefer Woodpecker due to licensing: <a href="https:&#x2F;&#x2F;woodpecker-ci.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;woodpecker-ci.org&#x2F;</a> but honestly most solutions out there are okay, even Jenkins.<p>Then I have some sort of a container cluster on the servers, so I can easily deploy things: I still like Docker Swarm (projects like CapRover might be nice to look at as well), though many might enjoy the likes of K3s or K0s more (lightweight Kubernetes clusters).<p>Docker Swarm: <a href="https:&#x2F;&#x2F;docs.docker.com&#x2F;engine&#x2F;swarm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.docker.com&#x2F;engine&#x2F;swarm&#x2F;</a> (uses the Compose spec for manifests)<p>K3s: <a href="https:&#x2F;&#x2F;k3s.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;k3s.io&#x2F;</a><p>K0s: <a href="https:&#x2F;&#x2F;k0sproject.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;k0sproject.io&#x2F;</a> though MicroK8s and others are also okay.<p>I also like having something like Portainer to have a GUI to manage the clusters: <a href="https:&#x2F;&#x2F;www.portainer.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.portainer.io&#x2F;</a> for Kubernetes Rancher might offer more features, but will have a higher footprint<p>It even supports webhooks, so I can do a POST request at the end of a CI run and the cluster will automatically pull and launch the latest tagged version of my apps: <a href="https:&#x2F;&#x2F;docs.portainer.io&#x2F;user&#x2F;docker&#x2F;services&#x2F;webhooks" rel="nofollow">https:&#x2F;&#x2F;docs.portainer.io&#x2F;user&#x2F;docker&#x2F;services&#x2F;webhooks</a><p>&gt; keep software up to date? ex: Postgres, OS<p>I build my own base container images and rebuild them (with recent package versions) on a regular basis, which is automatically scheduled: <a href="https:&#x2F;&#x2F;blog.kronis.dev&#x2F;articles&#x2F;using-ubuntu-as-the-base-for-all-of-my-containers" rel="nofollow">https:&#x2F;&#x2F;blog.kronis.dev&#x2F;articles&#x2F;using-ubuntu-as-the-base-fo...</a><p>Drone CI makes this easy to have happen in the background, as long as I don&#x27;t update across major versions, or Maven decides to release a new version and remove their old version .tar.gz archives from the downloads site for some reason, breaking my builds and making me update the URL: <a href="https:&#x2F;&#x2F;docs.drone.io&#x2F;cron&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.drone.io&#x2F;cron&#x2F;</a><p>Some images like databases etc. I just proxy to my Nexus instance, version upgrades are relatively painless most of the time, at least as long as I&#x27;ve set up the persistent data directories correctly.<p>&gt; do load balancing? built-in load balancer?<p>This is a bit more tricky. I use Apache2 with mod_md to get Let&#x27;s Encrypt certificates and Docker Swarm networking for directing the incoming traffic across the services: <a href="https:&#x2F;&#x2F;blog.kronis.dev&#x2F;tutorials&#x2F;how-and-why-to-use-apache-httpd-in-2022" rel="nofollow">https:&#x2F;&#x2F;blog.kronis.dev&#x2F;tutorials&#x2F;how-and-why-to-use-apache-...</a><p>Some might prefer Caddy, which is another great web server with automatic HTTPS: <a href="https:&#x2F;&#x2F;caddyserver.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;caddyserver.com&#x2F;</a> but the Apache modules do pretty much everything I need and the performance has never actually been too bad for my needs. Up until now, applications themselves have always been the bottleneck, actually working on a blog post about comparing some web servers in real world circumstances.<p>However, making things a bit more failure resilient might involve just paying Hetzner (in this case) to give you a load balancer: <a href="https:&#x2F;&#x2F;www.hetzner.com&#x2F;cloud&#x2F;load-balancer" rel="nofollow">https:&#x2F;&#x2F;www.hetzner.com&#x2F;cloud&#x2F;load-balancer</a> which will make everything less painless once you need to scale.<p>Why? Because doing round robin DNS with the ACME certificate directory accessible and synchronized across multiple servers is a nuisance, although servers like Caddy attempt to get this working: <a href="https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;automatic-https#storage" rel="nofollow">https:&#x2F;&#x2F;caddyserver.com&#x2F;docs&#x2F;automatic-https#storage</a> You could also get DNS-01 challenges working, but that needs even more work and integration with setting up TXT records. Even if you have multiple servers for resiliency, not all clients would try all of the IP addresses if one of the servers is down, although browsers should: <a href="https:&#x2F;&#x2F;webmasters.stackexchange.com&#x2F;a&#x2F;12704" rel="nofollow">https:&#x2F;&#x2F;webmasters.stackexchange.com&#x2F;a&#x2F;12704</a><p>So if you care about HTTPS certificates and want to do it yourself with multiple servers having the same hostname, you&#x27;ll either need to get DNS-01 working, do some messing around with shared directories (which may or may not actually work), or will just need to get a regular commercial cert that you&#x27;d manually propagate to all of the web servers.<p>From there on out it should be a regular reverse proxy setup, in my case Docker Swarm takes care of the service discovery (hostnames that I can access).<p>&gt; handle scaling? Terraform?<p>None, I manually provision how many nodes I need, mostly because I&#x27;m too broke to hand over my wallet to automation.<p>They have an API that you or someone else could probably hook up: <a href="https:&#x2F;&#x2F;docs.hetzner.cloud&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.hetzner.cloud&#x2F;</a><p>&gt; automate backups? ex: databases, storage. Do you use provided backups and snapshots?<p>I use bind mounts for all of my containers for persistent storage, so the data is accessible on the host directly.<p>Then I use something like BackupPC to connect to those servers (SSH&#x2F;rsync) and pull data to my own backup node, which then compresses and deduplicates the data: <a href="https:&#x2F;&#x2F;backuppc.github.io&#x2F;backuppc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;backuppc.github.io&#x2F;backuppc&#x2F;</a><p>It was a pain to setup, but it works really well and has saved my hide dozens of times. Some might enjoy Bacula more: <a href="https:&#x2F;&#x2F;www.bacula.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.bacula.org&#x2F;</a><p>&gt; maintain security? built-in firewall and DDoS protection?<p>I personally use Apache2 with ModSecurity and the OWASP ruleset, to act as a lightweight WAF: <a href="https:&#x2F;&#x2F;owasp.org&#x2F;www-project-modsecurity-core-rule-set&#x2F;" rel="nofollow">https:&#x2F;&#x2F;owasp.org&#x2F;www-project-modsecurity-core-rule-set&#x2F;</a><p>You might want to just cave in and go with Cloudflare for the most part, though: <a href="https:&#x2F;&#x2F;www.cloudflare.com&#x2F;waf&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cloudflare.com&#x2F;waf&#x2F;</a>