|
If you find my work valuable, please consider sponsoring |
devenv it's a powerful development environment based on NixOS.
It allows you to have containerized environments without containers or hypervisor or emulation, with native performance on any platform.
This is by far the fasted Magento/Openmage development environment I've ever worked with and it's more than worth of the time to learn it.
This repo has a basic (and yet complete) OpenMage project installed via composer and all of the necessary software stack:
- PHP 8.4 (managed by PHP-FPM and served by Caddy)
- MariaDB 11.4
- Redis
- OpenSearch
- Xdebug
- MailHog for email testing
- n98-magerun2
This branch is only compatible with Magento 2.4.8.
- If you don't have devenv/NixOS installed please follow devenv's installation guide, it's actually pretty easy and straightforward.
- Then clone this repository to have all the configuration files on your machine
- Start all services with
devenv up - Open another terminal
- Enter the development environment shell with
devenv shell - Create the magento project in the magento2 folder with composer
composer create-project --repository-url=https://mirror.mage-os.org/ magento/project-community-edition:2.4.8 magento2 cd magento2composer install- Install sample data if you want
bin/magento setup:install --base-url='http://magento2.test' --db-host='127.0.0.1' --db-user='magento2' --db-password='magento2' --db-name='magento2' --admin-firstname='admin' --admin-lastname='admin' --admin-email='[email protected]' --admin-user='admin' --admin-password='admin123' --language='en_US' --currency='EUR' --timezone='Europe/Rome' --use-rewrites='1' --backend-frontname='admin' --session-save-redis-host='127.0.0.1' --session-save-redis-port='6379' --session-save-redis-db='0' --cache-backend-redis-server='127.0.0.1' --cache-backend-redis-port='6379' --cache-backend-redis-db='1' --page-cache-redis-server='127.0.0.1' --page-cache-redis-port='6379' --page-cache-redis-db='2' --elasticsearch-host='127.0.0.1' --elasticsearch-port='9200'
- Enter the project folder
- run
devenv upto start all the software stack - run
devenv shellto enter a shell with all softwares configured properly (like n98-magerun2)
At the moment the project is configured with http://magento2.test as the main domain name (you can change it in the devenv.nix file), so you'll have to add magento2.testto your hosts file first, then you'll be able to open the browser to http://magento2.test.