Coolify on Hetzner
As a C# ASP.NET developer, I have been hosting all my projects on Azure for a long time. With a Basic App Service Plan for around $50 per month, you can host a lot of websites. They all share the same server resources. That's not a problem most of the time, because these sites are for personal projects and don't receive a lot of traffic.
Price
Azure App Services are great, easy to set up and manage through the Azure Portal. But what about the price? It looks like I've been paying the same price for this server forever now. Servers become cheaper, right? Shouldn't the Azure hosting become cheaper too? It doesn't look like it.
Reaching the Limits
One of my projects needed some more resources, and it had a bad impact on the performance of my other projects. I knew this would happen, as CPU and Memory are shared between the projects. I had to do something about it.
And in case you're wondering, yes I already removed the SQL Server costs by moving to SQLite (see my previous blog post about that).
I could scale the App Service, which would double the price to about $100 per month. That's too much for personal projects that don't bring in any money. So I started looking for alternatives.
Hetzner
I often heard good things about Hetzner hosting, so it was time to check it out. They offer a barebone server with hardware specs comparable to the B1 App Service Plan for less than $4 per month, compared to the $50 with Azure. This is a 10x price reduction.
Hetzner has a nice dashboard to create a server, scale the server, etc. But it does not offer much help with deploying your application. When you create a server, it just gives you the possibility to log in using SSH, and that's it. No deploy slots, GitHub Action integrations, etc. None of that. That's why Azure has premium pricing.
Coolify
Here comes Coolify to help solve this problem.
Coolify is an open-source project that offers an alternative to the Azure Portal. It lets you create and deploy projects, manage domains, etc. The things you would otherwise do in the Azure Portal are now available in Coolify. Coolify is easy to set up with Hetzner; when creating a server on Hetzner, you can select that you want to have the Coolify server installed, and it will automatically install it.
I followed this blog to set up my C# ASP.NET app with Coolify on Hetzner.
The support for ASP.NET websites with Coolify is not great, but I chose to use Docker (Compose) with Coolify, and that worked great. ASP.NET websites can run in a Docker container, and Coolify has good support for Docker containers.
So instead of paying $50 extra to scale my Azure server, I'm now paying just $4 extra to host my application on Hetzner.
Will You Migrate Your Other Websites?
No, I won't be migrating my other websites. Azure is still the best choice for hosting ASP.NET apps. It's super easy to create a new website, deploy some code from GitHub, add a domain with a free SSL certificate, etc. It's more work to do the same with Coolify on Hetzner. However, when I have another project that needs a bit more CPU power, I will set up a Hetzner server again and host the project there, unless Azure drastically lowers the cost.