Cookie Consent by Free Privacy Policy Generator

My ultimate list of Plesk SSH Commands

Ultimate Plesk SSH Commands Reference​


A comprehensive list of Plesk CLI commands for server administration.



Table of Contents​

  1. Plesk Service Management
  2. Domain & Subscription Management
  3. Customer & Reseller Management
  4. DNS Management
  5. SSL/TLS Certificates
  6. Apache Configuration
  7. Nginx Configuration
  8. Database Management
  9. Mail Management
  10. Backup & Restore
  11. Security & Firewall
  12. Updates & Maintenance
  13. Logs & Troubleshooting
  14. PHP Management
  15. FTP Management
  16. Server Information



Plesk Service Management​


Bash:
# Start Plesk services
systemctl start psa

# Stop Plesk services
systemctl stop psa

# Restart Plesk services
systemctl restart psa

# Check Plesk service status
systemctl status psa

# Start all Plesk-related services
plesk repair all -start-services

# Restart Plesk web interface
systemctl restart sw-cp-server

# Restart Plesk backend
systemctl restart psa

# Check Plesk version
plesk version

# View Plesk license info
plesk bin license --info

# Install Plesk license key
plesk bin license --install <license-key>

# Update Plesk license from server
plesk bin license --update



Domain & Subscription Management​


Bash:
# List all domains
plesk bin domain --list

# List domains with detailed info
plesk bin domain --list --all

# Get info about specific domain
plesk bin domain --info example.com

# Create new domain/subscription
plesk bin subscription --create example.com -owner admin -service-plan "Default Domain" -ip 192.168.1.1 -login admin -passwd "SecurePass123"

# Create addon domain
plesk bin domain --create addon.example.com -webspace-name example.com

# Create subdomain
plesk bin subdomain --create sub -domain example.com -www-root /httpdocs/sub

# Delete domain
plesk bin domain --remove example.com

# Suspend domain
plesk bin domain --update example.com -status disabled

# Activate domain
plesk bin domain --update example.com -status enabled

# Change domain IP address
plesk bin domain --update example.com -ip 192.168.1.2

# Update domain hosting settings
plesk bin domain --update example.com -hosting true -hst_type phys

# Set document root
plesk bin domain --update example.com -www-root /httpdocs

# Enable/disable www prefix
plesk bin domain --update example.com -www true

# List all subscriptions
plesk bin subscription --list

# Get subscription info
plesk bin subscription --info example.com

# Delete subscription
plesk bin subscription --remove example.com

# Change subscription owner
plesk bin subscription --update example.com -owner newowner

# Set hosting type to physical
plesk bin domain --update example.com -hst_type phys

# Set hosting type to forwarding
plesk bin domain --update example.com -hst_type std_fwd -forward-url "https://target.com"



Customer & Reseller Management​


Bash:
# List all customers
plesk bin customer --list

# Get customer info
plesk bin customer --info customer_login

# Create customer
plesk bin customer --create customer_login -name "John Doe" -email [email protected] -passwd "SecurePass123"

# Update customer info
plesk bin customer --update customer_login -name "Jane Doe" -email [email protected]

# Delete customer
plesk bin customer --remove customer_login

# Suspend customer
plesk bin customer --update customer_login -status disabled

# Activate customer
plesk bin customer --update customer_login -status enabled

# List all resellers
plesk bin reseller --list

# Create reseller
plesk bin reseller --create reseller_login -name "Reseller Name" -email [email protected] -passwd "SecurePass123"

# Get reseller info
plesk bin reseller --info reseller_login

# Update reseller
plesk bin reseller --update reseller_login -name "New Name"

# Delete reseller
plesk bin reseller --remove reseller_login

# Assign customer to reseller
plesk bin customer --update customer_login -owner reseller_login



DNS Management​


Bash:
# List DNS records for domain
plesk bin dns --info example.com

# Add A record
plesk bin dns --add example.com -a sub -ip 192.168.1.1

# Add AAAA record (IPv6)
plesk bin dns --add example.com -aaaa sub -ip 2001:db8::1

