I have two environments for my store developed in Magento CE 2.2.5, one is for development use (where I run the store in developer mode), the other is the production environment (where the I use the production mode).

I use the development environment to improve and add functionalities as well as doing JS/CSS changes. Everytime I want to move changes from development to production, after publishing the edited files (JS, LESS. ecc...), I need to remove the entire pub/static folder (except the .htaccess) and run the setup:static-content:deploy command.

Doing this leaves my site without CSS/JS files until the deployment is not finished. How can I avoid this? Should I deploy the static files in my development environment and publish the pub/static folder generated?

1 Answer 1


To reduce the downtime of the production shop you need to some sort of deployment process. This means that you script the processes needed to update production and preferably build the static content separately before moving it to the live location.

This may help you to get started:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.