Skip to content

Server maintenance ​

This page is for the administrator. You won't need it day to day - the application updates itself from the dashboard. This is about the server everything runs on.

Updates come in three layers, from frequent and safe to rare. Backups come at the end.

Application - from the dashboard ​

The most frequent, and without SSH. Open Settings → System Update → Check for Updates, and if a new version is out - Update Now. The dashboard updates and reloads the page itself. See the "Settings" section for details.

No downtime

Only the application code changes - the database, settings, and license stay in place. The restart takes seconds.

Server software - one command ​

Every few months (usually for security). Connect over SSH and run:

bash
curl -fsSL https://install.pwahub.org/server-update.sh | sudo bash

The update runs without stopping your site - services keep responding throughout, and at the end the system verifies everything came back up. The command is safe to re-run.

Operating system ​

System packages and the kernel - via the standard tools. Over SSH as root:

bash
apt update && apt upgrade -y

Check whether a reboot is needed (only a kernel update calls for one - rarely):

bash
curl -fsSL https://install.pwahub.org/check-reboot.sh | sudo bash

If the script says a reboot is needed, reboot at a quiet time: reboot. The system comes back up on its own.

A reboot means 1-2 minutes of downtime

A full server reboot stops the site for a minute or two while the machine boots - longer than the short restart of an application update, but the principle is the same. Pause traffic to your PWAs (campaigns at your traffic sources) for that window, otherwise the clicks are wasted. Do the reboot during your lowest-traffic hours. The same rule applies to regular updates - see "Settings → System Update".

Keep it from piling up

Enable automatic security updates so critical patches install themselves:

bash
apt install -y unattended-upgrades && dpkg-reconfigure -plow unattended-upgrades

Backups ​

The system takes backups itself, every night, on the same server:

  • Database - at 03:00. A PostgreSQL dump of everything in the dashboard: apps, domains, users, settings, pushes, visits and conversions. The file pwa_<date>.sql.gz in /home/pwa/backups/postgresql/.
  • Storefront files - at 03:30. The archive pwa_config_<date>.tar.gz with the configs and images of every PWA, in /home/pwa/backups/pwa_config/.

The seven most recent copies of each kind are kept, older ones are deleted automatically (the number is set by BACKUP_POSTGRES_KEEP and BACKUP_PWA_KEEP in /opt/pwa/.env; after editing, run docker compose up -d in /opt/pwa). Analytics is not backed up separately: the statistics are rebuilt from the database automatically.

An off-schedule copy - before big changes, say - can be taken over SSH:

bash
cd /opt/pwa && docker compose exec core php artisan backup:postgres
cd /opt/pwa && docker compose exec core php artisan backup:pwa-config

The copies live on the same server

Lose the server and you lose them too. Regularly pull /home/pwa/backups to your machine or to cloud storage, and along with it /opt/pwa/.env (the stack's passwords and keys), the landing pages in /srv/pwa/whites and /opt/pwa/triggers (license files): the nightly copies don't include them.

bash
scp -r root@<server-ip>:/home/pwa/backups ./pwa-backups

Restoring is manual

The dump holds data only (INSERT statements), so it has to be loaded into a database of the same version with the structure already created and no starter records; the storefront archive is unpacked back into /srv/pwa/pwa_config. It is a rare administrator operation - if in doubt, contact the vendor before deleting anything.