#plesk
68 one-liners with this tag.
All one-liners tagged plesk
Back up a single domain with Plesk tools
#plesk bin pleskbackup --domains-name example.com --output-file=/root/backup-example.com.tar
Change the password of a Plesk mailbox
#plesk bin mail --update info@example.com -passwd 'NewSecurePassword'
Change the PHP version of a domain from the command line
#plesk bin domain --update example.com -php_handler_id plesk-php83-fpm
Check if Plesk is listening on ports 8443 and 8880
#ss -tlnp | grep -E ':(8443|8880)\b'
Check the mail configuration in Plesk without changes
#plesk repair mail -n
Check the Plesk database for inconsistencies
#plesk repair db -n
Check the Plesk installation for errors without changes
#plesk repair all -n
Check the Plesk installer log after a failed update
#tail -n 100 /var/log/plesk/install/autoinstaller3.log
Check the status of the Plesk core services
#systemctl status sw-engine sw-cp-server psa --no-pager
Check whether nginx is enabled in Plesk
#plesk sbin nginxmng --status
Count processes per user
$ps -eo user= | sort | uniq -c | sort -rn
Create a domain alias in Plesk from the command line
#plesk bin domalias --create example.de -domain example.com
Create an email mailbox in Plesk from the command line
#plesk bin mail --create info@example.com -mailbox true -passwd 'NewSecurePassword'
Disk usage of all webspaces under /var/www/vhosts
#du -sh /var/www/vhosts/*/ 2>/dev/null | sort -rh | head -20
Find files with the wrong owner in a webspace
#find /var/www/vhosts/example.com/httpdocs ! -user webuser -ls
Find the domains with the most requests on Plesk
#wc -l /var/www/vhosts/system/*/logs/access_ssl_log 2>/dev/null | sort -rn | head -20
Find the system user of each domain in Plesk
#plesk db "SELECT d.name, s.login FROM domains d JOIN hosting h ON h.dom_id = d.id JOIN sys_users s ON s.id = h.sys_user_id ORDER BY d.name"
Find the top IP addresses in the access log
#awk '{print $1}' /var/www/vhosts/system/example.com/logs/access_ssl_log | sort | uniq -c | sort -rn | head -20
Fix file permissions and ownership with plesk repair
#plesk repair fs example.com -y
Follow the error log of a Plesk domain live
#tail -f /var/www/vhosts/system/example.com/logs/error_log
Follow the Plesk panel log in real time
#tail -f /var/log/plesk/panel.log
Generate a one-time login link for Plesk
#plesk login
Install a Plesk component from the command line
#plesk installer --select-product-id plesk --select-release-current --install-component php8.3
Install Plesk updates from the command line
#plesk installer update
List all customers in Plesk
#plesk bin customer --list
List all databases with their domain in Plesk
#plesk db "SELECT d.name AS domain, db.name AS datenbank, db.type FROM data_bases db JOIN domains d ON d.id = db.dom_id ORDER BY d.name, db.name"
List all domains of a Plesk subscription
#plesk db "SELECT d.name FROM domains d LEFT JOIN domains p ON p.id = d.webspace_id WHERE d.name = 'example.com' OR p.name = 'example.com' ORDER BY d.name"
List all domains on a Plesk server
#plesk bin domain --list
List all email addresses on a Plesk server
#plesk db "SELECT CONCAT(m.mail_name, '@', d.name) AS adresse, m.postbox FROM mail m JOIN domains d ON d.id = m.dom_id ORDER BY d.name, m.mail_name"
List all installed Plesk PHP versions
$for p in /opt/plesk/php/*/bin/php; do echo "$p: $($p -r 'echo PHP_VERSION;')"; done
List all service plans in Plesk
#plesk bin service_plan --list
List all subscriptions in Plesk
#plesk bin subscription --list
List all WordPress installations in WP Toolkit
#plesk ext wp-toolkit --list
List available PHP handlers in Plesk
#plesk bin php_handler --list
List database servers registered in Plesk
#plesk db "SELECT id, host, port, type, admin_login FROM DatabaseServers"
List installed Plesk extensions
#plesk bin extension --list
List IP addresses registered in Plesk
#plesk bin ipmanage --ip_list
List the SSL certificates of a domain in Plesk
#plesk bin certificate --list -domain example.com
Mailbox disk usage per domain in Plesk
#du -sh /var/qmail/mailnames/*/ 2>/dev/null | sort -rh | head -20
Open the MySQL console as Plesk admin
#plesk db
Read hosting type and status of all domains from the Plesk database
#plesk db "SELECT name, htype, status FROM domains ORDER BY name"
Regenerate the mail configuration in Plesk (mchk)
#plesk sbin mchk --with-spam
Regenerate the web server configuration of a domain
#plesk sbin httpdmng --reconfigure-domain example.com
Reload PHP-FPM for a Plesk PHP version
#systemctl reload plesk-php83-fpm
Repair a domain's web server configuration with plesk repair
#plesk repair web example.com -y
Reset file ownership in a Plesk webspace to the subscription user
#find /var/www/vhosts/example.com/httpdocs -mindepth 1 -exec chown -h webuser:psacln {} +
Reset the Plesk admin password from the command line
#plesk bin admin --set-admin-password -passwd 'NewSecurePassword'
Restart the Plesk panel when the interface does not load
#systemctl restart sw-engine sw-cp-server
Run a PHP script with a specific Plesk PHP version
$/opt/plesk/php/8.3/bin/php /var/www/vhosts/example.com/httpdocs/cron.php
Run WP-CLI as the Plesk subscription user instead of root
#runuser -u webuser -- wp plugin list --path=/var/www/vhosts/example.com/httpdocs
Show a domain's DNS zone in Plesk
#plesk bin dns --info example.com
Show all PHP-FPM services and their status
$systemctl list-units --type=service --all 'php*-fpm*' 'plesk-php*-fpm*'
Show custom Plesk settings in panel.ini
#cat /usr/local/psa/admin/conf/panel.ini
Show details and disk usage of a Plesk subscription
#plesk bin subscription --info example.com
Show details of a domain in Plesk
#plesk bin domain --info example.com
Show installed and available Plesk components
#plesk installer --select-product-id plesk --select-release-current --show-components
Show nginx errors of a Plesk domain (502, 504)
#tail -n 50 /var/www/vhosts/system/example.com/logs/proxy_error_log
Show the additional nginx directives of a Plesk domain
#cat /var/www/vhosts/system/example.com/conf/vhost_nginx.conf
Show the crontabs of all users at once
#for u in $(cut -d: -f1 /etc/passwd); do crontab -l -u "$u" 2>/dev/null | grep -vE '^(#|$)' | sed "s/^/$u: /"; done
Show the document root of all domains in Plesk
#plesk db "SELECT d.name, h.www_root FROM domains d JOIN hosting h ON h.dom_id = d.id ORDER BY d.name"
Show the error log of the Plesk panel web server sw-cp-server
#tail -n 50 /var/log/sw-cp-server/error_log
Show the installed Plesk version
#plesk version
Show the nginx configuration Plesk generated for a domain
#cat /var/www/vhosts/system/example.com/conf/nginx.conf
Show the Plesk license and expiration date
#plesk bin keyinfo --list
Show the Web Application Firewall (ModSecurity) status in Plesk
#plesk bin server_pref --show-web-app-firewall
Show the WP-CLI version and the PHP it uses
$wp --info
Suspend a subscription in Plesk
#plesk bin subscription --suspend example.com
Use the Plesk MySQL admin in scripts and one-liners
#MYSQL_PWD=$(cat /etc/psa/.psa.shadow) mysql -u admin -e 'SHOW DATABASES;'