How to Set Up PHP Composer in Plesk
Composer is a dependency manager for PHP. Plesk provides built-in Composer support, making it easy to run composer install
, update
, and other commands from the control panel.
Step 1: Log in to Plesk
Visit:
https://your-server-ip:8443
Log in with your credentials.
Step 2: Check if Composer is Installed
-
Go to Tools & Settings
-
Click Updates & Upgrades
-
In the list of available components, look for PHP Composer
-
If it’s not installed, click Add/Remove Components and install Composer support under the Plesk Hosting Features section
Alternatively, install Composer manually via terminal or use the Composer CLI tool if enabled by your hosting provider.
Step 3: Open the Application Root Folder
-
Go to Websites & Domains
-
Choose your domain
-
Click File Manager
-
Navigate to the folder where your PHP app is located (where
composer.json
exists)
Tip: If you don't have a
composer.json
yet, you can create one directly inside File Manager.
Step 4: Use the Composer Tool in Plesk
Once inside the folder:
-
If Composer is detected, you’ll see a Composer tab or button in the top menu
-
Click Composer
-
You’ll be able to:
-
Run
composer install
-
Run
composer update
-
Set environment variables
-
See installed dependencies
-
Step 5: Run Composer Commands
If needed, you can also run custom commands:
-
Click the Composer tab
-
Enter custom commands like:
composer dump-autoload composer require vendor/package-name
Step 6: (Optional) Use SSH for Advanced Usage
If you prefer command line access:
-
Log in to your server via SSH
-
Navigate to your project directory
-
Run Composer commands manually
Example:
cd /var/www/vhosts/yourdomain.com/httpdocs
composer install
Make sure your server has Composer globally installed and available in the
$PATH
.
Summary
Action | Where |
---|---|
Enable Composer | Tools & Settings → Updates & Upgrades |
Use Web Interface | Websites & Domains → File Manager → Composer |
Run CLI commands | Via SSH in the app directory |