This article was originally published in September 2017, but has been updated frequently since then to include new helpful info.
There’s a lot of Linux shell intro guides out there. There’s also a lot of intro to Plesk guides out there. But a reference guide to help you find the most common paths and command line utilities for managing your Linux VPS or dedicated server running Plesk is harder to come by.
Before we get started, if you haven’t got any experience with Linux shell, check out one of the many intro to Linux shell guides you can find with a Google search, then come on back to learn the specifics of exploring Plesk from shell.
Most of what you’ll find in this guide is more helpful to those with their own VPS or dedicated server that runs Plesk Panel, however some of this info will be handy for shared or reseller hosting users as well, like the PHP binary location.
Common Paths / Directories
Plesk User Home Directory: /var/www/vhosts/<primary_domain>
This is the same one you see when you open the File Manager in Plesk. Within that directory will be a few others, such as:
- httpdocs — the default web root for your primary domain (unless you changed it)
- A web root folder for each of your subdomains and addon domains that is typically the subdomain or domain itself (like mydomain.com) unless you altered it when you created it.
Note: we recommend sticking with the default path provided by Plesk. For security reasons it’s best to not have web root folders nested within another domain’s web root. Example: don’t put an addon domain’s web root within the httpdocs folder like httpdocs/new_domain
Shell User Configuration File:
- Shared hosting user: ~/.bash_profile
- root user (VPS): /var/www/vhosts/<primary_domain>/.bash_profile
Within this file is your PATH variable which is preconfigured to use certain versions of PHP, node and other such utilities. You may adjust the path here, should other versions be available for you to use (binary paths described below in this article).
Plesk Mail Storage Directory:
Where the mailname is the first part of the email address, such as ‘john’ from email@example.com.
Even though the directory ‘qmail’ would imply it’s for the qmail mail server, even when you use postfix, Plesk stores messages at this path.
Within the Maildir, your mail folders are hidden folders, meaning they start with a period (.) and will only be visible using the
ls -al command. For example, your default Spam folder will be called:
Plesk Web Server Config Files
These are all fairly standard.
/etc/httpd/conf/httpd.conf for the core config, and
/etc/httpd/conf.d/ for most of the extras.
Plesk stores its specific configs in
/etc/nginx/conf.d for most of the extras.
Plesk stores its specific nginx configs in
But! Each vhost has its own area where you’re expected to add config and make changes:
These files are also editable from within Plesk (only if you’re an admin) when you choose “Apache and nginx config” under any given domain. Near the bottom of each of the apache and nginx sections are the advanced configurations which edit these files.
You’ll notice that these paths are similar to those to the vhost’s web roots, but are instead contained within the system folder in the vhosts path. In the past few years Plesk moved these config files out of the user root folder and into that system folder for better security and to ensure all configs are available in one spot.
Handy Binaries / Programs
Plesk Tools Directory:
In recent versions (12+), the Plesk devs have also provide a shorthand mechanism for accessing Plesk binaries in case you wanted to avoid typing /usr/local/psa/bin. It looks like this:
plesk bin <command>
Plesk PHP Binary Directory:
For example for PHP 7.3 the directory is
Tip: if you’re using shared hosting with Plesk, these PHP binaries are available in the same locations thanks to our optimized chroot configuration.
Server Monitoring Tools
The built in OS binaries are often the default in Plesk, and they’re in the usual place:
/bin/php, but the /opt/ dir is where you’ll find the additional PHP version binaries.
We install this when you have us set up your server (Platinum management). It’s a great utility for easy monitoring of system services. It shows you real-time memory and CPU usage as well as a list of active processes in order (by default) of CPU usage.
lsof -p <process_id>
While most processes make it pretty clear what website they belong to by listing the system user that triggered it, if a process does not have such an indicator, the above lsof command can help to narrow that down by listing all of the files that a process is accessing.
You’ll need to use htop to find the process ID before running this.
It’s going to spit out a comprehensive list of every single file the program uses. Most of the stuff at the top of the list are builtin system libraries that aren’t going to tell you much. You’ll probably find the info you want closer to the bottom of the list of open files, such as the currently active socket file (which often has a path leading to the website’s vhost root) or even more straightforward: an open log file that leads to the vhost system root.
Interacting with Plesk via CLI
Obtaining a list of domains:
plesk bin domain -l
If you read above you’ll know that the ‘plesk bin’ prefix means we’re calling the ‘domain’ tool from Plesk’s binary path via shorthand. domain -l is simply going to pull a list of hosted domains (including subdomains) from Plesk’s database for you.
You can then run
plesk bin domain -i <domain> to get more info about the domain.
This article is a work in progress. If there’s some Plesk-related info you think we’re missing that you would like to know how to access from the command line, let us know by leaving a comment below! We’re always looking to improve our guides.