There was a problem loading the comments.

SSH and WP-CLI in Plesk

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Safely access your hosting server and control WordPress using commands


Step 1: Enable SSH Access for Your Hosting Account

Before you can use SSH, your hosting account must allow it.

  1. Log in to Plesk

  2. Go to Websites & Domains

  3. Click Web Hosting Access

  4. Under Access to the server over SSH, choose:

     
    /bin/bash (chrooted) or /bin/bash
  5. Save changes

If SSH options are missing, contact your hosting provider to enable SSH access.


Step 2: Find Your SSH Login Details

Go to:

  • Web Hosting Access → here you’ll find:

    • Username

    • IP address or domain

    • Port (usually 22)

Example credentials:

Host: yourdomain.com User: your_ftp_username Port: 22

Step 3: Connect Using an SSH Client

On Windows:

Use a free program like PuTTY or Windows Terminal.

  1. Open PuTTY

  2. Enter your domain or IP and port 22

  3. Click Open

  4. Log in with your credentials

On macOS / Linux / Windows Terminal:

Use your terminal and type:

nginx
ssh yourusername@yourdomain.com 

Step 4: Confirm You’re Logged In

Once logged in, you’ll see your username and the server name in the command line — like this:

yourusername@yourdomain [~]#

Using WP-CLI (WordPress Command Line)

WP-CLI is pre-installed on most Plesk servers with WordPress Toolkit.


Step 5: Navigate to Your WordPress Directory

Use this command to go to your WordPress folder:

cd /var/www/vhosts/yourdomain.com/httpdocs

You can list files with:

ls

Make sure you see wp-config.php in the list. That confirms you’re in the right place.


Step 6: Use WP-CLI Commands

Here are some useful WP-CLI commands:

Command What It Does
wp core update Updates WordPress core
wp plugin list Lists all installed plugins
wp plugin update --all Updates all plugins
wp theme list Shows installed themes
wp search-replace 'old' 'new' Replaces text in the database
wp user list Shows WordPress users
wp option get siteurl Displays the WordPress site URL

 


Step 7: Exit the SSH Session

When you’re done, simply type:

exit

This safely disconnects you from the server.


Pro Tips

  • Always use strong passwords for SSH accounts

  • Back up your site before running update or replace commands

  • WP-CLI is faster than using the WordPress dashboard

  • Use WP-CLI to manage multiple WordPress installations on the same server


Share via
Did you find this article useful?  

Related Articles


Comments

Add Comment

Replying to  

CAPTCHA

On-Premise Help Desk Software by SupportPal
© Support Portal - WP Lighthost