Skip to content

Instantly share code, notes, and snippets.

@mroffice
Last active April 23, 2020 06:53
Show Gist options
  • Save mroffice/7fd582c5b1cefa55f011 to your computer and use it in GitHub Desktop.
Save mroffice/7fd582c5b1cefa55f011 to your computer and use it in GitHub Desktop.
How to install Magento for your local development environment

How to Create a Fresh Magento Install on your Local Development Environment (Mac)

  1. Download, install and setup MAMP or MAMP Pro

n.b. For further instructions on how to set-up Mamp Pro like a pro, see this Gist

  1. Download the latest version of Magento, and the sample data

  2. Expand the Magento tar file into your chosen directory (I use ~/Dev), rename the created magento folder as you wish and enter the directory

$ cd ~/Dev
$ tar -xvzf ~/Downloads/magento-x.x.x.x.tar-yyyy-mm-dd-hh-mm-ss.gz
$ mv magento fresh_magento && cd $_
  1. Expand the sample data tar file. Copy recursively the skin and media folder contents into the corresponding Magento directory.
$ tar -xvzf ~/Downloads/magento-sample-data-x.x.x.x.tar.gz
$ cp -R magento-sample-data.x.x.x.x/skin ./skin
$ cp -R magento-sample-data.x.x.x.x/media ./media
  1. Import the sample database into mysql
  • If you don't already have a database

    $ mysql -u <user> -p
    $ CREATE DATABASE <db_name>;
    $ EXIT;
$ mysql -u <user> -p <db_name> < magento-sample-data.x.x.x.x/magento_sample_data_for_x.x.x.x.sql
  1. Modify file permissions
$ find . -type f \-exec chmod 644 {} \;
$ find . -type d \-exec chmod 755 {} \;
$ chmod -R 777 app/etc
$ chmod -R 777 var
$ chmod -R 777 media
  1. Visit your local server's host URL to initiate the installer.

The options are pretty straight forward, I would suggest to check the following options:

  • Skip Base URL Validation Before the Next Step Because we're on a local environment, we don't need Magento to issue a wget request to our server to validate it.
  • Use Web Server (Apache) Rewrites This means Magento will automatically strip out the ugly /index.php/ from URLs

Bonus Tips

Install these immediately if you don't want to waste 100s of hours:

  • n98-magerun (FREE) The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API. http://magerun.net/

  • Commerce Bug 2 (~$50) Commerce Bug 2 is the must have upgrade to Pulse Storm's development and debugging extension for the Magento platform. Commerce Bug will help any Developer, designer, or IT professional programming and configuring the Magento Ecommerce system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment