Hetzner Cloud Deployment: Terraform, CI/CD, Docker Swarm

You bought a VPS on Hetzner, installed Ubuntu, and deployed your site via manual scp. A month later, you realize: code updates are a nightmare, Nginx isn't tuned for high load, and your SSL certificate expired on a Friday evening. Each release turns into hours of stress, clients complain about slow

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1033
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    554

You bought a VPS on Hetzner, installed Ubuntu, and deployed your site via manual scp. A month later, you realize: code updates are a nightmare, Nginx isn't tuned for high load, and your SSL certificate expired on a Friday evening. Each release turns into hours of stress, clients complain about slow loading. We set up deployment so everything runs automatically: press a button in GitHub — the site updates in a minute, monitoring alerts you on failure. Saving time and nerves is our priority. Contact us for a free consultation — we'll tell you how to accelerate your release cycle.

Problems We Solve

  • Manual deployment via FTP/SCP — slow, error-prone, no change history. We replace it with Git-based CI/CD with rollback capabilities.
  • Nginx without caching and gzip — high TTFB, Core Web Vitals failure. We optimize LCP and CLS.
  • SSL certificate expires — we set up Let's Encrypt with auto-renewal via systemd timer.
  • No monitoring — you don't know about server downtime until morning. We install Prometheus + Node Exporter + Alertmanager.
  • Scaling — a single server can't handle the load. We use Docker Swarm across multiple VPS with Load Balancer.

How We Do It

We use infrastructure as code: all configs are in Git. Terraform creates servers, firewall, DNS, Object Storage. Packer builds images. Ansible configures software. GitHub Actions handles deployment after every push.

Real case: a marketplace client with 50,000 products. Previously, deployment took 2 hours via manual rsync. We built a pipeline:

  1. GitHub Actions builds Docker images.
  2. Uploads them to a registry (GitHub Container Registry).
  3. Via SSH, runs docker stack deploy on a Swarm cluster of 3 nodes.

Release time dropped to 2 minutes. Rollback is even faster: git revert and a new push.

How the CI/CD Pipeline Works

Every push to the main branch triggers a build, tests (if any), and deployment to staging. After manual confirmation, deployment to production. All steps are defined in a YAML file in the repository, so changes are tracked and reproducible.

Terraform for Infrastructure

# main.tf (beginning) terraform { required_providers { hcloud = { source = "hetznercloud/hcloud" version = "~> 1.44" } } } provider "hcloud" { token = var.hcloud_token } resource "hcloud_server" "app" { name = "myapp-prod" image = "ubuntu-22.04" server_type = "cpx21" location = "nbg1" ssh_keys = [hcloud_ssh_key.default.id] user_data = file("cloud-init.yaml") labels = { env = "production" app = "myapp" } } resource "hcloud_firewall" "app" { name = "myapp-firewall" rule { direction = "in" protocol = "tcp" port = "22" source_ips = ["10.0.0.0/8"] } rule { direction = "in" protocol = "tcp" port = "80" source_ips = ["0.0.0.0/0", "::/0"] } rule { direction = "in" protocol = "tcp" port = "443" source_ips = ["0.0.0.0/0", "::/0"] } } resource "hcloud_load_balancer" "lb" { name = "myapp-lb" load_balancer_type = "lb11" location = "nbg1" } resource "hcloud_load_balancer_target" "server" { type = "server" load_balancer_id = hcloud_load_balancer.lb.id server_id = hcloud_server.app.id } 

GitHub Actions for CI/CD

name: Deploy to Hetzner on: push: branches: [ main ] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Deploy via SSH uses: appleboy/ssh-action@v1 with: host: ${{ secrets.HETZNER_IP }} username: deploy key: ${{ secrets.SSH_PRIVATE_KEY }} script: | set -e cd /var/www/myapp git fetch origin main git reset --hard origin/main composer install --no-dev --optimize-autoloader npm ci --omit=dev npm run build php artisan migrate --force php artisan optimize sudo systemctl reload php8.3-fpm nginx php artisan queue:restart 

Hetzner Object Storage for Static Files

aws configure set aws_access_key_id $HETZNER_S3_KEY aws configure set aws_secret_access_key $HETZNER_S3_SECRET aws configure set region eu-central aws --endpoint-url https://fsn1.your-objectstorage.com s3 mb s3://myapp-assets aws --endpoint-url https://fsn1.your-objectstorage.com s3 sync ./dist/assets s3://myapp-assets/assets --cache-control "public, max-age=31536000, immutable" 

What Is Docker Swarm and Why Do You Need It?

Docker Swarm is a native Docker clusterizer that combines multiple servers into a single compute space. It provides automatic container distribution, load balancing, and failure recovery. For projects that need horizontal scaling and fault tolerance without the complexity of Kubernetes, Swarm is the optimal choice. Swarm is up to 5x simpler to configure and 3x lighter than Kubernetes, making it ideal for small to medium workloads.

Docker Swarm Cluster

# Initialize on the first server ssh server1 "docker swarm init" # Get the token JOIN_TOKEN=$(ssh server1 "docker swarm join-token worker -q") # Add worker nodes ssh server2 "docker swarm join --token $JOIN_TOKEN server1:2377" ssh server3 "docker swarm join --token $JOIN_TOKEN server1:2377" # Deploy a stack docker -H ssh://deploy@server1 stack deploy -c docker-compose.prod.yml myapp 

Process of Work

  1. Analysis — study current infrastructure, load requirements, and budget.
  2. Design — choose server types, load balancing scheme, software stack.
  3. Implementation — write Terraform, Ansible, CI/CD, monitoring.
  4. Testing — verify deployment on a staging server, perform load testing.
  5. Deployment — move to production, configure alerts and backups.

Estimated Timelines

Task Timeline Estimated Cost
Single VPS + Nginx + SSL + deployment 1–2 days $500–$1,000
Terraform + Load Balancer + monitoring 3–4 days $1,500–$3,000
Docker Swarm cluster (3+ servers) 4–5 days $3,000–$6,000
Full infrastructure with reserve from 1 week $5,000+

Cost is calculated individually — contact us for an estimate.

How to quickly roll back a failed deployment? If CI/CD is set up correctly, rollback is done with a single command: git revert the latest commit and push. The pipeline automatically deploys the previous stable version. Rollback time is under 2 minutes.

Typical Problems and Solutions

Problem Solution
Configuration drifts after manual edits Everything in Terraform — changes only through code
Database is not backed up Daily backup to Object Storage via cron
SSL certificate expires Let's Encrypt with systemd timer
No monitoring Prometheus + Grafana + Alertmanager

What Is Included in the Work

  • Comprehensive documentation of the scheme and configurations.
  • Server and admin panel access.
  • Training for your team (1–2 hour call).
  • Support for 1 month after delivery.
  • Detailed configuration as code (Terraform, Ansible) in your git repository.

How to Set Up Deployment on Hetzner in 1 Day?

If your site is already running on a single server, we add:

  1. Automatic SSL (Certbot systemd timer).
  2. GitHub Actions with a fast deployment script.
  3. Uptime Kuma monitoring on a separate VPS.
  4. Daily database backup to Object Storage.

All of this is guaranteed to work. Over the years, we have completed more than 50 projects on Hetzner — from small landing pages to high-load marketplaces. Order a turnkey setup — we'll select the optimal configuration and draw a migration roadmap.

Why Choose Hetzner for Production?

  • GDPR-compliant data centers in Europe.
  • Price 3–5 times lower than AWS/GCP with similar performance.
  • High reliability: 99.9% uptime per SLA.
  • Simple API and CLI for automation.

Get a consultation — we'll tell you how to optimize your current deployment. Note: All prices are estimates; final cost depends on scope.