On October 21, I received an email from AWS saying that I had spent more than $500. My cloud bill was growing more and more, and on that day I decided to do something about it.
Prior to that day, most of my apps were running on AWS. Among other things, I had there:
The AI Shipping Labs website
The new version of the DataTalks.Club website
Relay, our replacement for Mailchimp
With this setup, each app cost about $160/month, with approximately this breakdown per service:
Database (RDS): $57
Load balancer: $23
ECS and EC2: $15
NAT gateway and other EC2 costs: $10
Public IPv4 addresses: $7
WAF, secrets and keys: $9
AWS support plan: $11
Tax: $26
I moved all of them to 2 VPS machines, costing €35/month each (including VAT), or €70 in total.
I was also travelling - the day before we landed in Zhangjiajie in China, and most of the time I was enjoying the views in the national park. I was doing it entirely from my phone using AI.
In this post, I want to share how I did it:
Cost analysis
Looking for cheap hosting
Using a container management system
Moving one app at a time
Observability
All incidents that happened
Yes, I used AI for this migration and AI had access to my production environment.
I know better than anyone what can go wrong when you do it: in February 2026, I accidentally deleted a production database during a Terraform migration with Claude.
But a lot of things happened since then. By October I had a lot of trust in my production system. I wouldn’t call it 100% bulletproof, but I had backups in all possible places and I was certain that I can recover the data if things go bad.
In the end it went pretty smooth and was over in 2 days.
Cost analysis
I have two AWS accounts:
main - for production, it accounted for $450 out of $500
sandbox - for experiments and internal tools, accounted for the remaining $50
I was surprised that sandbox cost that much because I only run serverless stuff there. So first I wanted to figure out what was happening in that account. Out of $50, $10 went to KMS and $5 to Secrets Manager. Some of these keys were left there after broken deploys and were just sitting there. I cleaned them and moved the rest to my own secret manager.
Next I looked into the production account. With $455.50 for October 1 to 21, the main drivers of the cost were:
RDS: $160
Elastic Load Balancing: $64
ECS Fargate containers: $37
AWS Business Support+: $32
EC2-Other: $27
Public IPv4 addresses: $20
WAF (web application firewall): $11
Secrets Manager: $11
EC2 instances: $7
KMS: $3
+ Tax: $73
It was only 2/3 of the month and AWS was projecting $650-$700 by the end of October.
I started checking where each of these lines was coming from:
Public IPv4 was $20. Each public IP costs $3.60/month and I had 8 of them: for load balancers, a NAT gateway and a bastion host to connect to my VPC.
Business Support+ comes from the night I dropped our production database. I upgraded to get faster help from AWS and for now I still keep it.
I didn’t pay a lot for ECS containers ($53/month for all apps), but with load balancers, public IP addresses, firewall and secrets on top, it becomes about $200 per month.
Of course we also need to keep data somewhere, which adds $230/month.
After the February incident, I made sure I had backups in all possible places. One of these places was S3. Every day I’d create an RDS snapshot and then export it to S3, which cost around $1 per day or $30/month.
The first steps
The first thing I noticed was that a lot of things were adding up. I wanted to remove them.
So I gave my agents a task:
Move all secrets into one shared Secrets Manager setup on the main account
Find a cheaper managed database provider instead of AWS RDS
Replace all the load balancers with a single nginx server
Find out how to cut the snapshot export price
The load balancers were quite annoying. I needed them for zero-downtime deployment: when I roll out a new version, ECS would spin up a new container, wait till it becomes healthy, and only then route traffic to it. After that it can safely kill the container with the previous version.
But apart from that, there was no load to balance, and each LB cost about $30 per month. I had 3, so it was about $90 per month. Additionally, each LB needs a public IP address, one per availability zone, which adds about $7 per month for each.
So I decided to replace them with a single nginx server, and AI confirmed that it was a solid idea.
Dedicated servers
At the same time, I remembered reading that 37signals, the company behind Basecamp and HEY, moved from the cloud to its own servers and expected to save more than $2 million per year.
I also rent a dedicated server on Hetzner. It has an AMD Ryzen 5 3600 with 6 cores and 12 threads, 64 GB of RAM and two 512 GB disks. It’s quite a powerful machine - much better than the containers I used for hosting the apps.
So I asked AI if all these services would fit a machine like that. It said yes, with room to spare. And I pay only €30/month for it.
It was eventually a no-brainer decision to move the apps to a dedicated server.
But my main concern was the databases. I know that running and managing a database is not the easiest task and I have always preferred to rely on a managed service for that. But then I continued thinking about it and concluded that if I do regular backups myself and periodically check that these backups work, it doesn’t really matter if I host the database myself or pay somebody to manage it.
So I decided to explore the bare metal option.
The problem was that I rented my server in January 2026. If you check Hetzner now, you won’t find prices like €30/month anymore: the same server costs around €70/month. I wanted to find a cheaper alternative.
So I asked the agents to look for hosting alternatives. I created a Revolut card with a limit of €100/month and gave them a task - find two machines with 64 GB RAM each with the total budget of €70-80. If it was 4 machines with 32 GB each, it would also work for me.
I went to bed and asked the agents to be ready by the next morning, China time.
In the end, they picked two Cloud VPS 16 instances from Contabo, each with 16 cores and 64 GB of RAM. The promo price was about €29.60 each, and the total came to €70.44 per month including VAT.
Technically, these are virtual servers, not dedicated ones. But it didn’t really matter, as long as I pay fixed price for them.
Coolify
ECS is quite convenient: I build a Docker image, hand it to ECS and it takes care of deploying and serving them. I needed a way to do something similar on the new servers. I didn’t want to use Kubernetes because it felt like an overkill for what I wanted, so I started searching for an alternative.
AI suggested a few options and I decided to go with Coolify. Coolify is an open-source, self-hosted platform for deploying apps. It runs Docker containers and puts a Traefik reverse proxy in front of them, which handles routing and TLS certificates - this is what ELBs were doing for me in AWS.
I asked the agents to install Coolify and connect two servers in a private network, so I didn’t have to expose the database externally. While I was having breakfast in the morning, the agents finished the initial setup, and ran the latest versions of the apps and an empty database for each. ECR was replaced with GitHub Container Registry.
The apps were running but had no data.
The migration
Now I needed to migrate the data. I decided to move the apps in this order:
First move Relay, which I wasn’t using often back then
Then move AI Shipping Labs, which has less traffic
And then finally move the course management platform
For each app, the plan was to:
Get the data out of RDS
Load it into the new database
Make sure the app is healthy
Update the CloudFront origin to point to the new server
Stop the ECS services
Keep the RDS instances for some time as a backup
Create the final RDS snapshot
Delete the RDS and the rest of the infra when everything is stable
Relay didn’t have a lot of data to migrate, so it was a good way to test that it worked. The rest went well too, so later that day we switched all DNS and CloudFront for the apps to Coolify’s Traefik on Contabo. All three came up healthy.
When everything was healthy, we removed:
All the Application Load Balancers
The public IPv4 addresses
The NAT gateway and the course-management bastion
Observability
For the course management platform I used CloudWatch for monitoring, but since the services were off AWS, I wanted to replace it with a small monitoring stack.
First the agents recommended the usual Grafana + Prometheus + Loki + Tempo + Alertmanager setup, with Alloy to ship the logs. That seemed like an overkill - each of these tools would be a separate container, and I didn’t see the point in that.
So I asked AI to implement a simple one-container approach, and it used VictoriaMetrics, VictoriaLogs, and configured Vector to ship logs and metrics into them. I use vmui, the built-in VictoriaMetrics web UI, for day-to-day checks. I put all the setup into alexeygrigorev/coolify-observability.
Once the stack was installed and alerts configured, I started getting them to my email. But my agent was also getting a copy, waking up and fixing the problem. This feedback loop was especially useful on the first days when the apps weren’t working properly. It would immediately react to the problems and stabilize the setup.
Backups
I learned the hard way that having data backups is important.
So for the new setup, I have a regular backup job that takes the entire database dump and saves it to S3. Between the dumps, all the inserts are tracked too. If I wanted to recover a database at a particular point in time, I’d take the backup, and then replay all the changes that happened since the snapshot.
If a backup job doesn’t get triggered or the number of rows in the export is too little, the monitoring system detects it and fires an alert.
I also learned that thinking that you have a backup is not enough, you also need to make sure that these backups can be used. So there’s another job that I run weekly: we check how long it takes to restore a Postgres dump. On real data, it takes about 26 seconds.
If this job doesn’t get triggered, the monitoring system detects that too and fires an alert.
Problems
The migration didn’t go seamlessly and there were some problems. But because there was a feedback loop (alert -> dev agent), most of these problems were solved before I even noticed them.
I asked the agent to list them, so here they are:
Healthcheck false alarms on the Coolify primary
Relay workers kept an old Postgres address
Alert mail went only to the shared inbox
SES webhooks stuck after the worker outage
Deploy from GitHub Actions couldn’t reach Coolify
Coolify deploys return 502/503 errors
Dead CloudWatch alarms after we deleted RDS
Backups: keep little on disk, ship the rest off-host
Website database empty on Contabo
AI Shipping Labs had no background worker
Postgres metrics pointed at the wrong target
The watchdog only proved a fresh TCP connect
Agent scheduling delayed fixes
I have no idea what most of them even mean, so it’s good that they were addressed.
But there were two noticeable problems where I had to intervene:
The websites were serving dummy data for some time. Luckily I noticed that, and asked to fix it. But the users noticed it too and I had a few emails asking about missing data.
The deployment wasn’t zero-downtime. At the beginning after each deploy I’d get 503 alerts. The dev agent would dismiss them, saying it was due to a deployment. I asked for a proper zero-downtime setup like we had with ELB and ECS, and then it stopped happening.
The costs before and after
October 2 to 21, everything on AWS: $17.25 per day on average, between $16.14 and $21.02
October 22, the Migration Day: $8.18
October 23: $3.52
October 24 to 31: between $2.36 and $3.74 per day
November 2 to 26: between $2.58 and $5.40 per day, $3.78 on average

