Free Hosting Security: Protecting Your Site on a Zero Budget
Free hosting saves money but shifts security responsibility to you. Without the managed security features of paid hosting (WAF, DDoS protection, malware scanning, automated backups), you need a proactive defense strategy. This guide shows you how to secure your free-hosted site using free tools.
The Free Hosting Security Reality
What You Lose vs Paid Hosting
| Security Feature | Typical Paid Host ($5+) | Free Hosting | Your Responsibility |
|---|---|---|---|
| SSL/HTTPS | Auto Let's Encrypt | Often missing/paid | You must provide |
| WAF (Web App Firewall) | ModSecurity/Cloudflare | None | You must provide |
| DDoS Protection | Basic to Enterprise | None | You must provide |
| Malware Scanning | Daily/Real-time | None | You must provide |
| Automated Backups | Daily/Weekly + 1-click restore | None | You must provide |
| Server Hardening | CageFS, CloudLinux, containers | Basic shared | Limited control |
| 2FA for Control Panel | Standard | Rare | Check availability |
| Security Monitoring | 24/7 SOC | None | You must provide |
| Incident Response | Expert team | You alone | You must handle |
The Shared Environment Risk
On traditional free shared hosting (InfinityFree, 000webhost, etc.), you share:
- Physical server with 100-500 other accounts
- IP address with potential spam/malware sites
- MySQL server (injection risks from neighbors)
- File system (symlink attacks if misconfigured)
- CPU/RAM (noisy neighbor = your site slows)
Static site hosting (Netlify, Vercel, GitHub Pages, Cloudflare Pages) largely avoids these risks - your files are served from a global CDN with isolated edge nodes.
Layer 1: Cloudflare — Your Free Security Foundation
Cloudflare's free plan is the single most impactful security upgrade for any free-hosted site.
What Cloudflare Free Gives You
- Free Universal SSL (HTTPS for any domain)
- WAF (Web Application Firewall) - 5 managed rulesets
- DDoS Protection - Unmetered, automatic
- CDN - 300+ edge locations globally
- Bot Management - Basic bot detection
- Rate Limiting - 10K requests/day free
- DNS - Fast, free, with DNSSEC
- Page Rules - 3 free (redirects, caching, security)
- Analytics - Basic traffic insights
Cloudflare Setup Checklist
1. Add Your Site to Cloudflare
# 1. Create Cloudflare account # 2. Add your domain (or subdomain) # 3. Change nameservers at registrar to Cloudflare's # 4. Wait for propagation (5-30 min)2. SSL/TLS Settings
SSL/TLS → Overview → Full (Strict) - Requires valid cert on origin (your host) - If origin has no SSL: Use "Full" (not Strict) - Enable "Always Use HTTPS" - Enable "Automatic HTTPS Rewrites"3. Security Settings
Security → Settings: - Security Level: Medium (or High for static sites) - Challenge Passage: 30 min - Browser Integrity Check: ON - Privacy Pass: ON4. WAF (Web Application Firewall)
Security → WAF → Managed Rules: - Enable "Cloudflare Managed Ruleset" (free) - Enable "OWASP Managed Ruleset" (free) - Add custom rules for your CMS (WordPress, etc.)5. Rate Limiting (Free: 10K req/day)
Security → Rate Limiting: - Create rule: /wp-login.php, /xmlrpc.php, /admin - Threshold: 5 requests/minute - Action: Challenge (CAPTCHA)6. Bot Management
Security → Bots: - Enable "Bot Fight Mode" (free) - View bot analytics in Security → Events7. Page Rules (3 Free)
Rules → Page Rules: 1. *yourdomain.com/wp-admin* → Security Level: High, Cache: Bypass 2. *yourdomain.com/* → Always Use HTTPS: ON 3. *yourdomain.com/api/* → Cache: Bypass (if applicable)Layer 2: SSL/TLS — Non-Negotiable in 2026
If Your Free Host Provides SSL
- Enable it
- Force HTTPS via Cloudflare "Always Use HTTPS"
- Verify with SSL Labs:
ssllabs.com/ssltest/
If Your Free Host Does NOT Provide SSL
Option A: Cloudflare (Recommended)
- Cloudflare terminates SSL at edge
- Use "Flexible" SSL mode (not ideal but works)
- Better: Move to host with SSL (Netlify, Vercel, etc.)
Option B: Let's Encrypt via ACME Client
- If you have shell access (Oracle Cloud, VPS)
- Use
certbotoracme.shfor auto-renewal - Set up cron for renewal
Option C: ZeroSSL / BuyPass Go SSL
- Alternative free CAs
- 90-day certs, API for automation
HSTS (HTTP Strict Transport Security)
Add via Cloudflare Workers or origin headers:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadSubmit to hstspreload.org after testing.
Layer 3: Security Headers
Add these headers via Cloudflare Workers (free) or origin configuration:
Cloudflare Workers Script (Free: 100K requests/day)
// security-headers.js
export default {
async fetch(request, env, ctx) {
const response = await fetch(request);
const newHeaders = new Headers(response.headers);
// Security Headers
newHeaders.set('X-Frame-Options', 'DENY');
newHeaders.set('X-Content-Type-Options', 'nosniff');
newHeaders.set('Referrer-Policy', 'strict-origin-when-cross-origin');
newHeaders.set('Permissions-Policy', 'camera=(), microphone=(), geolocation=()');
// CSP - Adjust for your site
newHeaders.set('Content-Security-Policy',
"default-src 'self'; " +
"script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; " +
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; " +
"font-src 'self' https://fonts.gstatic.com; " +
"img-src 'self' data: https:; " +
"connect-src 'self'; " +
"frame-ancestors 'none'; " +
"base-uri 'self'; " +
"form-action 'self';"
);
// HSTS
newHeaders.set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload');
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: newHeaders
});
}
};Deploy: Cloudflare Dashboard → Workers → Create Service → Paste code → Add route: yourdomain.com/*
Layer 4: Backups — Your Last Line of Defense
The 3-2-1 Backup Rule
- 3 copies of your data
- 2 different media (local + cloud)
- 1 off-site (different physical location)
Free Backup Strategies by Platform
Static Sites (Netlify, Vercel, GitHub Pages, Cloudflare Pages)
# Your Git repo IS your backup
# 1. Push to GitHub (primary)
# 2. Mirror to GitLab/Bitbucket (secondary)
# 3. Clone locally periodically (tertiary)
# Automated mirror via GitHub Actions:
# .github/workflows/mirror.yml
name: Mirror to GitLab
on: [push]
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Push to GitLab
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/user/repo.git
git push gitlab --mirrorWordPress on Free Shared Hosting
# Use a plugin (UpdraftPlus free, BackWPup free)
# Configure to save to:
# - Google Drive (15GB free)
# - Dropbox (2GB free)
# - OneDrive (5GB free)
# - Amazon S3 (free tier: 5GB)
# - FTP/SFTP to another server
# Schedule: Daily database, Weekly full
# Retain: 4 weeks
# Test restore monthly!Database-Only Backup (MySQL/PostgreSQL)
# Free tier databases (Supabase, PlanetScale, Neon, Neon)
# Have built-in point-in-time recovery (7-30 days)
# Enable and understand the retention policy
# For self-hosted on Oracle Cloud:
# Automate with cron + mysqldump/pg_dump
# Upload to cloud storage (rclone to Google Drive, etc.)File-Level Backup (rclone)
# Install rclone
# Configure remotes: gdrive, dropbox, s3, etc.
# Script:
rclone sync /path/to/site gdrive:backups/site-$(date +%Y%m%d) --progress
# Cron: 0 3 * * * /path/to/backup.sh >> /var/log/backup.log 2>&1Layer 5: Monitoring & Alerting
Uptime Monitoring (Free Tiers)
| Service | Free Tier Checks | Interval | Alerting |
|---|---|---|---|
| UptimeRobot | 50 monitors | 5 min | Email, Webhook, Slack |
| Better Stack | 10 monitors | 30 sec | Email, Phone, Slack, PagerDuty |
| StatusCake | 10 monitors | 5 min | Email, Webhook |
| Pingdom | 1 monitor | 1 min | Email, SMS |
| Freshping | 50 monitors | 1 min | Email, Slack, Twilio |
| Cronitor | 5 monitors | 1 min | Email, Webhook, PagerDuty |
Recommendation: UptimeRobot - 50 monitors at 5-min intervals covers most needs free.
SSL Certificate Monitoring
- UptimeRobot can check SSL expiry
- SSL Mate free certificate monitoring
- Cloudflare shows cert status in dashboard
Domain Expiry Monitoring
- DomainTools free whois monitoring
- Namecheap/Cloudflare/Porkbun auto-renew (enable it!)
Security Event Monitoring
- Cloudflare Security Events dashboard (free)
- GitHub Dependabot for dependency vulnerabilities
- Snyk free tier for code scanning
Layer 6: Application-Level Hardening
If Using WordPress on Free Hosting
// wp-config.php hardening
define('DISALLOW_FILE_EDIT', true); // Disable theme/plugin editor
define('WP_AUTO_UPDATE_CORE', 'minor'); // Auto-update minor versions
define('FORCE_SSL_ADMIN', true); // Force SSL for admin
// Disable XML-RPC (common attack vector)
add_filter('xmlrpc_enabled', '__return_false');
// Limit login attempts (use plugin: Limit Login Attempts Reloaded)
// Change default "admin" username
// Use strong passwords + 2FA (plugin: WP 2FA)
// Keep core, plugins, themes updated
// Delete unused plugins/themesIf Using Static Site Generators
- Keep dependencies updated:
npm audit fix/yarn audit - Use
npm outdated/yarn outdatedmonthly - Pin dependency versions in package-lock.json
- Enable GitHub Dependabot alerts
General Application Security
- Never commit secrets (API keys, passwords, tokens)
- Use environment variables for config
- Rotate keys periodically
- Use
.gitignorefor sensitive files - Scan with
git-secretsortruffleHog
Layer 7: Access Control
Control Panel / Hosting Account
- Enable 2FA if available (rare on free hosting)
- Use unique, strong password (password manager)
- Don't share credentials
- Use separate email for hosting accounts
Cloudflare Account
- Enable 2FA (TOTP + backup codes)
- Use API tokens (not global keys) for automation
- Limit token permissions to specific zones/actions
- Audit API token usage monthly
Domain Registrar
- Enable 2FA
- Enable Registry Lock if available (prevents unauthorized transfers)
- Enable Auto-renew
- Use WHOIS privacy (free at Cloudflare, Porkbun, Namecheap)
Git / Repository
- Enable 2FA on GitHub/GitLab/Bitbucket
- Use SSH keys (not HTTPS passwords)
- Sign commits with GPG/SSH
- Branch protection rules for main branch
- Require PR reviews for team projects
Incident Response Plan (Free Hosting Edition)
Before Incident: Prepare
- Document your stack - host, domain, DNS, SSL, backups
- Test your backups - restore to staging monthly
- Know your contacts - host support (if any), Cloudflare, registrar
- Have a communication plan - status page, Twitter, email list
During Incident: Respond
- Confirm - Check uptime monitor, try from different network
- Identify - Host issue? DNS? SSL? Code? DDoS? Hack?
- Mitigate - Cloudflare "Under Attack Mode", disable problematic feature
- Communicate - Update status page, notify stakeholders
After Incident: Recover & Improve
- Restore from clean backup if compromised
- Investigate - Check logs, Cloudflare events, access logs
- Harden - Add WAF rule, update software, rotate keys
- Document - Post-mortem, update runbook
Free Security Tools Checklist
Essential (Set Up Today)
- [ ] Cloudflare - DNS, SSL, WAF, DDoS, CDN, Rate Limit
- [ ] UptimeRobot - 50 monitors, 5-min checks
- [ ] GitHub/GitLab - Code backup, version control
- [ ] Password Manager - Bitwarden (free), 1Password, KeePass
- [ ] 2FA Authenticator - Aegis (open source), Authy, Google Authenticator
Recommended (Set Up This Week)
- [ ] rclone - Automated backups to cloud storage
- [ ] Cloudflare Workers - Security headers, custom logic
- [ ] SSL Labs Test - Quarterly SSL configuration audit
- [ ] Security Headers Scan - securityheaders.com
- [ ] Mozilla Observatory - observatory.mozilla.org
- [ ] GitHub Dependabot - Dependency vulnerability alerts
Advanced (When You Have Time)
- [ ] CSP Report Only - Test Content Security Policy
- [ ] HSTS Preload - Submit to hstspreload.org
- [ ] DMARC/DKIM/SPF - Email authentication (if sending email)
- [ ] Subresource Integrity - For third-party scripts
- [ ] Expect-CT - Certificate Transparency enforcement
Platform-Specific Security Guides
Netlify / Vercel / Cloudflare Pages / GitHub Pages
- Inherently more secure - no server, no database, no PHP
- Main risks: Supply chain (dependencies), build compromise, DNS hijack
- Focus: Dependency updates, 2FA on Git + hosting, DNSSEC
InfinityFree / 000webhost / Shared Free Hosting
- Highest risk - shared environment, no isolation
- Focus: Cloudflare (essential), backups (critical), minimal attack surface
- Consider: Move to static hosting or Oracle Cloud VPS
Oracle Cloud Free Tier (VPS)
- Full control = full responsibility
- Focus: SSH hardening, firewall (UFW/iptables), fail2ban, auto-updates, Cloudflare
- Tools: Lynis audit, CrowdSec, UFW, unattended-upgrades
The Security Budget: $0, But Time Investment Required
| Task | Frequency | Time |
|---|---|---|
| Cloudflare setup | One-time | 30 min |
| Backup test restore | Monthly | 15 min |
| Dependency updates | Monthly | 30 min |
| Security header audit | Quarterly | 20 min |
| SSL Labs test | Quarterly | 10 min |
| Access review (2FA, keys) | Quarterly | 15 min |
| Incident response drill | Bi-annually | 30 min |
Total: ~3-4 hours/month for solid free hosting security posture.
Summary: Your Free Hosting Security Stack
┌─────────────────────────────────────────────┐
│ CLOUDFLARE (FREE) │
│ DNS • SSL • WAF • DDoS • CDN • Rate Limit │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ YOUR HOSTING │
│ Static: Netlify/Vercel/Pages (Low Risk) │
│ Shared: InfinityFree/etc (High Risk) │
│ VPS: Oracle Cloud (You Harden) │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ BACKUPS (3-2-1 RULE) │
│ Git (Code) • Plugin/Script (DB/Files) │
│ Cloud Storage: GDrive/Dropbox/S3/R2 │
└──────────────────┬──────────────────────────┘
│
┌──────────────────▼──────────────────────────┐
│ MONITORING │
│ UptimeRobot • Cloudflare Events • SSL Labs │
└─────────────────────────────────────────────┘Final Thoughts
Free hosting security is your responsibility. No one will patch your CMS, scan for malware, or restore your backup for free. But with Cloudflare + Git backups + UptimeRobot + disciplined practices, you can achieve 90% of paid hosting security for $0.
The remaining 10% (managed WAF, expert incident response, guaranteed uptime, compliance) costs $5-50/month. Decide if your project needs it.
FreeHostingTrust will soon publish detailed security hardening guides for each free hosting platform with copy-paste configurations. Join the waitlist for early access.
Found this guide helpful?
Join our waitlist for notifications when new benchmark audits, downtime reports, and provider evaluations publish.