Back to Blog
Offline PWA on a Linux Laptop: Domain, Certificate, and Monitoring Checklist

Offline PWA on a Linux Laptop: Domain, Certificate, and Monitoring Checklist

   Mariusz Antonik    Security    8 min read    7 views

A progressive web app can work perfectly from a hosted domain and still fail when you move it to a Linux laptop hotspot. The common symptom is frustrating: phones and tablets can reach the app by IP address, but the browser shows a certificate warning, the service worker will not install, and offline mode never becomes reliable.

The root issue is usually not the PWA code. Service workers require a secure, trustworthy origin. A raw hotspot IP address with a warning is not trustworthy enough, and a certificate generated for the wrong name does not help. Treat the laptop like a small field server: give it a stable name, serve a certificate that matches that name, install the right trust chain on client devices, and add simple linux server monitoring so you know the field setup is healthy before users depend on it.

Why the IP address works but offline mode does not

Browsers intentionally make service workers stricter than ordinary page loads. You may be able to click through a certificate warning and view the app, but that does not mean the origin is acceptable for installing a service worker, caching assets, or enabling installable offline behavior. The browser needs the app to load from a valid secure context.

On a hosted website, the pieces are already aligned: DNS points to the server, the certificate is issued for that domain, and mobile devices trust the public certificate authority. On a laptop hotspot, those assumptions disappear. Mobile devices may only know the laptop as an IP address, the certificate may only be trusted by the laptop itself, and the hotspot may not provide local DNS in the way you expect.

The field-server checklist

Before changing application code, walk through the environment as infrastructure. The goal is simple: every mobile device should open the same HTTPS hostname, see no certificate warning, load the service worker, and keep working after the internet connection disappears.

  • Pick one hostname: choose a name such as app.field.test, pwa.local.example.com, or another domain you can control and document.
  • Make mobile devices resolve that name: do not rely on the laptop browser's hosts file; iPads and Android devices need their own DNS answer.
  • Issue the certificate for the hostname: the certificate must include the exact hostname in its Subject Alternative Name, and optionally the hotspot IP if you also want IP access for diagnostics.
  • Trust the issuing CA on each device: mkcert is convenient, but its local root CA must be installed and explicitly trusted on the phones and tablets that will use the app.
  • Serve HTTPS consistently: redirect HTTP to HTTPS only after the HTTPS path is confirmed clean, or debugging becomes confusing.
  • Verify service-worker registration: use browser developer tools or remote debugging where possible, then confirm the app loads after toggling the uplink off.
  • Monitor the laptop like a server: track CPU load, disk space, service status, hotspot interface state, and certificate expiry so field failures are not surprises.

Option 1: local DNS on the hotspot

The most self-contained approach is to make the laptop provide DNS to the hotspot clients. Tools such as NetworkManager, dnsmasq, systemd-resolved, or a small travel-router-style setup can hand out an address for your chosen app hostname. The important point is that the mobile devices must ask a DNS server that knows the laptop's name.

This is where many setups stall. Adding a line to /etc/hosts on the laptop only helps the laptop. It does not teach an iPad or Android tablet that app.field.test should resolve to the hotspot address. You need DHCP/DNS settings, a local DNS forwarder, or a small router that gives the clients the right resolver.

After DNS is in place, test from the client device, not only from the server:

  1. Join the laptop hotspot.
  2. Open https://your-chosen-name from the mobile browser.
  3. Confirm the address bar shows no certificate warning.
  4. Check that the service worker is registered.
  5. Disconnect any upstream internet and reload the app.

Option 2: use a real domain with local resolution

If you own a domain, you can use a subdomain for the field app and make local DNS resolve it to the laptop while the hotspot is active. This keeps the hostname realistic and avoids training users to type a temporary test name. A certificate can be issued while the laptop is online and reused offline until it expires.

For environments that are often offline, DNS-01 certificate validation is especially useful because it proves domain control through DNS rather than requiring the laptop to be reachable from the public internet. Once issued, the certificate still has an expiry date, so your runbook should include renewal before field work. A stale certificate will break the same secure-origin requirement that caused the original problem.

Option 3: mkcert with mobile trust installed correctly

