Cloud Service >> Knowledgebase >> Magento >> How to set up Magento locally?
submit query

Cut Hosting Costs! Submit Query Today!

How to set up Magento locally?

Magento is one of the most powerful open source e-commerce platforms which is widely used by many businessmen to develop their online business. Through Magento local installation, you are allowed to freely work on your store without affecting the live site and thus offers you a platform to try out some fun stuff. The following below is the procedure of how to install Magento locally:

Step 1: Check System Requirements

Before installing Magento, ensure your local machine meets the minimum requirements:However, when not a virtual host, make sure that your local machine can support Magento by following the following requirements before you install the program.

- Operating System: It can be installed and used on any operating system whether it is Windows or MAC OS or Linux.

- Web Server: Apache 2. 4 or Nginx 1. x.

- PHP: Version 7. 4 or later with such extensions as ext/bcmath, ext/curl, ext/gd, ext/mbstring, ext/openssl, ext/pdo_mysql and ext/zip.

- Composer: You can define it as the software that helps to manage files, which are used in PHP.

Ensure that you have system privileges for your computer in order to install and integrate these components.

Step 2: Install a Local Server Environment

To run Magento locally, you need to install a Local server environment using software like XAMPP, WAMP for Windows system, MAMP for the MAC OS, LAMP for Linux OS. Some of these packages are termed as AMP or AMP where S stands for software and in this package you get Apache, MySQL and PHP all bundled together.

- Download and Install the Server Package: Go to the official web-site of the chosen tool and download the version for the operation system used.

- Configure Apache and MySQL: After installation it is required to start the control panel and turn on the Apache and MySQL services.

Step 3: Install Composer

It is also worthy to note that Magento is a Composer driven application. To install Composer:

Download Composer: Move to Composer website and download the application installer based on the operating system you have.

Run the Installer: After downloading Composer, follow the installation steps, make a note that Composer needs to be accessed from command line, so make sure the PATH of the system includes Composer.

Verify the installation by running:Verify the installation by running:

composer --version

Step 4: Download Magento

To install Magento, download its source code:To install Magento, download its source code:

- Create a Magento Directory: Prepare a directory on your local computer for the Magento installation (we called it magento_local).

- Download Magento Using Composer: Go to terminal or cmd and get into the created folder and type:

- composer create-project --repository-url=https://repo. magento. com/ magento/project-community-edition .

And, you’ll have to input your Magento Marketplace credentials. If you do not have the above keys, register on Magento Marketplace and navigate to “My Profile” > “Access Keys” where you will have to generate new keys.

Step 5: Set Up the Database

Magento requires a MySQL database:

Open phpMyAdmin: Access phpMyAdmin by navigating to http://localhost/phpmyadmin in your web browser.

Create a Database: Create a new database (e.g., magento_db) with utf8mb4_general_ci collation.

Step 6: Install Magento

Now, you can install Magento:

Run the Setup Command: In the terminal or command prompt, navigate to the Magento directory and run:

php bin/magento setup:install \

--base-url=http://localhost/magento/ \

--db-host=localhost \

--db-name=magento_db \

--db-user=root \

--db-password=your_password \

--admin-firstname=Admin \

--admin-lastname=User \

[email protected] \

--admin-user=admin \

--admin-password=Admin123 \

--language=en_US \

--currency=USD \

--timezone=America/Chicago \

--use-rewrites=1

Replace placeholders with your specific details.

Conclusion

By following these steps, you may set up Magento regionally for improvement and checking out functions, making sure a stable surroundings for personalisation and experimentation.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!