How to Install Magento Open Source on Your Breeze
Magento Open Source (formerly Magento Community Edition) is a feature-rich e-commerce platform that powers online stores of all sizes. With flexible catalog management, powerful search, and extensive customization options, it is one of the most capable open-source e-commerce solutions available. This guide covers installing Magento on your Breeze instance.
Prerequisites
- A Breeze instance with at least 4 GB RAM (8 GB recommended)
- Ubuntu 22.04 with root access
- PHP 8.2 with required extensions
- MySQL 8.0 or MariaDB 10.6+
- Elasticsearch 8.x or OpenSearch
- Composer 2.x installed globally
Step 1 — Install Dependencies
Magento has extensive system requirements. Install all needed PHP extensions:
sudo apt update
sudo apt install -y php-bcmath php-ctype php-curl php-dom php-gd php-iconv \
php-intl php-mbstring php-mysql php-simplexml php-soap php-xsl php-zip \
php-sockets php-tokenizer php-xmlwriter php-opcache
Install and start Elasticsearch:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt update && sudo apt install -y elasticsearch
sudo systemctl enable --now elasticsearch
Step 2 — Create the Database
sudo mysql -u root -p
CREATE DATABASE magento_db;
CREATE USER 'magento_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON magento_db.* TO 'magento_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 3 — Download Magento via Composer
You need Magento Marketplace credentials. Get your public and private keys from your Magento Marketplace account, then:
cd /var/www
composer create-project --repository-url=https://repo.magento.com/ \
magento/project-community-edition magento
When prompted, enter your public key as the username and private key as the password.
Step 4 — Run the Magento Installer
cd /var/www/magento
bin/magento setup:install \
--base-url=http://yourdomain.com \
--db-host=localhost \
--db-name=magento_db \
--db-user=magento_user \
--db-password=secure_password \
--admin-firstname=Admin \
--admin-lastname=User \
--admin-email=admin@yourdomain.com \
--admin-user=admin \
--admin-password=Admin123! \
--language=en_US \
--currency=USD \
--timezone=America/New_York \
--search-engine=elasticsearch8 \
--elasticsearch-host=localhost \
--elasticsearch-port=9200
Step 5 — Set Permissions and Deploy
sudo chown -R www-data:www-data /var/www/magento
sudo find /var/www/magento -type d -exec chmod 775 {} \;
sudo find /var/www/magento -type f -exec chmod 664 {} \;
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
Step 6 — Configure the Web Server
Set up your Apache or Nginx virtual host pointing to /var/www/magento/pub as the document root. Enable mod_rewrite and configure the virtual host with AllowOverride All. Set up cron jobs for Magento:
crontab -u www-data -e
# Add:
* * * * * /usr/bin/php /var/www/magento/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/log/magento_cron.log
Performance Tips
- Enable Redis for session and cache storage to significantly improve performance
- Use Varnish as a full-page cache reverse proxy
- Enable PHP OPcache and tune memory settings for Magento workloads
- Run
bin/magento deploy:mode:set productionfor live sites