Set up a Magento Open Source Development Store
Magento Open Source is the free, open-source version of Adobe Commerce (formerly known as Magento 2) and is a good option for merchants or agencies that want to test their Bold Checkout integration.
This document outlines the basic requirements and instructions for setting up a Magento Open Source development store locally, using Magento version 2.4.6.
Prerequisites
Before you get started, ensure that you have the following:
Installation
The following instructions outline the steps for running a Magento Open Source development store locally:
-
Create an account in the Adobe Commerce Marketplace.
-
Get your Adobe Commerce authentication keys.
-
Open your preferred command line interface. This guide includes commands formatted for the Terminal command line on Mac.
-
Create and open a folder for your store using the following command:
mkdir m2.4-dev && cd m2.4-dev
-
Clone the Magento repository using the following command:
curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
noteThis repository is a popular Docker-based development environment for Magento Open Source. This repository is not managed or formally endorsed by Bold.
-
Download and set up Magento 2.4.6.
-
Run the following command:
bin/download 2.4.6 community
noteRefer to the Troubleshooting section for help with any errors that arise from running this command.
-
When prompted to enter your
username|password
, provide your Adobe Commerce credentials in the formatpublic_key|private_key
.
-
-
Connect your port forwarding service to Magento Open Source.
- Run the following command:
For example, if your
bin/setup {tunnel_domain}
tunnel_domain
isjohn-doe.adobetest.com
, then you would run the following command:bin/setup john-doe.adobetest.com
- Input your system password when prompted.
- Run the following command:
-
Remove your domain from the hosts file on your machine in order to route through your port forwarding service.
- Open the hosts file using the following command:
code /etc/hosts
- Remove the line with your domain. Save and close the file.
- Open the hosts file using the following command:
-
Disable two-factor authentication on your admin login. Run the following command:
bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth && bin/magento module:disable Magento_TwoFactorAuth
noteThis step is necessary to access admin settings from the command line.
-
Add test data to your store using the following command:
bin/magento sampledata:deploy && bin/magento setup:upgrade
-
Set up an connect a Cloudflare tunnel using the following instructions:
- Create a tunnel using Cloudflare Zero Trust.
- In your Cloudflare Tunnel configuration, configure the service URL to use type HTTPS and a URL of
{name of app container}:{HTTPS port of app container}
. For example,demo-app-1:8443
. Enable the No TLS Verify option, since our local certificates are self-signed. - Add a service token to
env/cloudflare.env
. - Uncomment Cloudflare Tunnel section in main
compose.yaml
. - Restart the containers with bin/restart.
- You should now be able to access your app via the public hostname defined in Cloudflare Tunnel.
Troubleshooting
This section includes information about how to resolve several common errors during the installation process.
Port is already allocated
Error:
Error response from daemon: driver failed programming external connectivity on endpoint……….port is already allocated. Failed to start Docker services
Troubleshooting steps:
- Run
bin/removeall
to remove other containers on the same port. - Run
bin/download 2.4.6 community
again.
SSL certificate problem
Error:
SSL certificate problem: unable to get local issuer certificate
Troubleshooting steps:
- Turn off VPN or other internet filtering software.
- Run
bin/removeall
. - Run
bin/download 2.4.6 community
again.
Unexpected Value Exception
Error:
[UnexpectedValueException] ‘/var/www/html/vendor/composer/tmp-58a8acb411b99b6d5a14cec052698eb1’ is not a zip archive.
Troubleshooting steps:
- Run
composer clear-cache
. - Run
composer global update
. - Run
bin/removeall
. - Run
bin/download 2.4.6 community
again.