15 KiB
I Replaced Azure App Service with a $3/mo VPS (and kept push-to-deploy)
URL: https://youtu.be/AMVHnhJ1t_w
Duration: 11:11
Date saved: 2026-03-07
Tags: @work @scout #devops #selfhosting #docker #cicd
TL;DR
Milan migrează de pe Azure App Service (€15-20/lună) la un VPS Hetzner (€3/lună) folosind Docklo pentru push-to-deploy simplu. Soluția include Docker, GitHub Container Registry, și CI/CD automat prin GitHub Actions, păstrând experiența de deployment fără complexitatea Azure, dar la fracțiune din cost.
🎯 Puncte Cheie
Motivație:
- Azure e scump pentru aplicații simple care rulează 24/7
- Provocare: self-hosting + economie de costuri
Stack ales:
- Hetzner VPS - €3/lună (ARM64 2vCPU, 4GB) + €0.50 pentru IPv4
- Docklo - PaaS lightweight pentru deployment simplu (alternativă: Coolify)
- GitHub Container Registry - storage imagini Docker
- Traefik reverse proxy - routing + HTTPS automat (Let's Encrypt)
CI/CD Workflow:
dotnet publish --os linux --arch x64 /t:PublishContainer→ produce Docker image- Docker login + tag + push la GitHub Container Registry
- Webhook la Docklo → trigger deployment automat
- Timp total: câteva minute de la commit la production
Ce oferă Docklo:
- UI simplă pentru management servicii (apps, databases, compose files)
- Deploy cu un click - fără SSH manual
- Templates ready-made (Postgres, MongoDB, Redis, etc.)
- Monitoring basic (CPU, RAM, disk, network)
- Traefik integration pentru HTTPS automat
Trade-offs:
- ✅ Cost redus cu 80-90%
- ✅ Push-to-deploy păstrat
- ✅ Libertate totală pe VPS
- ❌ Fără auto-scaling
- ❌ Fără automatic backups (trebuie configurat manual)
- ❌ Nu pentru mission-critical apps cu milioane de useri
Hetzner pricing examples:
- €3/lună: 2vCPU, 4GB (cost-optimized ARM64)
- €6/lună: 2vCPU, 4GB (performance x64)
- €17/lună: 16vCPU, 32GB (cost-optimized)
- €40/lună: 16vCPU, 32GB (performance)
Monitoring:
- Uptime Robot pentru health checks
- Docklo built-in monitoring (CPU, RAM, disk, requests)
💎 Quote-uri Esențiale
"For my self-hosting needs, where I'm not running mission critical applications serving millions of users, there's no need to rake the bank and a €3 dollar a month VPS can work just fine."
"Docklo is a platform that simplifies how you can deploy your applications and databases and any other services to a VPS. All you need is to SSH into your VPS, download and install Docklo, and then you can jump into their user interface, and you don't really have to go down to the bare metal on your machine to do something useful."
"What if you could have the ease of deployment that you get with the big cloud providers but for a fraction of the cost?"
🔗 Resurse Menționate
- Hetzner - provider VPS ieftin și reliable
- Docklo - PaaS self-hosted pentru deployment simplu
- Coolify - alternativă populară la Docklo
- Traefik - reverse proxy cu HTTPS automat
- Let's Encrypt - certificate HTTPS gratuite
- Uptime Robot - monitoring uptime gratuit
📌 De Reținut pentru Marius
Potențial relevanț pentru roa2web:
- Deployment simplu la Hetzner în loc de Azure/DigitalOcean
- Cost redus semnificativ pentru environmente de test/staging
- Docklo ar putea simplifica deployment-ul pentru roa2web + Chatbot Maria
Next steps menționate în video:
- Video viitor: setup complet de la zero
- Comparație Docklo vs Coolify
Considerații:
- Bun pentru apps non-critical (dev, staging, side projects)
- Pentru production cu trafic mare → mai bine soluție managed
- Backups trebuie configurate manual
- Fără auto-scaling nativ
Transcripție Completă
What if you could have the ease of deployment that you get with the big cloud providers but for a fraction of the cost? Hi, my name is Milan and in this video I want to talk about my self-hosting setup. I'm going to walk you through my journey of setting up a Headster VPS, connecting it to Docky and implementing that awesome pushto deploy experience. So, let me walk you through how I landed where I'm currently on. For the longest time, I've been hosting my applications on Azure. And there are a few reasons for this. Azure is native to the .NET ecosystem. Being a Microsoft product, it's super easy to have your .NET apps up and running on Azure. But the downside is you end up paying quite a bit for all of this ease of use. So, I wanted to challenge myself to do two things, and that is move to a self-hosted setup and also save on the cost. So I had a couple of requirements that the ideal solution was supposed to give me and these requirements were that I wanted to use a VPS a virtual private server. I wanted to run my applications using Docker and I wanted to be able to integrate a CI/CD pipeline where I can develop my applications locally and push to something like GitHub, execute a GitHub actions workflow and have everything deployed on my VPS. So the solution I landed on was using a provider called Headner and it gives you awesome lowcost VPS's which are also pretty damn reliable I have to say. Docker is there just to be able to run my net apps on Linux without a lot of ceremony. I should be able to push my image to a container registry, download the image on my VPS and just hit docker run and have this up and running. Now, this omits a lot of the things that a cloud provider would give you such as HTTPS certificate provisioning, routing, load balancing, firewalls, and such, but I think you get the idea. Now, when it comes to a CI/CD pipeline, you do have a lot of options here. But just to illustrate the overall workflow, let's say we've got our .NET application. So, I'm going to denote it like this. And I want to be able to take this and turn it into a Docker image. Now you can either create a docker file and define how that builds your application into an image or you can use the net SDK which I covered in a previous video. And the overall setup is pretty simple. You just do net publish set your target as a container and the SDK is able to produce a container image that you can run on a VPS. The next step after we have our container image is pushing this to a container registry. So let me add this step here. And let's use a slightly different color for this. I'm using GitHub container registry, but you can use anything else you like. And lastly, I want to be able to combine these steps here into a CI/CD pipeline so that I can trigger a deployment to my VPS. And for this, I landed on a pass solution platform as a service called Doy, which is pretty popular. Now, there are a couple of other solutions that also give you this, but I don't see them talked about as much, at least in the net ecosystem. I'm guessing that Net devs as a majority are more focused on the cloud and I'm still not seeing a lot of talk about moving off of the cloud. Here's what the Hezner UI looks like and what makes them really awesome is how affordable they are compared to what you get for the price that you're paying. So if we look at their costs optimized machines, you can get a 16 vCPU and 32 GB machine for €17 a month. I think this is around $20 a month for my US folks. And if you're looking for more performanceoriented machines, then the pricing starts from €6 per month for a 2vCPU and 4 GB machine. And then it scales upward. And even at 16 vCPUs and 32 GB, it's around €40 per month, which isn't all that much if you really need a machine of this size. So, that's one of the core reasons why I wanted to move to a VPS because I was paying something like 15 to 20 bucks a month for an Azure app service because I needed to keep it running 24/7 to do some work and I wanted to challenge myself to move this to a VPS which I did successfully and I'm currently paying €3 per month for this setup. You also have to pay like 50 cents a month on top of this for an IPv4 address but this is really minor compared to the VPS cost. Then for the operating system, you are going to probably choose some sort of Linux distribution. I'm just running Ubuntu. And then you can configure a bunch of other stuff such as adding your SSH keys, firewalls, configuring your backups, and so on. And then when you're happy with everything, you can create your VPS, and it's going to be provisioned in a couple of minutes, and you're good to go and start deploying your applications on them. The next problem you're going to run into is how you're actually going to deploy your applications to your VPS. Now I could have went with the native route and just SSH into the server, pull the Docker image there, start up the container, expose the port to the internet and build a solution around that. You can also use a Docker compose file where you can run additional services like databases or reverse proxies. But I didn't want to do all that work manually. So I landed on a platform as a service that's similar to what you get with something like Verscell or Heroku and it's called Doc Ploy. In the simplest terms possible, Docy is a platform that simplifies how you can deploy your applications and databases and any other services to a VPS. All you need is to SSH into your VPS, download and install Docky, and then you can jump into their user interface, and you don't really have to go down to the bare metal on your machine to do something useful. Now, I'm going to make a separate video going over how to set all of this up from scratch. For right now, I just want to walk you through my setup. So, what I did was exactly this. Copy this command SSH into my VPS. Install Docloy. This gives you a URL where you can access your Docklo instance and from there you can start managing your applications. This is what my Docklo instance looks like. We're going to enter my user credentials to authenticate with the Docloy instance. And once I go inside, I can go ahead and start managing my services. So the core unit here is a project where you can define one or more services that you want to run. I'll show you what you can do here in just a moment. You also get a monitoring dashboard where you can see CPU usage, memory usage, disk space, network IO. You can also observe any requests. And as you can see, this service doesn't get all that many requests. But the numbers here aren't also too accurate as well. So they don't really reflect the actual usage. Going back to the project, let me just create a test project to show you what you can do here. So once you've got a project, you can say create service. And you can choose between application, database, or a compos file. They also have a bunch of templates for ready-made services that you can use. For application, you can give it a name, an app name, and a description. So let's say test app or whatever. You go inside, and from here you can decide how you want to deploy that. You can connect your repository where docloit takes care of everything. You also have access to GitLab, Bitbucket, Gaya. What I'm using is running my Docker images. And here you just specify your Docker image name, the registry URL, and if you're using a private registry, you want to also pass in a username and password. Then you hit deploy, and your application gets deployed. Now, there is a way to automate this. I'll show you what that looks like. Now, I want to go back here and let's say you want to add a database. You can choose between some ready-made options like Postgress, MongoDB, Maria DB, MySQL or Reddus. if you want to add a cache and creating a new service is as simple as giving it a name create and then dock ploy is going to go ahead and create this for you and get it deployed. So right now we don't have an instance but I can click deploy it's going to go ahead and pull the docker image from the docker hub container registry and in a couple of moments we've got a radius instance up and running. If I wanted to add a postgress database I can go ahead and do that. I just need to give it a name. I can configure any other image if I want if I don't want to use the default one. go into the service, deploy it, and in a couple of moments, I'll have my Postgress database up and running. I can then connect to it and start building my applications. So, this takes care of a lot of the heavy lifting that you need to do in order to set up your complete application and have it up and running on a VPS. Now, I'm obviously just scratching the surface here and quickly going over all of the available stuff, but my hope is that some of you find this interesting enough to start exploring it on your own, as I'm also doing, and I'm by no means an expert on Doc Lloyd. There are also some other solutions that I want to explore so that I can compare them and then see what the best one is for my use case. Now, how do works under the hood is by running traffic as a reverse proxy in front of all of your services. So, it handles the incoming traffic and routes it between the services that you're running. So, you don't really have to expose your services to the internet. All of it can go through the reverse proxy which also takes care of automatically provisioning HTTPS certificates using Let's Encrypt. All you need to do is buy a domain pointed to your services IP address and then traffic takes care of setting up the HTTPS certificate. For some simple monitoring, I'm using an uptime robot that I'm pointed to the health check endpoint of my API. And you can see that heads and VPSs are pretty reliable with my current API instance being available for more than 21 days, which is basically the moment I created it almost 3 weeks ago from today. And lastly, I want to give you a quick overview of my CI/CD pipeline, which takes care of automatically deploying this to my VPS using docklo. And what's going on here is setting up the net SDK, restoring and building my solution, running any tests, then I'm doing net publish where I set the publish target as a container. This will produce the container image locally, which I can then use to push to my container registry. And I'm doing this by running a docker login to my container registry. Then I'm tagging my images that I produced in the previous step and then doing a docker push. Once I've done this, I can go ahead and send a request to do ploy which is running on my VPS. And this is a web hook endpoint is going to trigger the deployment. So I can just build what I need locally, push the commit to my repository and have this deployed on my VPS in a matter of a few minutes. And this is the rough sketch of my final solution to have my .NET apps up and running on a VPS. Now, obviously, this isn't all too robust. There are some other things that you get with Azure, such as automatic backups, automatic scaling, but really it all depends on what you're looking for. For my self-hosting needs, where I'm not running mission critical applications serving millions of users, there's no need to rake the bank and a free dollar a month VPS can work just fine. As I said, in a future video, I'm going to cover this complete setup. But let me know if you'd also like to see some other solutions and how they compare to Doc Ploy with the most popular one probably being Koolifi. If you also want to get started with self-hosting your applications, I highly recommend taking a look at this video next where I show you how you can turn your .NET applications into a container image using just the .NET SDK. If you enjoyed this video, go ahead and click the like button right below. Thanks a lot for watching and until next time, stay awesome.