# Add CNAME record
plesk bin dns --add example.com -cname alias -canonical target.example.com.

# Add MX record
plesk bin dns --add example.com -mx "" -mail mail.example.com. -priority 10

# Add TXT record
plesk bin dns --add example.com -txt "" -value "v=spf1 +a +mx -all"

# Add TXT record for subdomain
plesk bin dns --add example.com -txt _dmarc -value "v=DMARC1; p=none"

# Add SRV record
plesk bin dns --add example.com -srv _service._tcp -target target.example.com. -port 443 -priority 10 -weight 5

# Add NS record
plesk bin dns --add example.com -ns "" -nameserver ns1.example.com.

# Add CAA record
plesk bin dns --add example.com -caa "" -flag 0 -tag issue -value "letsencrypt.org"

# Delete DNS record
plesk bin dns --del example.com -a sub

# Delete specific record by ID
plesk bin dns --del example.com -id 12345

# Update SOA record
plesk bin dns --update_soa example.com -email [email protected] -refresh 10800 -retry 3600 -expire 604800 -minimum 10800

# Enable DNS for domain
plesk bin domain --update example.com -dns true

# Disable DNS for domain
plesk bin domain --update example.com -dns false

# Set as DNS slave
plesk bin dns --set-slave example.com -master-ip 192.168.1.1

# Set as DNS master
plesk bin dns --set-master example.com

# Sync DNS zone
plesk bin dns --sync example.com

# Export DNS zone
plesk bin dns --export example.com



SSL/TLS Certificates​


Bash:
# List SSL certificates for domain
plesk bin certificate --list -domain example.com

# Install Let's Encrypt certificate
plesk bin extension --exec letsencrypt cli.php -d example.com -m [email protected]

# Install Let's Encrypt wildcard certificate
plesk bin extension --exec letsencrypt cli.php -d example.com -d *.example.com -m [email protected]

# Install Let's Encrypt with www
plesk bin extension --exec letsencrypt cli.php -d example.com -d www.example.com -m [email protected]

# Renew Let's Encrypt certificates
plesk bin extension --exec letsencrypt cli.php --renew

# Renew specific domain certificate
plesk bin extension --exec letsencrypt cli.php -d example.com --renew

# Generate self-signed certificate
plesk bin certificate --create selfsigned -domain example.com -country US -state California -city "Los Angeles" -company "My Company" -email [email protected] -bits 2048

# Import certificate from files
plesk bin certificate --create imported -domain example.com -cert-file /path/to/cert.crt -key-file /path/to/key.key

# Import with CA bundle
plesk bin certificate --create imported -domain example.com -cert-file /path/to/cert.crt -key-file /path/to/key.key -cacert-file /path/to/ca-bundle.crt

# Assign certificate to domain
plesk bin domain --update example.com -ssl true -certificate-name "certname"

# Enable SSL redirect
plesk bin domain --update example.com -ssl-redirect true

# Disable SSL redirect
plesk bin domain --update example.com -ssl-redirect false

# Delete certificate
plesk bin certificate --remove certname -domain example.com

# Get certificate info
plesk bin certificate --info certname -domain example.com

# Assign certificate to mail
plesk bin domain --update example.com -mail-certificate-name "certname"

# Enable HSTS
plesk bin domain --update example.com -hsts true

# Disable HSTS
plesk bin domain --update example.com -hsts false

# Set HSTS max-age
plesk bin domain --update example.com -hsts-max-age 31536000

# Enable OCSP stapling
plesk bin domain --update example.com -ocsp-stapling true

# Secure Plesk panel with Let's Encrypt
plesk bin extension --exec letsencrypt cli.php -d $(hostname) --secure-plesk



Apache Configuration​


Bash:
# Restart Apache
systemctl restart httpd          # CentOS/RHEL
systemctl restart apache2        # Debian/Ubuntu

# Check Apache status
systemctl status httpd
systemctl status apache2

# Test Apache configuration
apachectl configtest
apache2ctl configtest