mkcert can work well for a controlled set of devices, but it is not magic. It creates a local certificate authority and certificates that are trusted only by devices where that CA has been installed and trusted. The laptop trusting the mkcert CA does not mean nearby mobile devices trust it.

For iOS and iPadOS, installing a profile is not always enough; the certificate authority also needs to be enabled for full trust in certificate settings. On Android, the exact flow varies by version and browser, and some managed devices restrict user-installed CAs. If this is for a business workflow, test the actual managed devices, not only a personal phone.

When generating the certificate, include every name the client might use. A cert for localhost will not validate for 192.168.4.1 or app.field.test. A cert for the IP address will not solve your clean-hostname goal unless the browser is actually visiting the IP address and the SAN includes that IP.

What to check when the service worker still refuses to install

If DNS and certificates look correct but offline still fails, check the PWA layer next. Start with the browser console and the service-worker registration result. Common causes include mixed content, a service-worker script served with the wrong MIME type, caching paths that assume the hosted domain, redirect loops, missing manifest assets, or a scope mismatch between the app path and the service-worker file.

  • Secure origin: no certificate warning and no mixed HTTP assets.
  • Correct scope: the service worker should control the pages you expect it to cache.
  • Cache list: make sure the offline shell, icons, CSS, JavaScript, and key routes are cached.
  • Network fallback: decide which requests should fail gracefully when the uplink is gone.
  • Storage limits: large assets or databases can run into mobile browser storage behavior.
  • Version updates: provide a way to refresh the cached app when the laptop reconnects later.

Add small-server monitoring before field use

A laptop hotspot that serves a PWA is still a production dependency during the event, shop visit, warehouse shift, or field job. Lightweight monitoring is enough, but skipping it leaves you blind. At minimum, record whether the web service is running, whether HTTPS responds on the chosen hostname, whether the hotspot interface is up, and whether disk space is available for browser sync data, logs, uploads, or local databases.

Weekly or pre-event infrastructure reporting is useful here because the failure modes are quiet until a user is standing in front of the device. Certificate expiry, a changed hotspot subnet, a disabled DNS service, full disk, or an accidentally stopped web server can all be caught before the laptop leaves the office. That is a better fit for a scheduled report than for someone remembering to stare at a dashboard every morning.

A practical rollout plan

  1. Choose the hostname: use a name you can explain and reuse.
  2. Configure hotspot DNS: prove that phones and tablets resolve the hostname to the laptop IP.
  3. Create the certificate: include the hostname in the SAN and use a CA the devices will trust.
  4. Install trust on real devices: verify the exact iPad, Android, or managed-device fleet you will use.
  5. Test HTTPS first: do not debug the service worker until the browser shows a clean secure connection.
  6. Test offline behavior: load the app, register the service worker, disconnect the uplink, then reload and complete a real workflow.
  7. Document renewal and startup: include certificate renewal, DNS service startup, hotspot commands, and rollback steps.
  8. Monitor the basics: add linux server monitoring for uptime, disk, CPU, service status, DNS response, and certificate expiry.

Bottom line

For an offline PWA on a Linux laptop, the winning pattern is not “use mkcert” or “use the IP address.” The winning pattern is a clean trusted origin that mobile devices can resolve and trust every time. Once that foundation is stable, the service worker can do its job, and your monitoring can catch the small infrastructure issues before they interrupt a field workflow.

Want weekly infrastructure health checks without dashboard fatigue?

DMCloud Architect sends Linux and MySQL infrastructure health reports directly to your inbox, so you can spot risks early without adding another monitoring dashboard to watch.

Get the free starter plan for weekly infrastructure health reports.

About the Author
Mariusz Antonik

Oracle Cloud Infrastructure expert and consultant specializing in database management and automation.

