iToverDose/Software· 8 MAY 2026 · 08:01

Why VPS hosting beats cloud for small WordPress sites

Moving a WordPress blog from AWS EC2 to a €5 VPS cut costs by 70% without sacrificing control or automation. Here’s how a simple stack of Docker, Nginx, and GitHub Actions delivered a low-maintenance setup.

DEV Community4 min read0 Comments

Many projects don’t need the sprawling infrastructure of AWS or Azure, yet teams still default to them out of habit. Fully managed services promise scalability and uptime, but for a simple WordPress blog, the complexity and cost often outweigh the benefits.

Instead of juggling separate tools for logging, databases, and backups, a modest virtual private server (VPS) can handle the entire stack in one place. For a European developer who wanted to keep costs low while retaining full control, switching from a $15 EC2 instance to a €5 Hetzner cloud server unlocked surprising efficiency without sacrificing automation or performance.

When managed cloud services overshoot your needs

Major cloud platforms excel at high-scale, mission-critical workloads, but their breadth comes at a price. A typical AWS setup for a WordPress blog might include:

  • An EC2 instance ($15/month for a t3.small)
  • A general-purpose gp3 volume ($3.80/month)
  • Separate managed database, backup, and logging services

Even at the lower end, monthly bills can quickly climb past $20, and the overhead of configuring each service distracts from content creation and growth.

A VPS, by contrast, bundles compute, storage, and network into a single flat fee. With a provider like Hetzner, a €5-per-month plan delivers 2 vCPUs, 4 GB RAM, and 40 GB SSD storage—enough for a WordPress blog running Docker Compose, Nginx, and MariaDB without overprovisioning.

Building a minimalist WordPress stack with Docker and Nginx

The goal was straightforward: deploy a WordPress blog that required little ongoing maintenance and could be updated automatically. The chosen stack centered on three core components:

  • Docker Compose to containerize WordPress and MariaDB
  • Nginx as the reverse proxy and static file server
  • GitHub Actions for continuous integration and deployment

All routine tasks—SSL certificates, backups, firewall rules—were handled by lightweight Bash scripts, keeping the infrastructure transparent and auditable.

Setting up a Hetzner VPS in minutes

Provisioning a server on Hetzner takes under five minutes through its web console. The critical steps include:

  • Selecting Ubuntu 22.04 LTS as the base image
  • Attaching an existing SSH key for secure shell access
  • Choosing a €5 plan with 40 GB SSD storage in the Nuremberg data center

During setup, the Hetzner Cloud Config feature allows you to inject a startup script that installs essential software in one pass. The following snippet demonstrates how to automate the installation of Docker, Nginx, UFW firewall, and Certbot for SSL certificates:

#cloud-config
package_update: true
package_upgrade: true
packages:
  - git
  - curl
  - ufw
  - fail2ban
  - unattended-upgrades
  - nginx
  - certbot
  - python3-certbot-nginx

write_files:
  - path: /etc/fail2ban/jail.local
    content: |
      [DEFAULT]
      bantime = 1h
      findtime = 10m
      maxretry = 5
      
      [sshd]
      enabled = true
      port = ssh
      logpath = %(sshd_log)s
      backend = %(sshd_backend)s

  - path: /home/ubuntu/.ssh/config
    permissions: '0600'
    owner: ubuntu:ubuntu
    content: |
      Host github.com
        HostName github.com
        User git
        IdentityFile /home/ubuntu/.ssh/github_deploy
        StrictHostKeyChecking yes

runcmd:
  # Docker installation
  - apt-get install -y ca-certificates curl gnupg
  - install -m 0755 -d /etc/apt/keyrings
  - curl -fsSL  | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  - chmod a+r /etc/apt/keyrings/docker.gpg
  - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg]  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
  - apt-get update
  - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  - systemctl enable docker
  - systemctl start docker

The script also generates an SSH key for the ubuntu user, adds GitHub to the known hosts list, and prepares directories for WordPress and Certbot certificates.

Automating deployments with GitHub Actions

Once the server is online, the next step is to automate deployments. A GitHub Actions workflow can build Docker images, push them to the server via SSH, and restart services—all triggered by a git push to the main branch.

A minimal workflow looks like this:

name: Deploy WordPress

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Install SSH key
        uses: shimataro/ssh-key-action@v2
        with:
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          known_hosts: ${{ secrets.KNOWN_HOSTS }}
      
      - name: Deploy to server
        run: |
          ssh -o StrictHostKeyChecking=no ubuntu@your-server-ip << 'EOF'
            cd ~/app
            git pull origin main
            docker compose -f docker-compose.prod.yml down
            docker compose -f docker-compose.prod.yml up -d --build
          EOF

The workflow uses secrets for the SSH private key and known hosts, ensuring security without hardcoding credentials.

Moving from staging to production

A common mistake is skipping a staging environment. Before updating the live site, deploy to a subdomain (e.g., staging.yourdomain.com) to test WordPress updates, plugin compatibility, and Nginx configurations. Once everything passes, copy the same stack to the production domain by swapping configuration files and restarting services.

What’s next for low-cost WordPress hosting

This setup proves that a VPS, paired with Docker and automation, can deliver enterprise-grade reliability at startup-friendly costs. As WordPress evolves, the same stack can scale vertically by upgrading the VPS plan or horizontally by adding a second containerized instance behind Nginx.

For teams tired of paying for unused cloud features, the lesson is clear: sometimes, going back to basics unlocks both savings and simplicity.

AI summary

Web sitenizi barındırmak için VPS hizmetini seçin. Hetzner gibi sağlayıcılar, düşük maliyetli ve yüksek performanslı sunucular sunar. Docker ve Nginx ile basit ve güvenli bir web sitesi barındırma işlemi gerçekleştirebilirsiniz.

Comments

00
LEAVE A COMMENT
ID #O0AXNJ

0 / 1200 CHARACTERS

Human check

2 + 4 = ?

Will appear after editor review

Moderation · Spam protection active

No approved comments yet. Be first.