# View Apache error log
tail -f /var/log/httpd/error_log          # CentOS/RHEL
tail -f /var/log/apache2/error.log        # Debian/Ubuntu

# View domain-specific Apache error log
tail -f /var/www/vhosts/example.com/logs/error_log

# View Apache access log
tail -f /var/log/httpd/access_log
tail -f /var/log/apache2/access.log

# Reconfigure Apache for domain
plesk bin domain --reconfigure example.com

# Enable Apache for domain
plesk bin domain --update example.com -apache true

# Disable Apache (Nginx only)
plesk bin domain --update example.com -apache false

# Set Apache version (if multiple installed)
plesk bin domain --update example.com -apache-version 2.4

# Enable mod_rewrite
plesk bin domain --update example.com -mod-rewrite true

# Custom Apache directives (via Plesk)
plesk bin domain --update example.com -apache-directives "DirectoryIndex index.php"

# View Apache vhost configuration
cat /var/www/vhosts/system/example.com/conf/vhost.conf

# Rebuild Apache configuration
plesk bin httpdmng --reconfigure-all

# Rebuild specific domain Apache config
plesk bin httpdmng --reconfigure-domain example.com

# Enable proxy mode
plesk bin domain --update example.com -proxy-mode true

# Disable proxy mode (serve static via nginx)
plesk bin domain --update example.com -proxy-mode false

# Set Apache handler
plesk bin domain --update example.com -handler cgi



Nginx Configuration​


Bash:
# Restart Nginx
systemctl restart nginx

# Check Nginx status
systemctl status nginx

# Test Nginx configuration
nginx -t

# Reload Nginx (graceful)
systemctl reload nginx

# View Nginx error log
tail -f /var/log/nginx/error.log

# View domain Nginx error log
tail -f /var/www/vhosts/example.com/logs/proxy_error_log

# View Nginx access log
tail -f /var/log/nginx/access.log

# Enable Nginx for domain
plesk bin domain --update example.com -nginx true

# Disable Nginx for domain
plesk bin domain --update example.com -nginx false

# Enable Nginx caching
plesk bin domain --update example.com -nginx-cache true

# Disable Nginx caching
plesk bin domain --update example.com -nginx-cache false

# Set Nginx cache timeout
plesk bin domain --update example.com -nginx-cache-timeout 60

# Enable gzip compression
plesk bin domain --update example.com -nginx-gzip true

# Disable gzip compression
plesk bin domain --update example.com -nginx-gzip false

# Custom Nginx directives
plesk bin domain --update example.com -nginx-directives "client_max_body_size 100m;"

# View Nginx vhost configuration
cat /var/www/vhosts/system/example.com/conf/vhost_nginx.conf

# Rebuild Nginx configuration
plesk bin httpdmng --reconfigure-all

# Enable smart static serving
plesk bin domain --update example.com -nginx-static true

# Disable smart static serving
plesk bin domain --update example.com -nginx-static false

# Set Nginx as reverse proxy only
plesk bin domain --update example.com -nginx-proxy-mode true

# Enable HTTP/2
plesk bin domain --update example.com -http2 true

# Disable HTTP/2
plesk bin domain --update example.com -http2 false



Database Management​


Bash:
# List databases for domain
plesk bin database --list -domain example.com

# List all databases
plesk bin database --list

# Create database
plesk bin database --create db_name -domain example.com -type mysql

# Create PostgreSQL database
plesk bin database --create db_name -domain example.com -type postgresql

# Delete database
plesk bin database --remove db_name -domain example.com

# Get database info
plesk bin database --info db_name -domain example.com

# Create database user
plesk bin database --create-dbuser dbuser -passwd "SecurePass123" -database db_name -domain example.com

# Update database user password
plesk bin database --update-dbuser dbuser -passwd "NewPass123" -domain example.com

# Delete database user
plesk bin database --remove-dbuser dbuser -domain example.com

# Grant all privileges to user
plesk bin database --update-dbuser dbuser -domain example.com -privileges all