All Tags
#Advanced #alerts #amazon-linux-2023 #argo-cd #auditd #automation #backend-infrastructure #Bash #bash cpu monitoring script #bash monitoring #bash scripting #bash-scripts #Beginner #Best Practices #block volume backup #Capacity Planning #centos-ftp-migration #centralized-logging #cloud backup strategy #cloud-database-setup #cloud-networking #cloudflare-workers #compute #cpu bottleneck #CPU Monitoring #cpu monitoring linux #cpu monitoring script linux #cpu trends #cpu usage trends #cpu usage trends linux #cpu-monitoring-without-tools #cpu-performance-decline-server #cpu-performance-degradation-linux #cpu-usage-history-linux #create oracle db system in oci #cron #cron cpu monitoring #cron cpu monitoring linux #cron jobs #cron-monitoring #custom-linux-distribution #database #database monitoring #database performance #database-setup #detect slow queries mysql #devops #devops-checklist #devops-help #disk capacity planning server #disk forecasting linux #disk growth trend linux #Disk Monitoring #disk usage #disk usage script linux #disk usage trends #disk-capacity #disk-saturation-detection-linux #Early Detection #easy infrastructure monitoring #elasticsearch #field-server-checklist #firewall-rules #fleet-ops #free-tier #gitops-security #Guide #health dashboards #Health Reporting #historical server monitoring #how to monitor cpu usage linux #https-certificates #infrastructure #infrastructure health #infrastructure health dashboard #infrastructure health reporting #infrastructure monitoring #infrastructure monitoring report #infrastructure trends #infrastructure trends monitoring #Infrastructure Visibility #infrastructure-automation #infrastructure-checklist #interview-prep #ip-allowlist #journald #kubernetes-security #lightweight linux monitoring #lightweight monitoring #lightweight-monitoring-solution #linux #linux administration #linux cpu monitoring #linux cpu usage #linux disk capacity planning #linux disk usage #Linux monitoring #linux monitoring setup #linux monitoring tools #linux performance #linux performance monitoring #linux server #linux server monitoring #linux servers #linux storage #linux tools #linux-admin #linux-disk-monitoring #linux-hotspot #linux-monitoring-for-small-business #linux-networking #linux-performance-tuning #linux-remote-desktop #local-dns #log-management #log-retention #logrotate #loki #low maintenance monitoring #mkcert #monitor cpu usage over time linux #monitor linux server health #monitor server trends #monitor small production server #monitoring #monitoring without complexity #monitoring-without-devops-team #MySQL #mysql health reporting #MySQL monitoring #mysql optimization #MySQL Performance #mysql performance degradation #mysql performance monitoring #mysql performance trends #mysql query performance issues #mysql server monitoring #mysql slow queries #mysql slow query analysis #mysql slow query monitoring #mysql trends #mysql-health #mysql-heatwave #networking #networkpolicy #nsg #OCI #oci backup #oci bastion tutorial #oci block volume #oci infrastructure as code #OCI monitoring #oci networking #oci oracle database private subnet setup #oci oracle database tutorial #oci security #oci setup guide #oci terraform tutorial #oci tutorial for beginners #oci vcn terraform #oci virtual machine db system guide #oci-database #oci-mysql-heatwave #oci-mysql-heatwave-tutorial #oci-subnets #offline-pwa #oracle base database service tutorial #oracle cloud bastion #oracle cloud free tier tutorial #oracle cloud infrastructure step by step #oracle cloud infrastructure tutorial #oracle cloud storage #oracle database on oci setup #oracle-cloud #oracle-cloud-mysql-database-service #oracle-cloud-mysql-setup #oracle-cloud-vcn-setup #path-mtu-discovery #Performance #Performance Degradation #performance monitoring #performance trend monitoring #performance trends #plan disk growth server #practical server monitoring #predict disk usage growth #private instance access #query optimization #remote-workstation-security #rhel-tuned #rollback #route-tables #rsyslog #Security #security lists #selinux #server #server health #server health reporting #server health weekly report #server monitoring #Server Performance #server trend analysis #server-health-checklist #server-security #server-security-checklist #server-throughput #server-trends #servers #service-worker #simple cpu monitoring linux #simple linux monitoring #simple monitoring small business #simple monitoring system #simple ops monitoring #slow queries #slow query reporting mysql #small business infrastructure #small business IT #small business servers #small infrastructure monitoring #small server monitoring #small-business-tech #source-built-linux #ssh bastion #storage capacity planning linux #storage monitoring #subnets #sysadmin-checklist #sysadmin-lab #System Health #system health reporting #tcp-mtu-probing #tcp-tuning #terraform oci compute #terraform oracle cloud infrastructure #Trend Monitoring #trend-analysis #trends #tuned-adm #Tutorial #uptime-checks #uptime-monitoring #vcn #vcn-design #vector #vsftpd #weekly-server-report #xrdp