Magento is an open-source eCommerce store, it is used to manage your business process for selling a product with all functionalities like billing, shipping and we can also add a payment integration with Magento. In the article will see how to install a Magento in Docker environment with a step by step guide.
Docker is a development environment platform that uses an operating system(OS) level virtualization once an application is built and can be moved into production. Docker hub contains open-source images like PHP, MYSQL, Apache and we build our own container and pull to docker hub in this article will see step by step guide on how to install Magento 2 in docker below is a screenshot that shows ref representation of docker.
Application:- it contains source code of the application or packages example Magento 2 Application
Container OS: Docker is a container-based environment where we can download applications from a docker-hub and link to our application example Apache Server and MYSQL database below a screenshot of a docker container.
Operating System: Every application runs on a native platform, Docker is a Linux based application it also contains OS images we can pull into our docker environment Linux based OS like Ubuntu, centos applications are available in docker hub.
- Applications are installed in a root directory of an operating system.
- An application can be linked to another container with the help of docker-compose.yml file.
Hardware: It uses host hardware where you installed your docker environment. Docker can be installed in local machine windows or Linux and we can install docker on platforms like AWS, Azure and hosting services like Digital Ocean, the below screen shows the hardware used by a particular container is a local machine it shows CPU, Memory, hardware and Network usage.
In below steps will see step by step installation process of Magento and pull images from a docker hub
Step 1: Download docker file from Github
To download the docker file in your local machine make sure that Git is installed, to check git install in you machine enter the below command in PowerShell or cmd and press enter
- The below screen shows the git version.
- If it shows the error message click to install git in windows machine.
- Once git is installed, create one folder with name “sources” and open the same folder in cmd or PowerShell
- Enter the following command to download git file
- The following screen shows files downloaded successfully.
Step 2: Downloading the required image from docker hub.
To download images from a docker hub you need an account in docker hub and sign-in to docker application, we assume that you already have docker installed in your window machine or you can download the setup file by clicking here.
- To check docker version enter the below command in CMD
- The below screenshot shows the docker version
- In step 1, we have already downloaded the docker files from Github, the below docker file that we are going to build a container for Magento installation.
- “docker-compose .yml” file contains this code that images need to be installed.
- You can also change the MySQL password
- “docker-compose .yml” file contains this code that images need to be installed.
- Navigate to the download git file folder by entering following command
- The following screen shows we have entered into docker folder.
- Enter the below command to compose docker.
- The below screenshot shows files have been downloaded successfully.
- It takes a minimum of 15 times to download file-based your internet speed.
- The below screenshot shows the docker container is up and running
Step 4: Download Magento files
To download Magento files it is important to have login details of magento.com. Here we need to download the Magento as shown in the below screenshot select the version and click on download.
Step 5: Magento installation Steps
- In step 4 we have downloaded the setup file now we need to create a folder in a “sources”,
- Create a folder with “magento”
- Now extract the files in the “magento” folder.
Create a database for Magento
- To create a database in MySQL enter the below URL in your browser “127.0.1.1:8080″
- Enter the user name password.
- User Name: root
- Password: giaphugroup
- Once log-in to PHPMyAdmin, click on “new” and enter database name “magento2”, as shown in the screen below.
- Enter the local IP address “127.0.1.1” in the browser and click on “Magento” as shown in below screenshot.
- Once you click on the Magento it will redirect to the installation wizard as shown below screen.
- to install Magento in need to perform the following steps
- Readiness Check
- Add a Database
- Web Configuration
- Customize Your Store
- Create Admin Account
- Install
- Click on the “Agree and Setup Magento” you will be navigated to the below screens, now click “Start readiness check”
- As shown in the below screenshot “Readiness Check” is ok now click on “Next” button.
- Now we need to add a database connection as shown below screen and enter required detail and click on next
- Database Server Host : MySQL
- Database Server Username: root
- Database Server Password :***************
- Database Name:magento2
- In this step, we need to add a “web configuration” details and click on the Next button. you want to change the log-in to admin URL, you can make changes here
- In this step, we need to select the time zone and currency and language as shown below screen.
- In this step we need Create Admin Account as shown in the screen below, enter the required details username,email, password.
- All steps are completed, now click on the “Install Now” button.
- The below screen shows the install process and it will take some time.
- As shown in the screenshot below, the Magento installation is successful.
- The following screen shows the admin log-in page.
- The following screen shows the Magento administrator dashboard.
Hope this article help you set-up your Magento environment on your machine.
Who are we
We are passionate about SAP consulting and executing SAP Integration projects. Reach out to us for a free assessment of your SAP needs.
The post How to install Magento 2 on Docker first appeared on Veon Consulting.