# Import database from file
plesk bin database --import db_name -domain example.com -file /path/to/dump.sql

# Export database to file
plesk bin database --export db_name -domain example.com -file /path/to/backup.sql

# Restart MySQL/MariaDB
systemctl restart mariadb
systemctl restart mysql

# Check MySQL status
systemctl status mariadb
systemctl status mysql

# Restart PostgreSQL
systemctl restart postgresql

# Access MySQL CLI as admin
plesk db

# Access specific database
plesk db db_name

# List database servers
plesk bin database-server --list

# Get database server info
plesk bin database-server --info local-mysql

# Update database server password
plesk bin database-server --update local-mysql -passwd "NewRootPass"

# Repair MySQL database
plesk bin repair --mysql

# Set default MySQL server
plesk bin database-server --set-default local-mysql -type mysql



Mail Management​


Bash:
# List mailboxes for domain
plesk bin mail --list example.com

# Create mailbox
plesk bin mail --create [email protected] -passwd "SecurePass123" -mailbox true

# Delete mailbox
plesk bin mail --remove [email protected]

# Update mailbox password
plesk bin mail --update [email protected] -passwd "NewPass123"

# Set mailbox quota (MB)
plesk bin mail --update [email protected] -mbox-quota 500

# Unlimited mailbox quota
plesk bin mail --update [email protected] -mbox-quota unlimited

# Enable mailbox
plesk bin mail --update [email protected] -mailbox true

# Disable mailbox (keep forwarding)
plesk bin mail --update [email protected] -mailbox false

# Create mail alias
plesk bin mail --create [email protected] -alias-to [email protected]

# Create mail forwarding
plesk bin mail --update [email protected] -forwarding true -forwarding-addresses "[email protected]"

# Disable forwarding
plesk bin mail --update [email protected] -forwarding false

# Enable autoresponder
plesk bin mail --update [email protected] -autoresponder true -autoresponder-text "I am out of office"

# Disable autoresponder
plesk bin mail --update [email protected] -autoresponder false

# Enable spam filter
plesk bin mail --update [email protected] -spamfilter true

# Disable spam filter
plesk bin mail --update [email protected] -spamfilter false

# Set spam filter sensitivity
plesk bin mail --update [email protected] -spam-action move -spam-hits 5

# Enable antivirus
plesk bin mail --update [email protected] -antivirus true

# Restart mail services
systemctl restart postfix
systemctl restart dovecot

# Check Postfix status
systemctl status postfix

# Check Dovecot status
systemctl status dovecot

# View mail queue
postqueue -p

# Flush mail queue
postqueue -f

# Delete all queued mail
postsuper -d ALL

# View mail log
tail -f /var/log/maillog

# Enable DKIM for domain
plesk bin domain --update example.com -dkim true

# Disable DKIM for domain
plesk bin domain --update example.com -dkim false

# Enable SPF for domain
plesk bin domain --update example.com -spf true

# Enable DMARC for domain
plesk bin domain --update example.com -dmarc-policy none

# Get DKIM public key
plesk bin domain --info example.com | grep dkim

# Enable mail for domain
plesk bin domain --update example.com -mail true

# Disable mail for domain
plesk bin domain --update example.com -mail false

# Set catch-all address
plesk bin domain --update example.com -catchall [email protected]

# Disable catch-all
plesk bin domain --update example.com -catchall reject



Backup & Restore​


Bash:
# Create full server backup
plesk bin pleskbackup server -output-file /backup/server_backup.tar

# Create backup of single domain
plesk bin pleskbackup domains-name example.com -output-file /backup/example_backup.tar

# Create backup with specific content
plesk bin pleskbackup domains-name example.com -output-file /backup/backup.tar -config -only-mail -only-hosting

# Create backup excluding mail
plesk bin pleskbackup domains-name example.com -output-file /backup/backup.tar -no-mail

# Create backup excluding databases
plesk bin pleskbackup domains-name example.com -output-file /backup/backup.tar -no-databases

