Getting started with Magento 2
Magento 2 is one of the leading e-commerce platforms today. In this blog, we will learn how to get started on Magento 2 and boost your business activity right away.
The most recent Magento platform version is called Magento 2. It is packaged as a different collection of features for Magento 2 Open Source, Magento 2 Commerce on-prem, and Magento 2 Commerce Cloud.
Now, to get started with Magento 2, we need to first know where to find the Magento 2 Open Source. The official Magento website hosts Magento 2 Open Source. You can find a Get Open Source link to the Magento Open Source landing page as well as details on how to get started by going to Magento.com > Community > Community page.
You can now go ahead and click the “Get Started with Open Source” button.
When you scroll down to the end of the page, you would find a “Download Open Source” button that would lead to the Magento Packages page.
From here, you can download and install the various versions, releases, security patches, migration tools, and further patches when these packages are produced and made available.
INSTALLING WITH COMPOSER
Magento 2 Open Source and Magento 2 Commerce versions use a dependency management program to handle platform dependencies called the Composer Package Manager. Magento 2 Open Source can be installed through it.
Directly from the Download page, we can download the most recent version of the Magento 2 Open Source edition as a ZIP/Archive file. In the “Download with Composer” area, click the “Get Started” button.
MAGENTO MEGAPACKAGE
To install the most recent Magento 2 Open Source edition, we can use the Magento Metapackage that is provided in this article.
To begin installing composer, copy the following command:
create-project –repository=https://repo.magento.com/ magento/project-community-edition
Paste the installation command into the command line after navigating to the document root of your web server. This command will look in the repository we gave in the —repository parameter for the most recent version of Magento 2 Open Source. The Magento project files will be extracted into a project-community-edition directory by Composer.
The download of all Magento 2 Open Source project requirements could take upto a few minutes. Then, a new project-community-edition directory would be created and would contain all of the files for the Magento project.
You can view the installed files by going to the project-community-edition directory.
cd project-community-edition/
ls -la .
SETTING FILE PERMISSIONS
We must specify the appropriate file permissions for the Magento 2 Open Source project. To configure permissions for files and folders of a Magento 2 Open Source project, we must use the commands provided on the Magento Installation page.
You can copy and run the commands below in the project directory for Magento:
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chmod u+x bin/magento
If your web server user is set up to operate as a member of a www-data group, you might additionally need to run one more command in the Magento project directory.
Chown -R :www-data .
You are now ready to install Magento 2 Open Source edition
INSTALLING MAGENTO 2 OPEN SOURCE
The Magento 2 Open Source edition can be installed in one of two ways:
- command line
- Web Setup Wizard 2.
Using a command line is the quickest and simplest method to install Magento 2 Open Source. Installing Magento 2 Open Source can be done using a specific command.
bin/magento setup:install \
–base-url=http://magento2ce.magemastery.com \
–db-host=localhost \
–db-name=magento \
–db-user=magento \
–db-password=magento \
–admin-firstname=admin \
–admin-lastname=admin \
–admin-email=admin@admin.com \
–admin-user=admin \
–admin-password=admin123 \
–language=en_US \
–currency=USD \
–timezone=America/Chicago \
–use-rewrites=1
Make sure to double-check your installation’s —base-url, —database-name, —database-password, and —database-user, and update them as necessary.
It is necessary to set up a new MySQL database before running the installation command.
CREATE DATABASE magento;
Copy the installation command from the Magento project directory, and then run it.
After the installation has gone smoothly, we can get two success messages.
To access Magento Admin, use the URI for Magento.
Additionally, you might need to set up the virtual hosts file for the Apache or Nginx web servers in order to access a local domain and use the Magento 2 Open Source application through a browser.
For reference, the hosts file example using the local domain name is shown below:
127.0.0.1 magento2ce.magemastery.com
And, an Apache 2 httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot “/Users/pronko/www/videos/tutorials/project-community-edition”
ServerName magento2ce.magemastery.com
ErrorLog “/usr/local/var/log/httpd/magento.com-error_log”
CustomLog “/usr/local/var/log/httpd/magento.com-access_log” common
</VirtualHost>
Open a browser and go to the address http://magento2ce.magemastery.com. The home page may take some time to load the first time.
You now have a Magento 2 Open Source application that is completely operational. You can see the various features that are accessible right out of the box, and now you’re ready to go down the development road!
At the end of this blog, we now know more about the Magento 2 platform, especially the Open Source version. We have learned about where to locate a Magento Metapackage, Composer Package Manager installation for Magento 2 Open Source, and How to use the browser to access recently installed Magento 2 Open Source. To learn more, feel free to geek around and find out more! <link>