# Install and configure an SSL/TLS certificate on my server

Step-by-step HTTPS setup for your exact server and software, including renewal, redirects, and how to verify it worked.

- Topic: Software Development
- Framework: Few-Shot
- Level: Advanced
- Tags: Explain & Teach, Fill-in Template, Interactive
- Source: https://www.thinkwithprompt.com/prompts/install-and-configure-an-ssl-tls-certificate-on-my-server

## Prompt

```text
Walk me through setting up HTTPS with an SSL/TLS certificate.

**Website or app:** [DOMAIN(S), including www and subdomains]
**Hosting:** [VPS / dedicated server / shared hosting / managed platform - provider if relevant]
**Operating system:** [e.g. "Ubuntu 24.04", "Windows Server 2022"]
**Web server or proxy:** [Nginx / Apache / IIS / Caddy / load balancer / CDN in front]
**Certificate source:** [free automated (e.g. Let's Encrypt) / bought from a CA / provided by my host / not sure]
**Access I have:** [root or SSH / control panel only]
**Current state:** [no HTTPS / expired certificate / errors - PASTE ANY ERROR]

Give me:
1. The right approach for my setup and why (automated vs. manual certificate, where TLS should terminate if a CDN or load balancer is involved).
2. Exact steps and commands, in order, with file paths and the config lines to add or change. Explain what each one does.
3. Redirects from HTTP to HTTPS and from non-canonical hostnames, without redirect loops.
4. Sensible TLS settings (modern protocol versions, full certificate chain) and when to consider HSTS, with its risks.
5. Automatic renewal and how to test it.
6. A verification checklist: browser check, command-line check, mixed-content check, and an expiry reminder.
7. Troubleshooting for common errors (chain incomplete, name mismatch, port 80/443 blocked, DNS not pointing to the server).

Tell me to back up config files before editing and to test config syntax before reloading. Never ask me to paste private keys; if a command shows one, tell me to keep it private.
```

## What to fill in

- DOMAIN(S), including www and subdomains
- e.g. "Ubuntu 24.04", "Windows Server 2022"
- Nginx / Apache / IIS / Caddy / load balancer / CDN in front
- root or SSH / control panel only
- no HTTPS / expired certificate / errors - PASTE ANY ERROR

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