Of course we need to add €70 per month on top of that for Contabo.
Also, now I regularly send the newsletter via SES, which adds $13 on Mondays. You can read more about it in I Replaced 6 SaaS Subscriptions with Vibe-Coded Tools.
On a regular November day, the main AWS account costs about $3.78. Together with Contabo, that’s about $6.38 per day, compared with $17.25 per day before the move.
My AWS bill
I’m writing this article on November 26, and Cost Explorer for November shows $216.16. (I usually write articles in advance and then schedule them.)
This is the current breakdown:
SES: $56.77
RDS backups: $33.03
AWS Business Support+: $29.00
WAF: $24.46
Route 53: $22.33
S3: $3.76
KMS: $3.48
CloudFront: $2.84
SQS: $2.31
CloudWatch, Cost Explorer, Secrets Manager, ECR and the rest: about $3.25 together
+ Tax: $34.93
Business Support+ costs $29/month. I’m still thinking if I should keep it or not, but because AWS SES is critical for DataTalks.Club (we have our newsletter there!), I believe I should keep it in case I run into some problems with SES.
Also, I have to pay for RDS backups. I was very obsessed with creating backups - you’d be too if you dropped a production database. So obsessed that I created literally undeletable RDS backups. Some of these backups have a 90-day retention policy, and that costs around $1.27 per day. The latest ones are from October 22, so I’ll have to pay for them until January 20 when they expire.
While I moved a lot of things from AWS, I’ll keep using it for:
SES for sending email
An S3 bucket for Coolify database backups
Route 53 DNS and the CloudFront distribution in front of Relay
Results
Now on a regular day, my bills went down from $17.25 to about $3.78 on AWS plus $2.60 for Contabo. That’s $6.38/day in total, a 63% reduction.
I also did most of this work from my phone by talking to my dev assistant. The assistant can connect to my Hetzner and create an agent session there, and then watch it complete. It can also receive emails, wake up to alerts, and quickly iterate. Setting the alerts from the very beginning and making the agent handle them was the most important part of making this migration possible.
And I had a lot of certainty in my backups. I was very certain I can recover my data if things go wrong. I was not afraid to let agents handle this, even though I didn’t even have access to my computer, and the phone internet connection wasn’t great too. In the worst case, I’d re-route the traffic back to AWS and finish the migration when I’m back home. But I didn’t need any of that and the migration went smoothly. Most of you didn’t even notice any changes.
I will describe my dev assistant setup in some future posts, so don’t forget to subscribe.