# Create incremental backup
plesk bin pleskbackup domains-name example.com -output-file /backup/backup.tar -incremental

# Create backup of customer
plesk bin pleskbackup clients-name customer_login -output-file /backup/customer_backup.tar

# Create backup of reseller
plesk bin pleskbackup resellers-name reseller_login -output-file /backup/reseller_backup.tar

# Restore full server backup
plesk bin pleskrestore --restore /backup/server_backup.tar -level server

# Restore domain from backup
plesk bin pleskrestore --restore /backup/example_backup.tar -level domains -domain-name example.com

# Restore specific content only
plesk bin pleskrestore --restore /backup/backup.tar -level domains -domain-name example.com -only-hosting -only-mail

# Restore to different domain
plesk bin pleskrestore --restore /backup/backup.tar -level domains -domain-name example.com -new-domain-name newexample.com

# List contents of backup
plesk bin pleskrestore --info /backup/backup.tar

# Create backup to FTP
plesk bin pleskbackup domains-name example.com -ftp-login ftpuser -ftp-password "pass" -ftp-host ftp.backup.com -ftp-path /backups

# Schedule backup
plesk bin server_settings --set-backup-period daily

# Set backup storage
plesk bin server_settings --set-backup-storage /backup/storage

# Delete old backups
find /backup -name "*.tar" -mtime +30 -delete



Security & Firewall​


Bash:
# Enable Plesk firewall
plesk bin firewall --enable

# Disable Plesk firewall
plesk bin firewall --disable

# List firewall rules
plesk bin firewall --list

# Add firewall rule (allow IP)
plesk bin firewall --add-rule "Allow SSH" -direction in -port 22 -protocol tcp -remote-ip 192.168.1.0/24 -action allow

# Block IP address
plesk bin firewall --add-rule "Block IP" -direction in -remote-ip 10.0.0.5 -action deny

# Remove firewall rule
plesk bin firewall --remove-rule "Rule Name"

# Enable Fail2Ban
plesk bin ip_ban --enable

# Disable Fail2Ban
plesk bin ip_ban --disable

# List banned IPs
plesk bin ip_ban --list-banned

# Ban IP address manually
plesk bin ip_ban --add-ban 10.0.0.5

# Unban IP address
plesk bin ip_ban --remove-ban 10.0.0.5

# Add IP to whitelist
plesk bin ip_ban --add-trusted 192.168.1.100

# Remove IP from whitelist
plesk bin ip_ban --remove-trusted 192.168.1.100

# Set ban period (seconds)
plesk bin ip_ban --ban-period 3600

# Set max retries before ban
plesk bin ip_ban --max-retries 5

# Enable ModSecurity (WAF)
plesk bin extension --install modsecurity

# Set ModSecurity mode
plesk bin domain --update example.com -waf-mode on
plesk bin domain --update example.com -waf-mode detection
plesk bin domain --update example.com -waf-mode off

# Update ModSecurity rules
plesk bin modsecurity --update-rules

# Reset admin password
plesk bin admin --set-password -passwd "NewAdminPass123"

# Generate new admin password
plesk bin admin --set-password

# Restrict admin access by IP
plesk bin ip_ban --add-trusted-admin-ip 192.168.1.100

# Enable two-factor authentication
plesk bin extension --install panel-ini-editor

# Change admin login
plesk bin admin --set-login -login newadmin

# Disable password-based login (SSH keys only)
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && systemctl restart sshd

# Enable SELinux for Plesk
plesk bin selinux --enable

# Check security advisor
plesk bin extension --exec security-advisor --check

# Set password policy
plesk bin server_settings --set -min-password-strength strong



Updates & Maintenance​


Bash:
# Check for Plesk updates
plesk installer --select-release-current

# Update Plesk to latest
plesk installer --select-product-id plesk --select-release-current --upgrade-installed-components

# Update specific component
plesk installer --select-release-current --install-component php8.2

# List installed components
plesk installer --select-release-current --show-components

# Remove component
plesk installer --select-release-current --remove-component php7.2

