Dockerized Magento 2.4.4 in 4 Steps

We’ll be providing handy tips, tricks, and integrations for Magento now and...
by Greg Bulmash | July 29, 2022

We’ll be providing handy tips, tricks, and integrations for Magento now and then in this blog and it’s nice to have a clean, no-risk local environment where you can experiment risk free with something easy to toss and replace. Here’s a quick guide to setting one up in under 20 minutes (depending on your download speeds).

What you’ll have at the end:

  • A containerized system running Magento 2.4.4 that you can start and stop as you need.

What you’ll need to get started:

  • Docker Desktop or the Docker CLI with docker-compose.
  • Docker Desktop on Mac M1 threw an error on the first try because too little memory was allocated. In Docker Desktop, go into the settings, select the Resources tab, and allocate 6 GB. You’ll need to restart Docker to make it work.
  • Git
  • Curl
  • Your Magento access keys (pull them up in a browser window before starting this)

The installation of the first three will depend on your system.

Step 1:

Create a directory where your docker files will live. Open a terminal and CD into it.

Step 2:

We’ll use Mark Shust’s handy-dandy installer. In the terminal, enter the following and hit enter.

curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.4

During the process it may ask you to enter your system credentials to approve an elevation to create an entry in your hosts file and install a Root Certificate Authority (Root CA) to prevent your browser from issuing scary warnings when you try to access the site.

It will also ask for your Magento Access Keys (see above) from the Magento Marketplace so it can download the latest version of Magento itself.

At this point, Magento will be up and running. But there are more steps to fully “enjoy” it.

Step 3:

Because this runs in development mode, the emails you’ll need to establish two-factor authorization for the administrative login will not get sent. In the terminal, enter:

bin/magento module:disable Magento_TwoFactorAuth

Now you can go to to https://magento.test/admin and login with: john.smith/password123

It is highly advisable you create a new admin login and delete this one.

Step 4: (optional)

What’s a store without products? To import the sample data, run these commands in the terminal you opened for the installation. The setup process installs a bin directory with helper functions so you can send commands into the containers without having to know the Docker commands to do so.

Run:

bin/magento sampledata:deploy

This will take a while. When it completes, run:

bin/magento setup:upgrade

Closing thoughts

To shut down the virtualized system of containers, in your install directory, run:

bin/stop

To start them again, in the same directory:

bin/start

Thanks for reading. We’ll use this setup again, so follow us on LinkedIn as we will post when new blogs come out, or subscribe in the form in our blog sidebar.

Popular posts

by Jose Kunnappally | August 22, 2022

Ecommerce Holiday Shopping 2022: What to Expect and...

by Jose Kunnappally | April 18, 2022

The Global Ecommerce Security Report 2022

by Jose Kunnappally | January 12, 2022

How a CDN can boost your Core Web...

by PAUL BRISCOE | January 11, 2022

3 Ways to Write Better Caching Modules in...

Stay up to date with Webscale
by signing up for our blog subscription

Recent Posts

by Daniel Bartholomew | September 25, 2023

Supercharging LLMs with Supercloud

Supercloud, characterized by a decentralized and distributed architecture, has the potential to revolutionize cloud computing. This paradigm shift could have far-reaching implications for Large Language Models (LLMs), such as ChatGPT,...
by Daniel Bartholomew | August 27, 2023

Key Kubernetes and Edge Trends to Watch

Daniel Bartholomew, Webscale's Chief Product Officer, has shared his insights on four noteworthy trends to monitor within the realms of Kubernetes, container orchestration, and the expanding landscape of edge computing....
by Daniel Bartholomew | July 31, 2023

Prometheus Querying – Breaking Down PromQL

Prometheus has its own language specifically dedicated to queries called PromQL. It is a powerful functional expression language, which lets you filter with Prometheus’ multi-dimensional time-series labels. The result of each...