Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides setting up and hardening a Linux cloud server for web hosting, covering SSH, firewalls, Nginx, and HTTPS.
0% 32%+32 ptsof test cases passed
Passed 7 of 22 test cases with the skill, and 0 of 22 without it.
3 of 3 safety checks passed
Not used yet
This reference supports the secure-linux-web-hosting skill.
It adapts the conceptual flow of Xi Xu's article, "Build, Configure, and Secure Your Cloud Server from Scratch and Host a Simple Website," published on August 25, 2024: Xi Xu's Blog
The source article is licensed under CC BY-SA 4.0. This bundle keeps the high-level flow while modernizing the dated distro and tooling assumptions.
Aim for this end state unless the user explicitly needs something broader:
80 and 443 intentionally exposed for web traffic| Phase | Goal | Verify before continuing | Common failure if skipped |
|---|---|---|---|
| Intake | Identify distro family, access model, DNS state, and hosting goal | The assistant knows whether the user needs static hosting or reverse proxying | Wrong commands, wrong branch, or unsafe assumptions |
| Prerequisites | Confirm server access, domain ownership, DNS plan, and package/doc source of truth | User can log in and knows what domain should resolve where | Chasing web-server issues that are really access or DNS issues |
| Secure access | Establish admin access and harden SSH carefully | Key login works in a second session; SSH config tests cleanly before reload | Lockout after port or auth changes |
| Firewall and exposure | Make the network surface intentional | Only the intended ports are reachable; loopback-only services stay private | App or SSH unexpectedly exposed or blocked |
| Web server base | Install and validate Nginx itself | nginx -t succeeds and the service is healthy | Debugging app logic when Nginx is not actually healthy |
| Static-site branch | Serve files directly from Nginx | The site root exists, file permissions are readable, and HTTP serves the expected page | Wrong root path or unreadable files |
| App-proxy branch | Put Nginx in front of an app on loopback | The app responds locally before Nginx fronts it | Proxying a dead app or exposing the app port publicly |
| HTTPS | Issue, install, and renew certificates safely | DNS resolves, HTTP works, certificate issuance succeeds, HTTPS loads cleanly | ACME failures, wrong webroot, redirect loops |
| Validation | Confirm the final public behavior and renewal posture | HTTP/HTTPS behavior matches intent and logs look healthy | Hidden breakage left in place |
| Optional tuning | Apply BBR or similar tuning only if useful | Snapshot/rescue path exists and the web stack is already stable | Breaking a working host during non-essential tuning |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus popular skills in the same category.