# List available extensions
plesk bin extension --list-available

# Install extension
plesk bin extension --install extension-name

# Update extension
plesk bin extension --upgrade extension-name

# Remove extension
plesk bin extension --uninstall extension-name

# List installed extensions
plesk bin extension --list

# Enable extension
plesk bin extension --enable extension-name

# Disable extension
plesk bin extension --disable extension-name

# Repair Plesk installation
plesk repair all

# Repair web server configuration
plesk repair web

# Repair mail configuration
plesk repair mail

# Repair DNS configuration
plesk repair dns

# Repair database configuration
plesk repair db

# Repair permissions
plesk repair fs

# Repair all with verbose output
plesk repair all -verbose

# Clean up old sessions
plesk bin panel_cleaner --clean-sessions

# Clean temporary files
plesk bin panel_cleaner --clean-temp

# Optimize database
plesk db "OPTIMIZE TABLE psa.*"

# Update server IP addresses
plesk bin ipmanage --reread

# Reconfigure all domains
plesk bin httpdmng --reconfigure-all



Logs & Troubleshooting​


Bash:
# View Plesk panel log
tail -f /var/log/plesk/panel.log

# View Plesk error log
tail -f /var/log/sw-cp-server/error_log

# View Apache error log
tail -f /var/log/httpd/error_log
tail -f /var/log/apache2/error.log

# View Nginx error log
tail -f /var/log/nginx/error.log

# View domain-specific error log
tail -f /var/www/vhosts/example.com/logs/error_log

# View domain-specific access log
tail -f /var/www/vhosts/example.com/logs/access_log

# View mail log
tail -f /var/log/maillog
tail -f /var/log/mail.log

# View PHP-FPM error log
tail -f /var/log/plesk-php82-fpm/error.log

# View Fail2Ban log
tail -f /var/log/fail2ban.log

# View system messages
tail -f /var/log/messages
tail -f /var/log/syslog

# View Plesk action log
plesk bin actionlog --list

# Filter action log by date
plesk bin actionlog --list -from "2024-01-01" -to "2024-01-31"

# Filter action log by user
plesk bin actionlog --list -user admin

