A website rarely fails on launch day because one big thing went wrong. It fails because ten small things were never checked: a directory listing left open, a header missing, an image shipped at five times its needed size, a cache rule that forces every visitor to re-download the whole site. Each one is easy to fix before launch and painful to fix after users, search engines and attackers have already found it.
This checklist is written for the person who actually runs the server — a sysadmin, a developer who also deploys, or a small team with no separate operations department. It covers a Linux web server running Nginx or Apache, and every command below can be run on a staging server first, then repeated unchanged on production. Nothing here requires a paid tool. Where a third-party tool is named, it is named so you can check it yourself.
Run the whole checklist in under an hour the first time. After that, the automated section at the end turns it into a fifteen-minute routine you can repeat before every release.
1. Web Server Hardening and Security Headers
Start with the principle that the server should reveal as little as possible and trust as little as possible. A default installation is built for convenience, not for a public launch, so the first job is to remove the conveniences an attacker can use.
Turn off information leaks
Both Nginx and Apache advertise their version by default. That does not create a vulnerability by itself, but it tells an attacker exactly which known issues to try. Hide it.
In Nginx, add this to the http block of your configuration, then reload:
server_tokens off;
In Apache, add these directives to the server configuration:
ServerTokens Prod
ServerSignature Off
With ServerTokens Prod set, the same server answers with the version hidden — this is the live response header before and after:
Before: Server: Apache/2.4.66 (Ubuntu)
After: Server: Apache
Next, disable directory listing. A forgotten index file should produce a 404 error, not a browsable list of everything in the folder. In Nginx, simply do not add autoindex on; — it is off by default, so check that nobody has enabled it. In Apache, make sure directory indexes are removed:
Options -Indexes
Then check for files that should never be public: environment files, backup files, database dumps, .git directories and configuration files with passwords. A simple search on the server finds most of them:
find /var/www -type f \( -name ".env" -o -name "*.bak" -o -name "*.sql" -o -name "*.old" \) 2>/dev/null
If anything in that list is reachable from a browser, move it out of the web root. A .env file in the document root is not a minor issue; it is often the whole game.
Lock down access
Only the ports you actually use should be open. On a typical web server that means 22 for SSH, 80 for HTTP and 443 for HTTPS, and nothing else unless you have a reason. Check what is listening:
ss -tlnp
$ ss -tlnp
0.0.0.0:22 sshd
0.0.0.0:80 nginx
0.0.0.0:443 nginx
127.0.0.1:8000 uvicorn (application server, loopback only)
The application port binds to loopback only — the public surface is 22, 80 and 443, exactly the list in this checklist.
Then confirm the firewall matches that list. With UFW, the firewall tool included in Ubuntu, the rules look like this:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status verbose
$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/tcp (OpenSSH) ALLOW IN Anywhere
80,443/tcp (Nginx Full) ALLOW IN Anywhere
One practical note from doing this live: enable the firewall only after the OpenSSH rule exists, and open a second SSH session before closing the first — the new session connecting successfully is the proof you are not locked out.
For SSH itself, disable password logins and use keys. In /etc/ssh/sshd_config, set PasswordAuthentication no and PubkeyAuthentication yes, then restart SSH and confirm you can still log in from a second terminal before closing your current session. That last precaution matters: locking yourself out of your own server on launch day is a self-inflicted outage.
A tool such as Fail2ban, which watches logs and temporarily blocks addresses that fail authentication repeatedly, is worth installing on any server that faces the internet. It does not replace strong passwords and keys, but it quietly removes most of the background noise of brute-force attempts.
This is not theory. On the test server, within a day of Fail2ban being installed, its sshd jail already showed real brute-force traffic being handled:
$ sudo fail2ban-client status sshd
Status for the jail: sshd
|- Currently failed: 1
|- Total failed: 183
`- Actions
|- Currently banned: 4
`- Total banned: 5
Set the security headers
Security headers are small instructions the server sends with every page. Browsers follow them automatically, and they cost nothing in performance. The four that matter most at launch are Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), X-Content-Type-Options and a sensible Referrer-Policy.
In Nginx, add them to the server block:
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https:; connect-src 'self';" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
In Apache, the same headers use a different syntax:
Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https:; connect-src 'self';"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
A note of caution on CSP: start with the policy above, test it in the browser console, and only then tighten it. A CSP that blocks your own scripts will break the site for every visitor, and the error will look like a JavaScript bug. Test it on staging, watch the console for blocked resources, add only what the site genuinely loads, and then deploy.
HSTS deserves a similar warning. Once a browser has seen HSTS, it will refuse to load the site over plain HTTP until the max-age expires. That is exactly what you want on a finished site, but only enable it after HTTPS is working reliably, including redirects and subdomains. Do not enable HSTS on a server whose certificate is about to expire.
Enabling HSTS and joining the preload list are two different steps. The header in this article — Strict-Transport-Security: max-age=63072000; includeSubDomains; preload — turns on HSTS for browsers that visit your site. It does not by itself put the domain on the browser preload list. For that, the domain must be submitted at hstspreload.org, and the submission is only accepted when every requirement is already met: a valid certificate, HTTP redirecting to HTTPS, the HSTS header served on the base domain over HTTPS, max-age of at least 31536000 seconds (one year), and both includeSubDomains and preload present. The includeSubDomains part is the one people get wrong: it applies HSTS to every subdomain, so every subdomain — including www and any staging or internal subdomain — must already work over HTTPS before you enable it, or those subdomains will stop loading. Preload is also hard to undo: once browsers ship your domain in their built-in list, removal takes months and needs a removal request, so submit only a domain whose HTTPS setup is finished and stable. Practical order: first run plain HSTS (max-age + includeSubDomains, no preload) for a few weeks and confirm nothing breaks; only then add preload and submit.
The four Nginx add_header lines above, served live by the test server:
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' https:; connect-src 'self';
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Get SSL/TLS right, not just present
A padlock icon is not the same as a correct TLS setup. Check three things: the certificate covers every hostname the site uses (including www), old and weak protocols are off, and HTTP redirects to HTTPS.
If you use Let’s Encrypt with its Certbot tool, a certificate and an automatic redirect are usually one command:
sudo certbot --nginx -d example.com -d www.example.com
Replace example.com with your own domain and --nginx with --apache if you run Apache. Certbot also sets up automatic renewal, but verify that renewal actually works rather than assuming it:
sudo certbot renew --dry-run
$ sudo certbot renew --dry-run
Simulating renewal of an existing certificate for api.toolifyhub.tools
Congratulations, all simulated renewals succeeded:
/etc/letsencrypt/live/api.toolifyhub.tools/fullchain.pem (success)
Then test the live result from outside the server:
curl -I https://example.com
openssl s_client -connect example.com:443 -servername example.com < /dev/null 2>/dev/null | grep -E "Verify return code|Protocol|Cipher"
$ openssl s_client -connect api.toolifyhub.tools:443 -servername api.toolifyhub.tools
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Protocol: TLSv1.3
Verify return code: 0 (ok)
Look for a verification return code of 0, a TLS 1.2 or TLS 1.3 protocol, and a modern cipher. In the server configuration, disable the old protocols explicitly. In Nginx:
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
In Apache:
SSLProtocol -all +TLSv1.2 +TLSv1.3
Before going live, test the configuration itself. A syntax error in a web server configuration can take the whole site down on reload, and the fix is a thirty-second check:
sudo nginx -t && sudo systemctl reload nginx
For Apache, the equivalent is:
sudo apache2ctl configtest && sudo systemctl reload apache2
Never restart the web server when a reload will do. A reload applies the new configuration without dropping existing connections; a restart does not.
Verified on a live Ubuntu server (Nginx 1.28.3, Apache 2.4.66):
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo apache2ctl configtest && sudo systemctl reload apache2
Syntax OK
(Apache may print a harmless AH00558 line about not being able to determine the server’s fully qualified domain name before Syntax OK — it is a name warning, not a config error.)
2. Asset Optimization Before Deployment
Performance work done after launch is always harder, because by then the slow pages are already indexed and already annoying real users. The cheapest time to make a site fast is before the files are uploaded.
Images: the biggest win, and the most skipped
Images are usually the largest part of a page, and they are usually the least optimized. A photograph exported straight from a camera or a design tool can be several megabytes; the same photograph at web size, in a modern format, is often under 200 kilobytes with no visible difference.
Start with size. Resize every image to the largest size it will actually be displayed at. A 4000-pixel-wide photograph displayed at 800 pixels is five times larger than it needs to be in each dimension. Then convert photographs to WebP, and consider AVIF for hero images where browser support is acceptable; both are substantially smaller than JPEG at the same visual quality. The cwebp command-line tool, part of Google’s WebP tools, converts a single file like this:
cwebp -q 80 input.jpg -o output.webp
A real conversion on the test server (a 400×300 test image; the ratio depends heavily on the image — a smooth test image compresses far more than a photograph):
$ cwebp -q 80 test.png -o test.webp
Output: 1488 bytes Y-U-V-All-PSNR 50.59 48.16 47.01 49.33 dB
(input test.png: 123,089 bytes -> output test.webp: 1,488 bytes)
For bulk conversion, the ImageMagick suite can process a whole folder, but check each output once by eye. Automated conversion can occasionally produce a poor result on a particular image, and one bad hero image is worse than a slightly larger file.
For logos, icons and illustrations, use SVG where possible. An SVG scales to any screen without getting bigger, and it is usually smaller than a PNG of the same graphic. Before shipping, minify SVG files — removing editor metadata, comments and unnecessary precision — with a tool such as SVGO, which is built for exactly this job. Do not minify by hand; the savings come from dozens of small removals that are easy to get wrong manually.
Finally, add width and height attributes to every image tag. Without them, the browser does not know how much space to reserve, the page layout shifts as images load, and that shift is exactly what the Cumulative Layout Shift metric measures. It is a one-line fix per image and it removes an entire class of layout-jump complaints.
CSS and JavaScript: minify, then verify
Minification removes whitespace, comments and unnecessary characters from CSS and JavaScript without changing what the code does. The savings on a single file are modest; across a whole site, they add up, and they also reduce the time a browser spends parsing code on a slow phone.
The rule is simple: deploy the minified file, but test the minified file, not just the source. Minifiers are reliable, but a build step that concatenates files in the wrong order, or a variable renamed incorrectly, will produce a file that loads without an error message and simply does not work. Open the deployed site in a browser, use the features the JavaScript powers, and check the console. If you want a fast, no-install way to compare a file before and after minification, run it through the code minifier on ToolifyHub and check that the output still behaves the same in a test page.
Keep the original, unminified files in your repository and deploy only the built output. Debugging a minified file in production is painful; debugging it when the source is lost is worse. The same applies to source maps: generate them for your own debugging, but do not publish them publicly unless you are comfortable sharing your source code with everyone.
Fonts and third-party scripts: count them
Every web font and every third-party script is a separate download, often from a separate server, and each one can delay the page. Before launch, list them all and ask of each one: does this earn its place? A font family with four weights in two styles is eight files. A chat widget, an analytics script, a social embed and a video player can easily double a page’s load time.
Load fonts with font-display: swap so text appears immediately in a fallback font and swaps to the real font when it arrives, instead of leaving visitors staring at a blank page. Load third-party scripts with defer or async where the script allows it, and never let a non-essential script block the main content. If a script is not needed on the first screen, load it after the page renders, not before.
3. Core Web Vitals from the Sysadmin Lens
Google’s Core Web Vitals — Largest Contentful Paint (LCP), Interaction to Next Paint (INP) and Cumulative Layout Shift (CLS) — are usually discussed as front-end metrics, but a large part of each one is decided on the server. A developer can write perfect front-end code and still fail these metrics on a slow or badly configured server.
Time to First Byte: the server’s own score
Time to First Byte (TTFB) measures how long the server takes to start answering. It is the one metric that is almost entirely the server’s responsibility. A TTFB over 800 milliseconds is a warning sign; under 200 milliseconds on a nearby server is a reasonable target for a static or lightly dynamic page.
Measure it from the command line, from a machine near your users if possible:
curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s | Total: %{time_total}s\n" https://example.com/
Measured on the test server against its own staging page (loopback, so treat the absolute values as a method demonstration — on a real network the same command shows the server’s network TTFB):
$ curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s | Total: %{time_total}s\n" http://127.0.0.1/
TTFB: 0.000484s | Total: 0.000522s
TTFB: 0.000423s | Total: 0.000450s
TTFB: 0.000383s | Total: 0.000444s
If TTFB is high, look in this order: slow database queries, a server that is under-resourced for its traffic, PHP or application code that runs on every request when it could be cached, and a server physically far from the users. A content delivery network helps the last problem, but it does not fix a slow application — it only delivers the slow answer faster.
Compression: gzip, and brotli where it fits
Text compresses extremely well. HTML, CSS and JavaScript typically shrink by 70 to 80 percent with gzip, and brotli, the newer algorithm, does a little better on text. If your server is not compressing text responses, you are sending several times more data than necessary for no reason.
In Nginx, enable gzip in the http block:
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
gzip_min_length 1024;
Brotli requires the brotli module, which is not in every Nginx build; check with nginx -V before assuming it is available. If it is, enable it alongside gzip — browsers that support brotli will use it, and the rest will fall back to gzip automatically. Verify from outside:
On a stock Ubuntu Nginx, gzip on is present but the gzip_types line ships commented out, so only HTML is compressed. Adding the block above changed the live result for the staging site’s CSS and JavaScript (files over the 1 KB gzip_min_length):
Before: /style.css -> (no Content-Encoding) 1206 bytes sent
/app.js -> (no Content-Encoding) 1144 bytes sent
After: /style.css -> Content-Encoding: gzip 628 bytes sent
/app.js -> Content-Encoding: gzip 588 bytes sent
Two details worth knowing: files smaller than gzip_min_length are deliberately skipped (our 125-byte stylesheet was not compressed until it grew past 1 KB), and on these small files gzip saved about 48% — the 70–80% figure applies to larger text files. These are loopback figures from a small test page on local staging — they show the configuration working, not what a production site will gain; see the caveat above the measurement table in §3.
curl -H "Accept-Encoding: gzip" -I https://example.com/ | grep -i content-encoding
If nothing comes back, compression is not active for that response, and the configuration needs another look. Do not compress already-compressed files such as images, videos and archives; compressing them wastes CPU and can make them slightly larger.
Caching headers: let the browser help
A browser that has already downloaded a file should not have to download it again on the next visit. Caching headers tell it how long to keep each file. Static assets with versioned filenames — files whose names change when their content changes — can be cached for a year. HTML pages, which change often, should be cached briefly or not at all.
In Nginx, a typical rule for static assets looks like this:
location ~* \.(css|js|png|jpg|jpeg|webp|avif|svg|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
The word “immutable” matters: it tells the browser that a file with this name will never change, so it does not even need to ask the server whether a new version exists. That only works if the filename really does change with the content, which is why build tools that add a content hash to filenames are worth using. Without the hash, a one-year cache means visitors keep seeing the old file for a year.
Test caching the same way you test compression — with curl, from outside:
curl -I https://example.com/style.css | grep -i -E "cache-control|expires"
$ curl -I http://127.0.0.1/style.css | grep -i -E "cache-control|expires"
Expires: Sun, 07 Nov 2027 07:14:53 GMT
Cache-Control: max-age=31536000
Cache-Control: public, immutable
(Two Cache-Control lines are normal here: expires generates the max-age line, and the add_header directive adds the public, immutable line.)
If the headers are missing, the browser is re-downloading the file on every visit, and no amount of front-end optimization will compensate.
Largest Contentful Paint: put the pieces together
LCP measures when the largest visible element — usually a hero image or a heading — finishes rendering. From the server side, LCP is the sum of TTFB, the time to download the critical CSS and the hero image, and any delay caused by render-blocking scripts. Improve it by fixing the pieces above in order: fast TTFB, compressed and cached assets, a hero image that is already the right size and format, and no render-blocking script in front of it.
Measure LCP in a real browser, not just from the command line. Google’s Lighthouse tool, built into Chrome’s developer tools, reports all three Core Web Vitals for a page and points at the specific resource that is slowing it down. Run it on staging before launch, fix the largest item it names, and run it again. One measurement is a guess; two measurements, before and after a change, are evidence.
Lab numbers are not real-user numbers — especially for INP. Lighthouse runs in a lab: it loads the page once, on a simulated device and network, with no real user clicking, typing or scrolling. It reports Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS) from that single lab load, and it reports Total Blocking Time (TBT) — the total time the main thread was blocked by tasks longer than 50 ms — as a diagnostic for responsiveness. It does not report Interaction to Next Paint (INP) at all: INP only exists when a real person actually interacts with the page, so it is a field metric, measured from real users.
That is why the before-and-after table in this article shows INP as “n/a” — not because the measurement failed, but because a lab run cannot produce it. To judge INP for real, use field data: the Chrome User Experience Report (CrUX) — the same data behind the “field data” section of PageSpeed Insights — or real-user monitoring (RUM), for example the open-source web-vitals JavaScript library reporting INP from actual visitors. TBT is the useful lab stand-in while you work: if TBT falls after a change, INP usually improves for real users too, but TBT is not INP, and a good lab TBT does not guarantee a good field INP. Check both: lab (Lighthouse) before every release, field (CrUX / RUM) once the release has had real traffic.
Before-and-after measurements from the test server (staging page on Nginx, loopback; Lighthouse 13.6.0, Chrome Headless Shell 157, default mobile emulation). Before = Ubuntu stock config; after = the article’s gzip block, security headers and caching location added:
Read these numbers for what they are. Every measurement in the table below was taken on a local loopback staging environment (the test page served from the same machine, 127.0.0.1) using a small test page (972 bytes of HTML). They demonstrate what the configuration changes do — the gzip block turning CSS/JS compression on (style.css 1206 → 628 bytes, app.js 1144 → 588 bytes, about 48% on these small files) and the security and caching headers appearing where none were served before — not what a production site will gain. On a real network, results vary with connection speed, distance to the server, device, and traffic: TTFB will be far above the ~0.4 ms loopback figure, and the Lighthouse score of 100 before and after only says this tiny test page was already fast in the lab. Treat the table as proof the changes work, and measure again on staging over a real network before judging production impact.
| Measure | Before | After | Note |
|---|---|---|---|
| Lighthouse Performance score | 100 | 100 | A 972-byte local page already scores 100; the changes show up in bytes/headers, not this score |
| LCP | 0.8 s | 0.8 s | Lab value on loopback |
| CLS | 0 | 0 | Images carry width/height, as §2 advises |
| INP | n/a | n/a | Field metric — Lighthouse lab runs do not produce INP |
| TBT | 0 ms | 0 ms | — |
| FCP / Speed Index | 0.8 s / 0.8 s | 0.8 s / 0.8 s | — |
| TTFB (curl, loopback, ×3) | 0.000383–0.000484 s | 0.000469–0.000499 s | No meaningful change on the same machine — expected |
| HTML transfer (gzip offered) | 571 of 972 bytes | 571 of 972 bytes | Distro default already gzips HTML |
| style.css transfer | 1206 bytes, no encoding | 628 bytes, gzip | −47.9% |
| app.js transfer | 1144 bytes, no encoding | 588 bytes, gzip | −48.6% |
| Security headers on page | none | CSP, HSTS, X-Content-Type-Options, Referrer-Policy | §1 lines served live |
| Cache headers on assets | none | Expires +1y; Cache-Control max-age=31536000 + public, immutable | §3 location block served live |
4. Automated Pre-Flight Verification: Fifteen Minutes, Every Release
A checklist that lives only in a document will be skipped under deadline pressure. The goal of this section is to turn the manual checks above into a script and a browser routine that together take under fifteen minutes and can be run by anyone on the team, including the person who wrote the code.
A bash pre-flight script
Save the following as preflight.sh on the server, make it executable, and run it against staging before every deployment. It checks that the site answers, that HTTPS works, that security headers are present, that compression is active, and that no common private file is publicly reachable. Replace example.com with your domain before running it.
#!/bin/bash
# Pre-flight checks for a Linux web server. Exits non-zero on failure.
set -e
SITE="https://example.com"
echo "== 1. Site answers over HTTPS =="
curl -fsS -o /dev/null -w "HTTP %{http_code} in %{time_total}s\n" "$SITE"
echo "== 2. Security headers present =="
for HEADER in "strict-transport-security" "x-content-type-options" "content-security-policy"; do
curl -fsS -I "$SITE" | grep -qi "$HEADER" && echo "OK: $HEADER" || { echo "MISSING: $HEADER"; exit 1; }
done
echo "== 3. Compression active (gzip required, Brotli if available) =="
if curl -fsS -H "Accept-Encoding: gzip" -I "$SITE" | grep -qi "content-encoding: gzip"; then
echo "OK: gzip"
else
echo "MISSING: gzip"; exit 1
fi
if curl -fsS -H "Accept-Encoding: br" -I "$SITE" | grep -qi "content-encoding: br"; then
echo "OK: Brotli"
else
echo "NOTE: Brotli not active — check 'nginx -V' for the Brotli module; gzip fallback is fine, this is not a failure."
fi
echo "== 4. Private files not public (by HTTP status code) =="
for PATH in ".env" ".git/HEAD" "backup.sql" "config.php.bak"; do
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SITE/$PATH")
case "$CODE" in
200|206)
echo "EXPOSED: $PATH (HTTP $CODE)"; exit 1 ;;
301|302|307|308)
LOCATION=$(curl -s -I "$SITE/$PATH" | grep -i "^location:" | tr -d '\r')
echo "REDIRECT: $PATH (HTTP $CODE) -> $LOCATION — check the target is not the file itself" ;;
401|403|404|410)
echo "OK: $PATH not public (HTTP $CODE)" ;;
*)
echo "WARN: $PATH returned unexpected HTTP $CODE — check it manually" ;;
esac
done
echo "== 5. Certificate expiry =="
echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null \
| openssl x509 -noout -dates
echo "Pre-flight passed."
Run it with:
chmod +x preflight.sh
./preflight.sh
The script is deliberately strict: any failure stops it. That is the point. A pre-flight check that prints warnings and continues will be ignored; one that fails the deployment gets fixed. Add checks to it as you learn from incidents — every outage that could have been caught by a script should become a new check in the script.
The browser half of the checklist
Automation covers the server; a human still needs to cover the experience. Open the staging site in a browser, in a private window so no cache hides a problem, and work through this list:
- Load the homepage and one inner page. Do images load, and does the layout stay still as they appear?
- Open the browser console. Are there errors, blocked resources from the CSP, or mixed-content warnings?
- Submit the main form, if the site has one, and complete the main action a visitor takes — a purchase, a signup, a download.
- Test on a phone-sized window, not just a desktop. Most visitors will arrive on a phone, and a layout that works on a monitor can fail completely on a small screen.
- Run Lighthouse once and note the Performance score, LCP, CLS and TBT. INP does not appear in a lab run — check it in CrUX / PageSpeed Insights field data after launch.
This takes about ten minutes once it is familiar. Together with the script, it is the whole pre-flight routine, and it catches the two kinds of failure that automation alone misses: the site that answers correctly but looks broken, and the site that looks fine but is quietly insecure.
After launch: the first 24 hours
Launch is not the end of the checklist. In the first day, watch the server logs for 404 errors and 500 errors, confirm that the certificate renewal timer is set, check that backups actually ran, and re-run the pre-flight script against production. A backup that has never been restored is a hope, not a backup; at least once, restore a file from it on a test server and confirm it works.
Set up monitoring before you need it. Even a simple uptime check that alerts you when the site stops answering is worth more than a perfect dashboard nobody looks at. The cheapest outage is the one you hear about from your monitor, not from your users.
5. Code Hygiene Before Deployment
“Code hygiene” sounds like tidiness for its own sake. On a live server it is risk control: most launch-day rollbacks are not caused by a bad feature, but by a secret that leaked, a dependency that broke, or a file that should never have shipped.
Keep secrets out of the repository. Before launch, search the repo for the things that must never be public: API keys, passwords, private keys and .env files. A .env file belongs on the server only, never in git — check .gitignore lists it, and confirm with git ls-files | grep -i env that no env file was committed by accident. If one was, rotate that secret immediately; deleting it from git history afterwards does not un-leak it. The same check applies to backup files (*.bak, *.sql) and to .git directories inside the web root — the pre-flight script in §4 already probes for these from outside, but the fix happens in the repo, before deploy.
Audit dependencies, then freeze them. Run your ecosystem’s audit once before launch — npm audit for Node, pip-audit for Python, or your package manager’s equivalent — and fix anything marked critical. Then lock versions (package-lock.json, requirements.txt with pinned versions) so staging and production install exactly the same code. A deploy that installs “latest” on production is a different deploy from the one you tested on staging.
Lint and format, automatically. A linter (ESLint, Ruff, or your stack’s equivalent) plus a formatter run in CI catches the errors humans miss: unused variables, unreachable code, and the formatting drift that makes the next person’s review slower. The rule that makes this stick is simple — if the linter fails, the deploy stops, exactly like the pre-flight script. Do not rely on remembering to run it.
Deploy from a clean, reviewed change. Every launch should come from one reviewed pull request or commit, deployed to staging first and then to production unchanged — never edit code directly on the server to “fix it quickly”, because that fix exists nowhere else and will be overwritten by the next deploy. Keep a rollback ready: the previous release’s files, or a one-command revert to the previous commit, tested once before you need it. A rollback you have never tested is a hope, not a plan.
Sweep dead code and TODOs. Before launch, remove commented-out code blocks, unused files and debug flags left in from development. They are not harmless: dead code confuses the next reader, debug flags leak information, and an old admin page nobody remembers is an unguarded door. If code is not used, delete it — version control remembers it if you ever need it back.
None of this needs a paid tool. It needs one hour, once, and then the same checks running automatically on every deploy. A server that is hardened but ships sloppy code is still a launch-day risk; a clean codebase on a hardened server is the combination this checklist is aiming for.
Conclusion
A pre-launch checklist is not bureaucracy. It is the difference between a launch that feels uneventful — which is what a good launch should feel like — and a launch spent fixing in public what could have been fixed in private. Harden the server, set the headers, get TLS right, shrink the assets before they ship, configure compression and caching, and then automate the verification so the checklist survives deadline pressure.
Do it on staging first, every time. The server does not care whether the site is finished; it will serve whatever you put on it, securely or not, quickly or not. That choice is made before launch, in the quiet hour spent running these checks — and it is much cheaper there than anywhere else.
