-
-
Notifications
You must be signed in to change notification settings - Fork 26
CLI config
This page covers the config:* and database:* command namespaces. Together they let you install Panopticon, set it up, and keep its own database backed up — all from the command line.
For a general introduction to the CLI, see CLI Reference. For the full installation walkthrough, see CLI setup.
Creates the config.php file that Panopticon needs to start. This is the first command you run during a headless installation — without config.php the application won't do anything at all.
All it does is write the database connection parameters to disk. It does not create any database tables; that's database:update's job.
| Option | Default | Description |
|---|---|---|
--driver |
mysqli |
Database driver. Use mysqli (the PHP mysqli/mysqlnd extension) or pdomysql (the PHP pdo extension). PDO MySQL is the more modern driver; prefer it unless your server only has mysqli. |
--host |
localhost |
Hostname or IP address of the database server. |
--port |
3306 |
Only needed when the server listens on a non-standard port. |
--user |
— | Database username. Required. |
--password |
— | Database password. Required. |
--name |
— | Database name. Required. |
--prefix |
ak_ |
Table name prefix. Must be one to five lowercase alphanumeric characters followed by an underscore. Has no functional significance — it just lets Panopticon share a database with other software without table name conflicts. |
--encryption |
— | SSL/TLS connection encryption flag. Only needed for encrypted database connections. |
--sslca |
— | Path to the SSL CA certificate file. |
--sslkey |
— | Path to the SSL client key file. |
--sslcert |
— | Path to the SSL client certificate file. |
--sslverifyservercert |
— | Whether to verify the server certificate when using SSL. |
Basic installation:
php cli/panopticon.php config:create \
--driver pdomysql \
--host 127.0.0.1 \
--user panopticon \
--password "s3cr3t" \
--name panopticon_db \
--prefix pnp_Non-standard database port:
php cli/panopticon.php config:create \
--host db.internal \
--port 3307 \
--user panopticon \
--password "s3cr3t" \
--name panopticon_dbReads a single configuration value and prints it to stdout. This is useful for checking what's currently set before you change it, or for extracting values in a deployment script.
php cli/panopticon.php config:get timezone
php cli/panopticon.php config:get max_execution --format jsonLists all system configuration variables with their current values and descriptions. Gives you a complete overview of everything that's configurable, which is handy before making changes or when you want to snapshot the current state.
php cli/panopticon.php config:list
php cli/panopticon.php config:list --format json > config-snapshot.jsonSets a configuration value. Together with config:get and config:list, this gives you full control over Panopticon's system configuration from the command line. You don't need web access to configure the application — everything the web UI's System Configuration page can do, these three commands can do too.
This is particularly useful in Ansible playbooks and similar tools, where you want to lay down a known configuration after deployment.
Some values you're likely to set:
# Set the server's timezone
php cli/panopticon.php config:set timezone "Europe/Athens"
# Set the maximum CRON execution time (see config:maxtime:test)
php cli/panopticon.php config:set max_execution 180
# Unlock the web interface after CLI setup is complete
php cli/panopticon.php config:set finished_setup true
# Database backup settings
php cli/panopticon.php config:set dbbackup_auto true
php cli/panopticon.php config:set dbbackup_compress true
php cli/panopticon.php config:set dbbackup_maxfiles 30For the full list of configurable keys and what they do, see Configuration parameters or run config:list.
Detects how long the server will allow a PHP CLI process to run before cutting it off. Run this once after installation, then feed the result to config:set max_execution.
php cli/panopticon.php config:maxtime:testThe CLI setup guide covers this step in context. In short: the number this command reports is your server's actual limit; setting max_execution to that value tells Panopticon's task runner how long it can safely stay alive in a single CRON invocation.
Reinstalls the built-in system tasks with their default settings. System tasks are the background jobs that Panopticon runs for itself: log rotation, database backup, uptime monitoring checks, self-update detection, and others.
You'd normally only need this if a system task was accidentally deleted through the Tasks UI, or if you're restoring from a database backup that was missing some tasks.
php cli/panopticon.php config:tasks:installRunning it when all tasks already exist is safe — it won't duplicate them.
Creates the database tables, or updates them to match the current schema. Run this once during installation (after config:create), and again after each Panopticon upgrade.
The command is idempotent: running it on a database that's already up to date makes no changes and causes no harm.
php cli/panopticon.php database:updateThe --drop option drops all existing Panopticon tables before recreating them from scratch. This destroys all your data. Only use it when rebuilding a development or test environment, or when you genuinely want to start over from zero.
# DESTRUCTIVE — only for dev/test environments
php cli/panopticon.php database:update --dropCreates an SQL dump of Panopticon's own database. This backs up Panopticon itself — its site list, configuration, task schedules, user accounts, and everything else stored in the database. It does not back up the sites you manage with Panopticon; for that, see Backup Management.
The output is a plain SQL file (optionally gzip-compressed) that you can import into a fresh Panopticon installation to restore your configuration.
By default, the file is saved to cache/db_backups/backup-YYYY-MM-DD-HHmmss.sql. You can specify a different path as the first argument.
# Save to the default location
php cli/panopticon.php database:backup
# Save to a specific path
php cli/panopticon.php database:backup /var/backups/panopticon-$(date +%F).sql
# Force compressed output (overrides the global dbbackup_compress setting for this run)
php cli/panopticon.php database:backup --compress
# Force uncompressed output
php cli/panopticon.php database:backup --no-compressThe command pauses all Panopticon task processing while the dump runs, then resumes it on completion. This prevents background workers from writing to the database mid-dump, which could produce an inconsistent backup.
Panopticon already takes a daily automatic backup if dbbackup_auto is enabled (it is, by default). Use database:backup directly when you need a backup at a different time, a different location, or as part of a larger automation pipeline — for example, to take an off-site backup:
# In system crontab — take a daily backup and upload to S3
0 2 * * * php /path/to/panopticon/cli/panopticon.php database:backup /tmp/panopticon-backup.sql \
&& aws s3 cp /tmp/panopticon-backup.sql s3://my-bucket/panopticon/ \
&& rm /tmp/panopticon-backup.sqlTo restore a backup, import the SQL file into a fresh database (using mysql, phpMyAdmin, or similar) and point a new Panopticon installation at it with config:create and database:update. See Database Backups for the full restore procedure.
Documentation Copyright ©2023–2025 Akeeba Ltd.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
You can also obtain a copy of the GNU Free Documentation License from the Free Software Foundation
- Overview pages
- Working with sites
- Site Overview
- Backup Management with Akeeba Backup Pro
- Security Management with Admin Tools Pro
- Core File Integrity Check
- Scheduled Update Summary
- Scheduled Action Summary
- Backup Tasks
- Scanner Tasks
- System Configuration
- Managing Sites
- Mail templates
- Web Push Notifications
- Legal Policies
- Users and Groups
- Tasks
- Log files
- Update Panopticon
- Database Backups
- Fixing your session save path
- The .htaccess file
- Advanced Customisation (user code)
- Plugins
- Custom CSS
- Custom Templates
- Advanced Permissions
- .env For Configuration
- API Overview
- Sites endpoints
- Stats & Site Status endpoints
- System configuration endpoints
- Tasks endpoints
- Self-update endpoints