# Check disk usage by domain
du -sh /var/www/vhosts/*/

# Check disk usage for specific domain
du -sh /var/www/vhosts/example.com/

# Find large files
find /var/www/vhosts -size +100M -exec ls -lh {} \;

# Check Plesk services status
plesk bin service --status-all

# Restart all services
plesk bin service --restart-all

# Test Plesk database connection
plesk db "SELECT 1"

# Check domain configuration
plesk bin domain --info example.com

# Debug Apache configuration
apachectl -S

# Debug Nginx configuration
nginx -T

# Check DNS resolution
dig example.com
nslookup example.com

# Check SSL certificate
openssl s_client -connect example.com:443 -servername example.com

# Test mail connectivity
telnet mail.example.com 25



PHP Management​


Bash:
# List available PHP versions
plesk bin php_handler --list

# List PHP handlers for domain
plesk bin domain --info example.com | grep php

# Set PHP version for domain
plesk bin domain --update example.com -php_handler_id plesk-php82-fpm

# Set PHP as CGI
plesk bin domain --update example.com -php_handler_type cgi

# Set PHP as FPM
plesk bin domain --update example.com -php_handler_type fpm

# Set PHP as FastCGI
plesk bin domain --update example.com -php_handler_type fastcgi

# Enable PHP for domain
plesk bin domain --update example.com -php true

# Disable PHP for domain
plesk bin domain --update example.com -php false

# Restart PHP-FPM
systemctl restart plesk-php82-fpm

# List all PHP-FPM services
systemctl list-units | grep php-fpm

# View PHP info file location
php -i | grep "Loaded Configuration File"

# Edit PHP settings via CLI
plesk bin domain --update example.com -php_settings "memory_limit=256M;upload_max_filesize=64M;max_execution_time=300"

# Register custom PHP version
plesk bin php_handler --add -displayname "PHP 8.3 Custom" -path /usr/local/php83/bin/php -phpini /usr/local/php83/etc/php.ini -type fpm

# Remove PHP handler
plesk bin php_handler --remove -id custom-php83

# Set default PHP handler
plesk bin php_handler --set-default -id plesk-php82-fpm

# Check PHP-FPM pool configuration
cat /var/www/vhosts/system/example.com/conf/php.conf

# View PHP error log
tail -f /var/log/plesk-php82-fpm/error.log

# Test PHP from command line
php -v
php -m

# Install PHP extensions (via Plesk installer)
plesk installer --select-release-current --install-component php8.2-imagick



FTP Management​


Bash:
# List FTP users for domain
plesk bin ftpsubaccount --list -domain example.com

# Create FTP user
plesk bin ftpsubaccount --create ftpuser -passwd "SecurePass123" -domain example.com -home /httpdocs/uploads

# Delete FTP user
plesk bin ftpsubaccount --remove ftpuser -domain example.com

# Update FTP user password
plesk bin ftpsubaccount --update ftpuser -passwd "NewPass123" -domain example.com

# Update FTP home directory
plesk bin ftpsubaccount --update ftpuser -home /httpdocs/newfolder -domain example.com

# Enable read permission
plesk bin ftpsubaccount --update ftpuser -read true -domain example.com

# Enable write permission
plesk bin ftpsubaccount --update ftpuser -write true -domain example.com

# Set disk quota for FTP user (MB)
plesk bin ftpsubaccount --update ftpuser -quota 500 -domain example.com

# Unlimited quota
plesk bin ftpsubaccount --update ftpuser -quota unlimited -domain example.com

# Get FTP user info
plesk bin ftpsubaccount --info ftpuser -domain example.com

# Restart FTP service
systemctl restart xinetd

# Check FTP service status
systemctl status xinetd

# View FTP log
tail -f /var/log/xferlog

# Enable anonymous FTP for domain
plesk bin domain --update example.com -anonymous-ftp true

# Disable anonymous FTP
plesk bin domain --update example.com -anonymous-ftp false

# Set FTP passive ports range
plesk bin ftpmng --set-passive-mode-ports 49152-65535

# Enable FTPS
plesk bin ftpmng --set-tls-mode required

# Disable FTPS
plesk bin ftpmng --set-tls-mode disabled



Server Information​


Bash:
# Get server info
plesk bin server_info --show

# Get Plesk version
plesk version

# Get detailed Plesk version
cat /usr/local/psa/version

# Get server hostname
hostname

# Set server hostname
plesk bin server_settings --set -hostname newhost.example.com

# Get IP addresses
plesk bin ipmanage --list

# Add IP address
plesk bin ipmanage --create 192.168.1.2 -mask 255.255.255.0 -interface eth0

# Remove IP address
plesk bin ipmanage --remove 192.168.1.2

# Set IP type (shared/exclusive)
plesk bin ipmanage --update 192.168.1.2 -type shared

# Get server resource usage
plesk bin server_info --resources

# Get license info
plesk bin license --info

# Get disk usage
df -h

# Get memory usage
free -m

# Get CPU info
cat /proc/cpuinfo | grep "model name" | head -1

# Get system uptime
uptime

# List running processes
top -b -n 1 | head -20

# Get OS version
cat /etc/os-release

# Get kernel version
uname -r

# Check server time
date

# Set timezone
timedatectl set-timezone America/New_York

# Sync time with NTP
timedatectl set-ntp true

# Get Plesk key
plesk bin license --get-key

# Set Plesk default page
plesk bin server_settings --set -default-page "Forbidden"

# Enable/disable statistics
plesk bin server_settings --set -statistics true

# Set session timeout
plesk bin server_settings --set -session-timeout 30



Service Plans & Limits​


Bash:
# List service plans
plesk bin service_plan --list

# Get service plan info
plesk bin service_plan --info "Default Domain"

# Create service plan
plesk bin service_plan --create "Custom Plan" -disk-space 10G -traffic 100G -max-domains 10

# Update service plan
plesk bin service_plan --update "Custom Plan" -disk-space 20G

# Delete service plan
plesk bin service_plan --remove "Custom Plan"

# Apply service plan to subscription
plesk bin subscription --update example.com -service-plan "Custom Plan"

# Set domain limits
plesk bin subscription --update example.com -max-dom 10 -max-subdom 20 -max-dom-aliases 5

# Set mailbox limits
plesk bin subscription --update example.com -max-box 50 -mbox-quota 500M

# Set database limits
plesk bin subscription --update example.com -max-db 10 -max-dbuser 10

# Set traffic limit
plesk bin subscription --update example.com -traffic 100G

# Set disk space limit
plesk bin subscription --update example.com -disk-space 10G

# Unlimited setting
plesk bin subscription --update example.com -max-dom unlimited



Useful One-Liners​


Bash:
# Get all domain disk usage sorted
for d in $(plesk bin domain --list); do echo -n "$d: "; du -sh /var/www/vhosts/$d 2>/dev/null | cut -f1; done | sort -k2 -h

# Restart all PHP-FPM versions
systemctl restart plesk-php*-fpm

# Find domains using specific PHP version
plesk bin domain --list | while read d; do plesk bin domain --info $d | grep -q "php82" && echo $d; done

# List all SSL certificates expiring within 30 days
for d in $(plesk bin domain --list); do plesk bin certificate --list -domain $d 2>/dev/null; done

# Bulk update all domains to use HTTPS redirect
for d in $(plesk bin domain --list); do plesk bin domain --update $d -ssl-redirect true; done

# Clear all mail queues
postsuper -d ALL

# Find large log files
find /var/www/vhosts -name "*.log" -size +100M

# Batch create backups for all domains
for d in $(plesk bin domain --list); do plesk bin pleskbackup domains-name $d -output-file /backup/${d}_$(date +%Y%m%d).tar; done

# Check all domains for broken SSL
for d in $(plesk bin domain --list); do echo -n "$d: "; timeout 5 openssl s_client -connect $d:443 -servername $d 2>/dev/null | grep "Verify return code" || echo "Failed"; done

# Count total mailboxes across all domains
for d in $(plesk bin domain --list); do plesk bin mail --list $d 2>/dev/null; done | wc -l

# Find domains without SSL
for d in $(plesk bin domain --list); do plesk bin domain --info $d | grep -q "SSL/TLS support: false" && echo $d; done

# Restart all services and clear caches
plesk repair all -start-services && systemctl restart nginx httpd



Quick Reference - File Locations​


DescriptionPath
Plesk installation/usr/local/psa/
Domain web roots/var/www/vhosts/DOMAIN/httpdocs/
Domain logs/var/www/vhosts/DOMAIN/logs/
Domain config/var/www/vhosts/system/DOMAIN/conf/
Apache config/etc/httpd/ or /etc/apache2/
Nginx config/etc/nginx/
PHP config/etc/php.d/ or /etc/php/VERSION/
Plesk logs/var/log/plesk/
Mail storage/var/qmail/mailnames/
SSL certificates/usr/local/psa/var/certificates/
Backups/var/lib/psa/dumps/
Panel config/usr/local/psa/admin/conf/



Emergency Commands​


Bash:
# Reset Plesk admin password (if locked out)
plesk bin admin --set-password -passwd "NewPassword123"

# Force repair Plesk
plesk repair installation

# Restart all Plesk services
plesk repair all -start-services

# Rebuild web server configs (fixes 500 errors)
plesk repair web -y

# Fix broken permissions
plesk repair fs -y

# Emergency MySQL recovery
systemctl stop mariadb
mysqld_safe --skip-grant-tables &
# Then reset root password

# Clear Plesk cache
rm -rf /usr/local/psa/admin/htdocs/domains/cache/*

# Force SSL certificate renewal
plesk bin extension --exec letsencrypt cli.php -d example.com --force-renew



Last updated: Jan 26
Compatible with: Plesk Obsidian 18.x
 
Back
Top