↑ ↓ select, Enter open, Esc close

#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
cautionPlesk

Change the password of a Plesk mailbox

#plesk bin mail --update info@example.com -passwd 'NewSecurePassword'
cautionPlesk

Change the PHP version of a domain from the command line

#plesk bin domain --update example.com -php_handler_id plesk-php83-fpm
cautionPlesk

Check if Plesk is listening on ports 8443 and 8880

#ss -tlnp | grep -E ':(8443|8880)\b'
harmlessPlesk

Check the mail configuration in Plesk without changes

#plesk repair mail -n
harmlessPlesk

Check the Plesk database for inconsistencies

#plesk repair db -n
harmlessPlesk

Check the Plesk installation for errors without changes

#plesk repair all -n
harmlessPlesk

Check the Plesk installer log after a failed update

#tail -n 100 /var/log/plesk/install/autoinstaller3.log
harmlessPlesk

Check the status of the Plesk core services

#systemctl status sw-engine sw-cp-server psa --no-pager
harmlessPlesk

Check whether nginx is enabled in Plesk

#plesk sbin nginxmng --status
harmlessnginx

Count processes per user

$ps -eo user= | sort | uniq -c | sort -rn
harmlessProcesses

Create a domain alias in Plesk from the command line

#plesk bin domalias --create example.de -domain example.com
cautionPlesk

Create an email mailbox in Plesk from the command line

#plesk bin mail --create info@example.com -mailbox true -passwd 'NewSecurePassword'
cautionPlesk

Disk usage of all webspaces under /var/www/vhosts

#du -sh /var/www/vhosts/*/ 2>/dev/null | sort -rh | head -20
harmlessPlesk

Find files with the wrong owner in a webspace

#find /var/www/vhosts/example.com/httpdocs ! -user webuser -ls
harmlessPermissions and ownership

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
harmlessLogs

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"
harmlessPlesk

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
harmlessLogs

Fix file permissions and ownership with plesk repair

#plesk repair fs example.com -y
cautionPlesk

Follow the error log of a Plesk domain live

#tail -f /var/www/vhosts/system/example.com/logs/error_log
harmlessLogs

Follow the Plesk panel log in real time

#tail -f /var/log/plesk/panel.log
harmlessPlesk

Generate a one-time login link for Plesk

#plesk login
harmlessPlesk

Install a Plesk component from the command line

#plesk installer --select-product-id plesk --select-release-current --install-component php8.3
cautionPlesk

Install Plesk updates from the command line

#plesk installer update
cautionPlesk

List all customers in Plesk

#plesk bin customer --list
harmlessPlesk

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"
harmlessPlesk

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"
harmlessPlesk

List all domains on a Plesk server

#plesk bin domain --list
harmlessPlesk

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"
harmlessPlesk

List all installed Plesk PHP versions

$for p in /opt/plesk/php/*/bin/php; do echo "$p: $($p -r 'echo PHP_VERSION;')"; done
harmlessPHP

List all service plans in Plesk

#plesk bin service_plan --list
harmlessPlesk

List all subscriptions in Plesk

#plesk bin subscription --list
harmlessPlesk

List all WordPress installations in WP Toolkit

#plesk ext wp-toolkit --list
harmlessPlesk

List available PHP handlers in Plesk

#plesk bin php_handler --list
harmlessPlesk

List database servers registered in Plesk

#plesk db "SELECT id, host, port, type, admin_login FROM DatabaseServers"
harmlessPlesk

List installed Plesk extensions

#plesk bin extension --list
harmlessPlesk

List IP addresses registered in Plesk

#plesk bin ipmanage --ip_list
harmlessPlesk

List the SSL certificates of a domain in Plesk

#plesk bin certificate --list -domain example.com
harmlessPlesk

Mailbox disk usage per domain in Plesk

#du -sh /var/qmail/mailnames/*/ 2>/dev/null | sort -rh | head -20
harmlessPlesk

Open the MySQL console as Plesk admin

#plesk db
harmlessMySQL and MariaDB

Read hosting type and status of all domains from the Plesk database

#plesk db "SELECT name, htype, status FROM domains ORDER BY name"
harmlessPlesk

Regenerate the mail configuration in Plesk (mchk)

#plesk sbin mchk --with-spam
cautionMail

Regenerate the web server configuration of a domain

#plesk sbin httpdmng --reconfigure-domain example.com
cautionPlesk

Reload PHP-FPM for a Plesk PHP version

#systemctl reload plesk-php83-fpm
cautionPHP

Repair a domain's web server configuration with plesk repair

#plesk repair web example.com -y
cautionPlesk

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 {} +
cautionPermissions and ownership

Reset the Plesk admin password from the command line

#plesk bin admin --set-admin-password -passwd 'NewSecurePassword'
cautionPlesk

Restart the Plesk panel when the interface does not load

#systemctl restart sw-engine sw-cp-server
cautionPlesk

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
cautionPHP

Run WP-CLI as the Plesk subscription user instead of root

#runuser -u webuser -- wp plugin list --path=/var/www/vhosts/example.com/httpdocs
cautionWP-CLI

Show a domain's DNS zone in Plesk

#plesk bin dns --info example.com
harmlessDNS

Show all PHP-FPM services and their status

$systemctl list-units --type=service --all 'php*-fpm*' 'plesk-php*-fpm*'
harmlessPHP

Show custom Plesk settings in panel.ini

#cat /usr/local/psa/admin/conf/panel.ini
harmlessPlesk

Show details and disk usage of a Plesk subscription

#plesk bin subscription --info example.com
harmlessPlesk

Show details of a domain in Plesk

#plesk bin domain --info example.com
harmlessPlesk

Show installed and available Plesk components

#plesk installer --select-product-id plesk --select-release-current --show-components
harmlessPlesk

Show nginx errors of a Plesk domain (502, 504)

#tail -n 50 /var/www/vhosts/system/example.com/logs/proxy_error_log
harmlessPlesk

Show the additional nginx directives of a Plesk domain

#cat /var/www/vhosts/system/example.com/conf/vhost_nginx.conf
harmlessnginx

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
harmlessCron

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"
harmlessPlesk

Show the error log of the Plesk panel web server sw-cp-server

#tail -n 50 /var/log/sw-cp-server/error_log
harmlessPlesk

Show the installed Plesk version

#plesk version
harmlessPlesk

Show the nginx configuration Plesk generated for a domain

#cat /var/www/vhosts/system/example.com/conf/nginx.conf
harmlessnginx

Show the Plesk license and expiration date

#plesk bin keyinfo --list
harmlessPlesk

Show the Web Application Firewall (ModSecurity) status in Plesk

#plesk bin server_pref --show-web-app-firewall
harmlessPlesk

Show the WP-CLI version and the PHP it uses

$wp --info
harmlessWP-CLI

Suspend a subscription in Plesk

#plesk bin subscription --suspend example.com
cautionPlesk

Use the Plesk MySQL admin in scripts and one-liners

#MYSQL_PWD=$(cat /etc/psa/.psa.shadow) mysql -u admin -e 'SHOW DATABASES;'
cautionMySQL and MariaDB

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.