Magento 2 Deploy

I used to have Magento 2 with sample data in my server, but it consumed way too much space so I hereby share my personal installation manual! 

This manual assumes you are running a LAMP env with docker & docker-compose.

Ready for this? Go ahead and download Mangento CE!

  • Create a directory for the project
  • make a directory named www inside the project dir
  • Drop the zip/tar.gz file inside the www directory
  • Run one of the three commands  (check your file extension)
  • tar zxf 
    unzip 
    tar jxf  
  • Move the compressed (tar, zip, etc…)  file back to where it was
  • Execute this cmd
  • chmod -R 777 vendor/ app/etc/ pub/ var/ generated/
    
  • Run
  • docker up --build -d
    //You can use an image with apache 5.6 and php 7.2 or other versions
  • Fill in the database credentials, with your server info
  • Go to the core_config_data  table and change the value of the web/secure/use_in_adminhtml row to 1
  • SSH into the running container
  • docker exec -it <NAME OF THE CONTAINER> bash
    
  •  Run this cmd
  • php bin/magento cache:flush
    
  • You can now follow the in-browser wizard 
  • Go play with Magento 2 by Adobe

    If you have NO CSS in the front-end or back-end run this:
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy -f
    php bin/magento cache:clean
    php bin/magento cache:flush
    
    In case your images are not loading run this:
  • php bin/magento catalog:images:resize