How To Use Magento Open Source

How To Use Magento Open Source
As the name implies, Magento is an open-source platform and can be seen as the basis for commerce. You can use the extensive functions of this version and expand its basic functions with the help of third-party providers’ adaptations and modules. After the initial public beta version in 2007, Magento open source became a pathfinder for the excellence we can now enjoy.
Prerequisites
Before you start going through this article, there is a need for you to have an environment with the tools below available:
Where to find Magento 2 Open Source?
You can get Magento Open-source on Magento’s official website. Go to Magento.com, then “Community,” to the “Community page,” where you can get the link to download Magento Open Source; you will still find other things like some basic information on how you can use it.
On the page, select the Get Started with Open-Source button.
Below the page, you will see the “Download Open Source” button, which will direct you to the page where you can download the Magento packages.
This page lists various versions and releases, security patches, migration tools, and additional patches that you can download and install when they are available for use.
Installing with Composer
Magento 2 Open Source can be installed with the Composer Package Manager. If you are not familiar with a Composer, then you should know it’s a dependency management software that can be used to manage platform dependencies for both Magento 2 Open Source and Magento 2 Commerce editions.
The latest version of Magento 2 Open Source can be gotten as a ZIP/Archive package from the Download page.
Within the Download with Composer section, select the Get started button
This page provides the Magento Metapackage, which we can use in order to install the latest Magento 2 Open Source edition.
On this page, you will find a Magento meta-package that will allow us to install the latest edition of Magento 2 Open Source.
Copy the command below to begin the composer installation
composer create-project --repository=https://repo.magento.com/ Magento/project-community-edition
Now, it can be assumed that the PHP Package Manager and Composer are now available in your local environment, so you can follow this article without disruption.
Head to the document root of your web server and paste the command you copied earlier in the command line.
This command will locate the Magento 2 Open Source (latest edition) within the specified repository. The composer will create a directory for a project community edition, and extraction of the Magento project files will be done within it.
It may take a few minutes to download all the dependencies of the Magento 2 Open Source project, so we have created a new project community editing directory, which is the location of all the Magento project files.
Go to the directory of the project-community-edition to check the installed files.
cd project-community-edition/ls -la.
Configuring File Permissions
For Magento open-source projects, we need to set the appropriate file permissions. The Magento installation page provides a number of commands that must be executed to set permissions for Magento 2 Open Source project files and directories.
Copy and execute the commands below in the directory of Magento project
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
You may need to run another command in the Magento project directory if your web server user is configured to be executed as a www-data group.
chown -R :www-data .
Now, all is set to install the Magento Open-Source edition.
Install Magento 2 Open Source
Below are the two ways you can install Magento 2 Open-Source edition:
- Command-line
- Web Setup Wizard
The fastest and easiest method to install Magento 2 open source is using the command line. An installation command can be used for installing Magento 2 Open Source.
Copy the following installation 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
Note: Do not view these parameters in the bin/magentosetup: install command as being cumbersome. You can always research online to have a comprehensive meaning of these parameters.
When you begin the installation, ensure you double-check the --base-url, --database-name, --database-password, and --database-user.
Before executing the installation command, it is necessary you have a new MySQL available.
CREATE DATABASE Magento;
Paste the install command from the directory of the Magento project and run it.
The Magento Admin URLs can also be used to access Magento Admin.
In addition, you may need to configure a virtual host file for the Apache or Nginx webserver to access local domains and access Magento 2 open-source applications through a browser.
If you are in need of a reference, the following is a typical example of a local domain name with the host's file.
127.0.0.1 magento2ce.magemastery.com
And, 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>
Go to http://magento2ce.magemastery.com link in a browser.
It might not open immediately since you are visiting for the first time.
At Upstack we help you grow your business faster. We connect you with the top 1% developers in the world. Contact us NOW!