Skip to content

magenx/Magento-2-server-installation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Magento 2 installation - Magenx e-commerce webstack

Debian 12 13 | Ubuntu 22.04 24.04

Production ready + AWS Graviton2 ARM support

get your $100 credit and deploy on DigitalOcean

πŸš€ Installation:

curl -Lo magenx.sh https://magenx.sh && bash magenx.sh
magenx_magento_installation_intro.mp4

you can run in screen to have indestructible session:

apt install -y screen
screen
bash magenx.sh

System requirements:

Dedicated server / Container
8Gb RAM
*like DigitalOcean cloud servers

πŸ’Ύ MagenX ecommerce webstack for Magento 2 Open Source

Get a fully pre-configured server with Magento and LEMP stack in just 10 minutes! πŸš€

  • Linux system packages with automatic updates
  • Initial system optimization and hardening
  • Varnish HTTPS cache setup
  • MariaDB my.cnf optimization
  • Nginx optimized config with security
  • OpenSearch 2.x latest
  • PHP-FPM (apcu, opcache, lzf, snappy, redis)
  • Redis Magento Cache and Sessions (2 instances)
  • RabbitMQ message queue
  • Letsencrypt/certbot configuration
  • Separate Magento files owner and php-fpm user
  • Advanced ACL linux permissions, read/write protection
  • Chroot configuration: jailed ssh and php user (optional)

Extra premium options available:

  • Multiple environments
  • Webmin control panel
  • SFTP advanced configuration
  • SSH private key access ready
  • ConfigServer Security and Firewall advanced configuration
  • Nginx and CSF Firewall DDOS mitigation
  • Nginx and CSF Firewall Carding Attack mitigation
  • MariaDB database optimization
  • Mytop database monitoring
  • Proxysql split database / custom port
  • n98-magerun2 Magento 2 cli management
  • PhpMyAdmin custom path with http auth
  • Goaccess nginx log visualization
  • Malware scanner (maldet) with email alerts
  • Auditd Magento 2 files monitoring
  • Automatic nginx images optimization
  • Magento 2 logs rotation
  • PWA Studio ready
  • Hyva Theme ready
  • Ready for production.

Complete linux stack including:

  • linux and webstack settings optimization
  • letsencrypt
  • iotop
  • sysstat
  • git/svn
  • strace
  • python-pip
  • iptraf
  • nginx images optimization
  • geoip
  • logs rotation
  • separate permissions for nginx and php user
  • nodejs for development
  • and many more

πŸ”‘ Environment / Magento mode:

The script configures webstack, users, folders, and all settings for a given environment. Productions mode. Read-only. Linux ACL

πŸ“„ Get config:

All configuration parameters saved in sqlite database.

sqlite3 -line /opt/magenx/config/magenx.db "SELECT * FROM magento;"
sqlite3 -line /opt/magenx/config/magenx.db "SELECT * FROM system;"

πŸ›‘οΈ SSL / HTTPS:

Once up and running, set up SSL with certbot (already installed):
certbot certonly --agree-tos --no-eff-email --email {EMAIL} --webroot -w /home/{USER}/public_html/pub
and uncomment the lines for SSL in:

  • /etc/nginx/nginx.conf
  • /etc/nginx/sites-available/{DOMAIN_NAME}.conf

πŸ› οΈ DevOps idea:

You have the opportunity to install a new Magento 2, and it is best to do this in a staging environment. Push the code to your Github repository and from there develop and deploy to production and staging environment using Github Actions.
This is the safest and most productive approach. There are few configuration files available for Github Actions [paid extra] deployments:

  • /opt/deploy/deploy.py - basic script to catch Github Actions deployment input and run zero-downtime deployment
  • ~/.env - magento 2 environment variables
  • ~/.ssh/authorized_keys - pre-configured ssh keys

Deployment Flow:

  • Create release time folder 202508211230 (date example)
  • Symlink shared files into new release
  • Extract new version to releases/202508211230/
  • Atomically switch current symlink to new release
  • Remove old releases (keep last 2-3)
/home/USER/
β”œβ”€β”€ current -> releases/202508211230/    # Symlink to active version
β”œβ”€β”€ releases/                            # All deployed versions
β”‚   β”œβ”€β”€ 202508211030/                    # Previous release
β”‚   └── 202508211230/                    # Current release
└── shared/                              # Persistent data
    β”œβ”€β”€ var                              # Logs, tmp (symlink from active version)
    └── pub/media/                       # Uploads, images (symlink from active version)

Minimal Explanation:

  • current β†’ Symlink pointing to the active release
  • releases/ β†’ Contains all versioned deployments
  • shared/ β†’ Holds persistent files across deployments

This gives you zero-downtime deployments and instant rollbacks.

You can use tools that help you implement the folder-based atomic deployment structure (with current, releases, shared directories) on your own server.

🧰 Tools:

[you can use the following free included]:

  • Magento 2 deployment pipeline - Fully automated Magento 2 development and deployment pipeline with code review, composer check and pre-release => release workflow | MVP
    [ just create your own repository, add your magento files, copy only .github folder to your reposity, it will auto init ]
  • sudo cacheflush - to flush magento cache and restart php-fpm / nginx
  • mysqltuner - to see mysql metrics and parameters
  • mytop - database query monitoring / management
  • n98-magerun2 - magento 2 extented cli
  • magento profiler built in nginx security header - conf_m2/maps.conf

[paid deployment tools]:

  • deploy.py
  • deploy.sh
  • collection of scripts and server settings to enabple zero-downtime remote deployments

😻 Support the project

You can use this for free. But its not free to create it. This takes time and research.
If you are using this project, there are few ways you can support it:

deniszokov_paypal_qrcode

❀️ Opensource