Back to articles
DevOps & Systems

Web System Migration Journey from AWS to Hetzner with Coolify: Secrets to Optimize 85% Costs for Enterprises

Migrating web systems from AWS to Hetzner using Coolify enables enterprises to reduce operational costs by up to 85% while maintaining high performance and reliability. This guide...

DPTCloud Engineering8 min read
Web System Migration Journey from AWS to Hetzner with Coolify: Secrets to Optimize 85% Costs for Enterprises

Image credit: geralt · Pixabay Content License

Migrating web systems from AWS to Hetzner using Coolify enables enterprises to reduce operational costs by up to 85% while maintaining high performance and reliability. This guide outlines the complete migration process, including preparation, deployment, cost optimization, and post-migration validation, based on real-world implementations in small and medium-sized businesses. By leveraging Hetzner's NVMe Cloud VPS and Coolify's automated deployment tools, organizations achieve superior resource efficiency and eliminate hidden infrastructure costs such as bandwidth, IOPS, and service fees. Understanding the pricing structure and service terms of Hetzner is essential to avoid unexpected expenses. For a deeper look at hidden VPS costs, refer to Hidden Costs When Running VPS: Bandwidth, IOPS, and What Providers Don't Tell You.

Introduction: Why Migrate from AWS to Hetzner

Enterprises often begin with AWS due to its flexibility and global reach, but as scale grows, operational costs can rise sharply from hidden fees like bandwidth, IOPS, and additional service charges. Hetzner offers high-performance NVMe VPS solutions at competitive prices with flexible scalability, ideal for stable and high-performance web systems. Tools like Coolify simplify application deployment, updates, and monitoring, significantly reducing the time and manpower required for DevOps tasks.

Migrating from AWS to Hetzner not only reduces costs but also increases infrastructure control. Hetzner operates data centers in Germany and Switzerland, enabling low-latency access for European markets. With hourly or monthly pricing models, businesses can adjust resources according to actual needs, avoiding waste compared to AWS's pay-per-use model.

Preparation Before Migration

Before starting the migration, identify all components currently on AWS: EC2 instances, RDS, S3, Route 53, and related services. Create full backups of all data and configurations, including databases, static files, and application settings. Use tools like aws s3 sync to copy data from S3 to Hetzner, or rsync to transfer files from EC2 to the Hetzner VPS.

Prepare the Hetzner VPS with a Linux OS (Ubuntu or Debian), install Docker, Nginx, and necessary tools. Configure the firewall and SSH for security. Create an account on Coolify and connect it to the Hetzner VPS via SSH. Coolify supports deploying applications from GitHub, GitLab, or other source repositories, enabling automated migration.

Migrating Applications and Optimizing Costs

Migrate applications sequentially: transfer the database from AWS RDS to Hetzner by creating a backup and restoring it on the new VPS. Use mysqldump or pg_dump to export data, then import it into the new server. Update environment variables in Coolify to point to the new database.

For web applications, create a Dockerfile and docker-compose.yml to deploy on the Hetzner VPS. Use Nginx as a reverse proxy to handle HTTPS, caching, and load distribution. Optimize Nginx configuration with Brotli 11 to reduce static file sizes and improve page load speed. Refer to the detailed guide on building a personal CDN with Brotli 11 by manually compiling Nginx on a Linux VPS at Detailed Guide to Building a Personal CDN Optimized with Brotli 11 by Manually Compiling Nginx on a Linux VPS.

To control costs, monitor bandwidth, IOPS, and CPU usage. Hetzner provides VPS with unlimited bandwidth, but IOPS may be limited depending on the package. Use tools like htop, iostat, and iftop to monitor performance. Optimize resources by disabling unnecessary services and using cronjobs for automatic backups and log cleanup.

Testing and Ensuring Stability

After migration, test the entire system: access the website, check database connectivity, and ensure all services run smoothly. Use tools like curl, ping, and netstat to verify network connections. Check logs in Coolify to detect and resolve errors.

Perform load testing using tools like ab (Apache Benchmark) or k6 to evaluate system performance under high load. Ensure the system can handle expected traffic without overload. Monitor monthly costs in the Hetzner dashboard and compare them to previous AWS expenses to confirm savings.

Common Issues and Solutions

Common migration issues include database connection failures, application startup failures, or 500 errors. Check application and database logs to identify the cause. Ensure environment variables are correctly configured, especially server names, ports, and database login credentials.

If DNS issues occur, update DNS records at the domain registrar (e.g., Cloudflare or Namecheap) to point to the new Hetzner VPS IP. Wait 5 to 10 minutes for DNS propagation. Verify with dig or nslookup to confirm the domain points to the correct IP.

Hidden VPS costs such as bandwidth, IOPS, and additional service fees can impact total expenses. Carefully review Hetzner's pricing and service terms to avoid surprises. For more information on hidden costs, see Hidden Costs When Running VPS: Bandwidth, IOPS, and What Providers Don't Tell You.

Conclusion

Migrating web systems from AWS to Hetzner with Coolify is an effective strategy to reduce operational costs by up to 85% while maintaining performance and reliability. By using NVMe VPS, automated management with Coolify, and configuration optimization, organizations achieve superior resource efficiency. This guide provides practical steps from preparation to testing, helping businesses migrate successfully with minimal risk.

Cost Comparison: AWS EC2 vs Hetzner VPS NVMe

Factor Amazon EC2 (hourly) Hetzner VPS NVMe (monthly)
Base Price $0.0205/hour (on-demand) $10/month (4 vCPU, 8GB RAM)
Bandwidth 100GB/month limit, high overage fees Unlimited
IOPS Package-limited (up to 10K IOPS) Package-dependent (up to 100K IOPS)
Hidden Costs Bandwidth, additional services, storage fees No hidden fees
Scalability Real-time resource changes Easy package upgrades

Cost Verification

To ensure actual costs are lower, use the following commands to check bandwidth and IOPS on the Hetzner VPS:

htop
iostat -x 1
iftop -i eth0

Test performance using the ab tool:

ab -n 1000 -c 100 http://your-domain.com/

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478