How to Automate VPS Deployments with GitHub Actions and SSH Keys (Zero Downtime)
Hostinger vs. Contabo: Full Specifications Breakdown
Data verified from our lab benchmarks • Updated for 2026
| Feature / Metric | HostingerEditor's Choice UI | ContaboMax RAM Value |
|---|---|---|
| Starting Price | $2.99 / month (Web) | $4.99 / mo (VPS) | $5.50 / month (Cloud VPS S) |
| vCPU Cores | 1 to 8 vCPU (Dedicated resources) | 4 to 12 vCPU (High Core Count) |
| RAM Memory | 4 GB to 32 GB | 6 GB to 64 GB (Gigantic RAM) |
| Storage Technology | 50 GB – 400 GB NVMe SSD | 50 GB NVMe or 300 GB SSD |
| Traffic / Bandwidth | 4 TB to 32 TB | 32 TB Outgoing + Unlimited In |
| Control Panel & UI | hPanel (Ultra Modern & Easy) | cPanel, Plesk, Webmin, or CLI |
| Customer Support | 24/7 Live Chat & AI Support (Multi-lingual) | Email Ticket Support (German Business Hours) |
| Best For | Bloggers, WordPress Sites & Devs wanting easy UI | Heavy Database, Docker, Game Servers & SysAdmins |
| Money-Back Guarantee | 30-Day Money-Back Guarantee | 14-Day EU Statutory Cancellation |
| Official Links | Visit Hostinger | Visit Contabo |
The Shift from Manual Deployments to Automated CI/CD
Manually connecting to your cloud VPS via SSH, running git pull, rebuilding assets, and restarting PM2 or Docker is slow and error-prone. With GitHub Actions, you can automate your entire deployment workflow: every push to the main branch triggers automated linting, test suites, and remote production deployments with zero human intervention.
Step 1: Generating a Dedicated Deployment SSH Key
On your local computer, create a keypair specifically for GitHub Actions:
ssh-keygen -t ed25519 -C "github-actions-deploy" -f ~/.ssh/github_deploy_key
Copy the public key to your remote VPS user's ~/.ssh/authorized_keys:
ssh-copy-id -i ~/.ssh/github_deploy_key.pub deployer@YOUR_VPS_IP
Step 2: Storing Secrets in Your GitHub Repository
- Navigate to your GitHub repository -> Settings -> Secrets and variables -> Actions.
- Click New repository secret and add the following:
HOST: Your server public IP address.USERNAME: Your non-root sudo username (e.g.deployer).SSH_KEY: The private key contents of~/.ssh/github_deploy_key.PORT: Your SSH port (e.g.22or custom port).
Step 3: Creating the GitHub Actions Workflow File
In your local codebase, create .github/workflows/deploy.yml:
name: Production Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Deploy to VPS via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.PORT }}
script: |
cd /var/www/my-production-app
git pull origin main
npm ci --omit=dev
npm run build
pm2 reload ecosystem.config.js --update-env
Step 4: Committing and Testing the Automation
Commit your workflow file and push to GitHub:
git add .github/workflows/deploy.yml
git commit -m "ci: add automated production deployment workflow"
git push origin main
Navigate to the Actions tab on GitHub to watch your deployment run and verify your live website updates seamlessly.
Editorial Verdict: Pros & Cons
What We Love (Pros)
- Eliminates manual SSH logins and repetitive terminal commands
- Ensures automated test suites pass before deploying code to production
- Roll back bad deployments instantaneously via Git commit hashes
Drawbacks (Cons)
- Requires careful handling of private SSH keys in GitHub Repository Secrets
Written by Alex Vance
Cloud Infrastructure Architect
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
Hostinger vs Contabo VPS (2026): Real Benchmark Test & In-Depth Comparison
A comprehensive, benchmark-driven comparison between Hostinger and Contabo VPS. We tested Geekbench CPU scores, NVMe I/O, network latency, and hPanel vs CLI.
Hostinger Review (2026): Is It Truly the Best Web Hosting for the Price?
We stress-tested Hostinger's Premium and Cloud Startup plans across 180 days. Read our honest review covering uptime, LiteSpeed speed tests, and renewal fees.