Single machine deployment
This topic provides instructions for deploying updates to Magento on a production server using the command line.
This process applies to technical users responsible for stores running on a single machine with some themes and locales installed.
For less technical users, i.e. business users, we recommend using the System Upgrade feature in the Admin .
- You installed Magento using Composer or a compressed archive.
- You are directly applying updates to the server.
This guide does not apply if you used
git clone to install Magento.
Contributing developers should use this guide to update their Magento installation.
Log in to your production server as, or switch to, the Magento file system owner.
Change directory to the Magento base directory:
cd <Magento base directory>
Enable maintenance mode using the command:
php bin/magento maintenance:enable
Apply updates to Magento or its components using the following command pattern:
composer require <package> <version> --no-update
package: The name of the package you want to update.
version: The target version of the package you want to update.
Update Magento’s components with Composer:
Update the database schema and data:
php bin/magento setup:upgrade
Compile the code:
php bin/magento setup:di:compile
Deploy static content:
php bin/magento setup:static-content:deploy
Exit maintenance mode:
php bin/magento maintenance:disable
Alternative deployment strategies
For deployment strategies developed by the Magento community, see the blog posts listed under the Install/deploy section in our Community Resources page.
In Magento 2.2, a near-zero downtime deployment model will be available for a variety of complex environments, including Magento Commerce Cloud.