Skip to content

Database

One SQLite file: /var/lib/wui/wui.db (with its -wal and -shm companions while the panel runs). It is the source of truth — the kernel state is rebuilt from it every two seconds — so a backup of this file is a backup of everything.

Tables

TableHolds
adminsthe administrator, a bcrypt hash, the 2FA secret
settingsevery panel setting as key / value (panel.*, sub.*, routing.*, engine.*, notify.*)
nodesthis panel and the ones it watches
interfacestunnels: keys, subnet, port, mode, AmneziaWG parameters, OpenVPN CA and server certificate
clientscustomers: quota, expiry, device limit, status, subscription token, Telegram id
accountsone row per customer device: key or credential, address, last handshake
account_endpointswhere each device was last seen from (sharing detection)
traffic_samplesusage history
ip_leasesaddress allocation
groups, hosts, outbounds, outbound_subs, balancers, routing_ruleswhat their pages show
api_tokenshashes of issued tokens

Looking inside

bash
apt install sqlite3
sqlite3 /var/lib/wui/wui.db '.tables'
sqlite3 -header /var/lib/wui/wui.db 'select id,name,status,quota_bytes,used_bytes from clients;'

Read freely. Write only with the panel stopped, and only if you know why — the panel will happily enforce whatever you put there.

Backups

Scheduled backups go to /var/backups/wui/ as wui-backup-<date>.tar.gz: the database copied by SQLite itself (VACUUM INTO), the OpenVPN directory, and the keys. Settings → General sets the schedule and how many to keep; Telegram can receive each one.

Restore: Overview → Backup → Restore, or w-ui → 25, or by hand:

bash
systemctl stop wui
tar xzf wui-backup-….tar.gz -C /
chown -R wui:wui /var/lib/wui
systemctl start wui

Moving to another server

Install on the new server, stop the panel there, restore a backup, start. Interfaces come up with the same keys and ports, so customers' configs keep working once DNS or the endpoint address points at the new machine.

PostgreSQL

WUI_DB_DRIVER=postgres and WUI_DB_SOURCE=<DSN> are accepted; SQLite is what the installer sets up and what is tested in CI.

Released under the AGPL-3.0 License.