↑ ↓ select, Enter open, Esc close

Install Composer dependencies for production

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
composer install --no-dev --optimize-autoloader --working-dir=/var/www/vhosts/example.com/httpdocs

Installs exactly the versions pinned in composer.lock and leaves out packages from require-dev. The optimized autoloader generates a class map, which speeds up application startup. A typical step when deploying to a live server.

Note: Run it as the subscription user, not as root, so that vendor/ has the right owner. For a specific PHP version, put the interpreter in front, for example /opt/plesk/php/8.3/bin/php /usr/local/bin/composer.

Also searched as

  • composer install production
  • composer install without dev packages
  • rebuild vendor folder

Related one-liners

All in PHP

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.