Install Extension
How to Install
Even though Magento platform has built-in functionality, to provide your business needs, you can also use its additional features (extension).
In this article, we will explain in detail how to install the Magento 2 extensions. We will use the ProfStep_Quotation module for the example purpose.
There are several different solutions:
As a ZIP package
This section discusses the way to download a ProfStep extension as a ZIP-package.
Customer Area
Once you purchase the extension, it will be listed in the Products section in the customer area:
Find an appropriate extension in the list and click on the “Download” button to install the package you need
Package structure
The installed ZIP-package will contain the following files structure:
Directoryapp
Directorycode
DirectoryProfStep
DirectoryCore/
- …
- …
DirectoryQuotation/
- …
Installation
When all the necessary packages have been downloaded, follow these steps depending on your OS to deploy modules:
Windows OS
| In case of Windows OS, you need to use FTP/SFTP Clients. We recommend such clients as FileZilla or WinSCP.
| For this purpose, we will use WinSCP client.
-
| Connect to the server where your Magento source folder is located with FTP or SFTP Clients. | Open it and enter the server’s credentials and click on the Login button.
-
Open Magento source folder by clicking on the server folder path.
-
Move the installed packages (in our example it’s ProfStep_Core and [ProfStep_Quotation] modules) to the app/code/ folder as shown below:
-
After the previous step, open WinSCP Command Line
-
Now, please, run the following commands in the Magento 2 root folder:
Terminal window php bin/magento mod:en ProfStep_Core ProfStep_Quotation # To enable modulesphp bin/magento setup:upgrade # Upgrade database schema.php bin/magento setup:di:compile # Start application code generationphp bin/magento setup:static-content:deploy # Generate static content
Linux distribution
In the Linux/Unix systems the Secure Shell (SSH) protocol can be used, for securing and copying files and directories remotely.
-
We will use the rsync command. Specify the archive name with modules as the first argument and second argument in the next format user_name@host
-
user_name - the account name that is being accessed on the host.
-
host - it can be a server IP address (e.g. 192.168.1.22) or domain name (e.g. test.domain). Also after : path for copying can be specified.
Terminal window rsync Archive.zip user_name@host:/var/www/magento2-folder
Then the server requires a password.
-
-
Login to the server via ssh. Specify only the user_name@host as the first argument (like in rsync)
Terminal window ssh user_name@host -
After that we need to execute several commands to the ZIP-archive with modules to the Magento root folder.
Terminal window cd /var/www/magento2-folder # Change directory to the Magento 2 root folderls -la | grep Archive.zip # Verify if the archive with modules has been copiedsudo mv Archive.zip app/code/ # Move archive to the app/code/ foldercd app/code/ # Change directory to the app/code/unzip ProfStep # Extract modules from the archivels -la ProfStep # To display a list of modules -
Now, please run the following commands in the Magento 2 root folder:
Terminal window php bin/magento mod:en ProfStep_Core ProfStep_Quotation # To enable modulesphp bin/magento setup:upgrade # Upgrade database schema.php bin/magento setup:di:compile # Start application code generationphp bin/magento setup:static-content:deploy # Generate static content
MacOS
MacOS is unix-based OS (more specifically free-BSD). So we can use SSH also.
-
Firstly, we need to copy a ZIP-archieve to our server. For this purpose can be used rsync command.
Terminal window rsync Archive.zip user_name@host:/var/www/magento2-folderWhere
- user_name - the account name that is being accessed on the host.
- host - it can be an server IP address (e.g. 197.154.1.22) or domain name (e.g. test.domain). Also after : path for copying can be specified.
-
Login to server via ssh. Specify user_name@host (like rsync).
Terminal window ssh user_name@host -
When you successfully logged in to server, execute several commands in Magento 2 root folder:
Terminal window cd /var/www/installation-demo/ # Change directory to Magento 2 root foldersudo mv ProfStep.zip app/code/ # Move archive to app/code/ foldercd app/code/ # Change directory to app/code/unzip ProfStep.zip # Extract modules from archivels -la | grep ProfStep # To display a list of modules -
To enable module, please, run the following commands in Magento 2 root folder:
Terminal window php bin/magento mod:en ProfStep_Core ProfStep_Quotation # To enable modulesphp bin/magento setup:upgrade # Upgrade database schema.php bin/magento setup:di:compile # Start application code generationphp bin/magento setup:static-content:deploy # Generate static content
Via Composer (recommended)
Magento uses Composer to manage components and their dependencies. Using Composer you can easily download our modules.
Open CLI, then run these commands in the Magento 2 root folder:
-
Connect to your server. You can use WinSCP or SSH guides (they’re located above)
-
Add ProfStep composer repository by the following command:
Terminal window composer config repositories.profstep composer https://repo.profstep.com/ -
Please run the following commands in the server console to deploy a new extension:
Terminal window composer require profstep/module-quotation # Add this package to the composer.jsonphp bin/magento mod:en ProfStep_Core ProfStep_Quotation # To enable modulesphp bin/magento setup:upgrade # Upgrade database schema.php bin/magento setup:di:compile # Start application code generationphp bin/magento setup:static-content:deploy # Generate static contentWhen the first command has been executed, you may get the following message:
Specify your public key as username and private key as a password.
Install the ProfStep_Core module
Via Composer
Run the following commands in the Magento 2 root:
composer require profstep/module-corephp bin/magento mod:en ProfStep_Core # To enable Core modulephp bin/magento setup:upgrade # Upgrade database schema.php bin/magento setup:di:compile # Start application code generation