Definitive Magento installation guide
25 Jun 2009, by Denis Margetic
9 Comments · Posted in Magento

    While getting started with Magento some time ago, I thought it would be a good idea to write a post that started at the beginning: how to install it. Reading through the Magento forums, I get the impression that Magento users have extremely varied levels of web development and systems administration experience. That raises the question of the amount of detail to include in a post aimed at Magento newcomers, since experienced web developers will need only the important steps, whilst those new to web development will prefer more info. Here's our take on an install guide that will hopefully prove useful for both audiences.

    In order to broaden the appeal of this article I have used JavaScript to make things more readable. Below are all the steps necessary to install Magento, and if you are unsure about any of the steps, just click for more details.

    Installing Magento is similar to installing Drupal or Wordpress. Before we can install Magento we need to configure the environment in which it will run. In this case we'll use Ubuntu as the operating system in our examples, though the instructions are fairly similar for other Linux distributions. You will need sudo access in order to complete the steps below.

    1. Configure Ubuntu

      1. Install php5 including the following modules:
        • mhash
        • cli
        • mcrypt
        • curl
        • mysql
        • gd
      2. Install mysql
      3. Create a database for Magento
      4. Increase memory limit in /etc/php5/apache2/php.ini to 64MB
      5. Increase memory limit in /etc/php5/cli/php.ini to 64MB
      6. Enable server rewrites
    2. Download Magento

      1. Follow this link to the download page
      2. Download the Full Release in your favourite format. If you are not sure which format to choose download zip.
      3. Uncompress the file
      4. Move the Magento directory to your web accessible directory
      5. Make magento/app/etc, magento/var/ and magento/media world-writable
    3. Install sample data for Magento

      (Optional - click here for details)

    4. Install Magento

      1. To install Magento load it in the browser by typing magento after server's base url.
      2. On the first page that loads accept the license agreement and click 'Continue'
      3. Enter locale information
      4. Enter database information
      5. Enter personal information
      6. Magento Installation Complete!
    5. Install extensions

      (Optional - click here for details)

    6. Keep Magento up-to-date

      Warning! Please don't perform an upgrade on your live site, you should always test the upgrade process on a copy of your live site first. Also keep backups of both the database and magento directory just in case.

      1. Run ./pear mage-setup in Magento directory (if you haven't done so in the 'Install extensions' step)
      2. Run ./pear upgrade magento-core/Mage_All_Latest in your Magento directory
      3. Clear session and cache data

    I hope your installation was successful. Have fun using Magento!


    Hi, nice article :)
    one comment, could you add a dot after ./pear mage-setup ?

    ./pear mage-setup .
    Comment by Unirgy - 26 Jun 2009 5:53:00 PM
    Hi Unirgy - using the trailing "." will also work but we've found the command to work with or without it, so we usually leave it out for the sake of simplicity. We haven't seen any problems from doing it this way but if you've run into some please let us know!
    Comment by Chris Norton - 29 Jun 2009 2:29:34 PM
    I get an the following error when I try to install extensions or do mage-setup:

    ./pear line 91: exec:php: not found

    Any ideas of what might be going wrong?

    Comment by David - 18 Jul 2009 12:42:17 AM
    <p>Well it appears that the php executable cannot be found. My suggestion is to make sure that the php command line package (php5-cli) is actually installed, since it is not installed by default. If it is installed, I would also suggest double checking that the executable paths are set correctly.</p>
    Comment by Denis Margetic - 20 Jul 2009 5:11:00 PM

    I couldn't find the file: /etc/php5/cli/php.ini the directory doesn't exist.
    Second, when i get to a browser, I typed in, and it tries to download the page instead of executing it. I followed your instructions to the letter.

    Any ideas?
    Comment by mcNuggets - 6 Aug 2009 3:14:40 AM

    I still have the rewrite issue. I have to type in in order to install.
    After I check that rewrite is selected, I still have to type
    If not, my web browser asks me where to download the file.

    After extensive research, you should add these following instructions. If people are using this as a development should comment out the following lines from app/code/core/Mage/Core/Model/Session/Abstract/Varien.php



    $this->getCookie()->getPath() // don't forget to put back the comma "," when uncommenting the lines below

    thanks for writting this installation guide, i've been breaking my head for weeks...
    Comment by mcNuggets - 6 Aug 2009 4:21:43 AM
    I keep getting a write permissions error on the Magento folder, but can't figure out how to get around that. I've set all the permissions with the entire Magento folder to be able to read and write. Any ideas?

    Error: Please check for sufficient write file permissions

    Your Magento folder does not have sufficient write permissions, which this web based downloader requires.
    Comment by Dave - 3 Feb 2010 9:42:18 AM
    It might be necessary to make the Magento directory itself world writeable. You need to go the the directory that contains Magento, and change the permissions on the Magento root directory itself.
    Comment by Denis Margetic - 4 Feb 2010 10:25:36 AM
    If you installed Magento via any other method than the downloader, then when you come to use Magento Connect, you will find that you are unable to due to permissions. For Magento Connect to work, all folders must have 777 permissions.

    If you have SSH access to your server, you can fix this by running the following command:

    find ./ –type d –exec chmod 777 {} \;

    If you don't have SSH access you could try a php based SSH emulator instead.

    The other option is to use Filezilla 3 to recursively chmod the files for you. This can take a little while to run, but at least you don't have to do it manually!

    Comment by Anonymous - 13 Mar 2010 5:23:00 PM

    Submit Comment

    In response to:

    * Required Fields