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:
- GitHub Actions builds Docker images.
- Uploads them to a registry (GitHub Container Registry).
- Via SSH, runs
docker stack deployon 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
- Analysis — study current infrastructure, load requirements, and budget.
- Design — choose server types, load balancing scheme, software stack.
- Implementation — write Terraform, Ansible, CI/CD, monitoring.
- Testing — verify deployment on a staging server, perform load testing.
- 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:
- Automatic SSL (Certbot systemd timer).
- GitHub Actions with a fast deployment script.
- Uptime Kuma monitoring on a separate VPS.
- 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.







