{"id":13415,"date":"2026-11-16T11:57:04","date_gmt":"2026-11-16T06:27:04","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=13415"},"modified":"2026-11-16T11:57:29","modified_gmt":"2026-11-16T06:27:29","slug":"magento-2-setup-guide","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/magento-2-setup-guide\/","title":{"rendered":"Magento 2 Setup Guide: Install Magento 2.4.9 on Ubuntu in 9 Steps"},"content":{"rendered":"\n<h2 id=\"introduction\" class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This <strong>Magento 2 setup guide<\/strong> walks you through installing Magento Open Source 2.4.9 on a fresh Ubuntu server, one step at a time. Magento 2 is one of the most powerful open-source eCommerce platforms. It gives you full control over your catalog, checkout, themes, and integrations, but only when the server stack under it is set up correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Most failed Magento installations come from small mistakes: the wrong PHP version, a missing PHP extension, a search engine that is not running, or wrong file permissions. In this guide, we will install every required service in the right order, using the versions Adobe has tested, so you can install Magento 2.4.9 without surprises.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is <strong>Day 1<\/strong> of our Magento and eCommerce series. In the coming days, we will build on this installation to configure the store, products, payments, themes, performance, and security.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Key takeaways:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Magento 2.4.9 is tested with <strong>PHP 8.5, MariaDB 12.3 or MySQL 8.4, OpenSearch 3, Composer 2.10, and Nginx 1.30<\/strong>.<\/li>\n\n\n\n<li>Install Magento with <strong>Composer<\/strong>, using your free access keys from Commerce Marketplace.<\/li>\n\n\n\n<li>Run the installation with the <strong>bin\/magento setup:install<\/strong> command, not through a browser.<\/li>\n\n\n\n<li>Set up <strong>cron jobs<\/strong> right after installation, or indexing, emails, and scheduled tasks will not run.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>On This Page<\/h2><nav><ul><li class=\"\"><a href=\"#introduction\">Introduction<\/a><\/li><li class=\"\"><a href=\"#why-a-correct-magento-2-setup-matters\">Why a Correct Magento 2 Setup Matters<\/a><\/li><li class=\"\"><a href=\"#prerequisites-for-the-magento-2-setup\">Prerequisites for the Magento 2 Setup<\/a><\/li><li class=\"\"><a href=\"#9-steps-to-install-magento-2-4-9-on-ubuntu\">9 Steps to Install Magento 2.4.9 on Ubuntu<\/a><\/li><li class=\"\"><a href=\"#common-magento-2-setup-mistakes-to-avoid\">Common Magento 2 Setup Mistakes to Avoid<\/a><\/li><li class=\"\"><a href=\"#conclusion\">Conclusion<\/a><\/li><li class=\"\"><a href=\"#faqs\">FAQs<\/a><\/li><li class=\"\"><a href=\"#related-articles\">Related Articles<\/a><\/li><li class=\"\"><a href=\"#official-documentation\">Official Documentation<\/a><\/li><li class=\"\"><a href=\"#talk-to-magento-experts\">Talk to Magento Experts<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 id=\"why-a-correct-magento-2-setup-matters\" class=\"wp-block-heading\">Why a Correct Magento 2 Setup Matters<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Magento 2 setup is not like a simple plugin-based website. It is a full PHP application that depends on a web server, PHP-FPM, a database, and a search engine working together. If one of them is the wrong version, the store may install but later break during upgrades, indexing, or checkout.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram-1024x576.png\" alt=\"Magento 2 setup architecture diagram showing Nginx 1.30, PHP 8.5-FPM, MariaDB 12.3, OpenSearch 3 and cron jobs for Magento 2.4.9 on Ubuntu\" class=\"wp-image-13421\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram-1024x576.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram-300x169.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram-768x432.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram-1536x864.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-architecture-diagram.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Magento comes in two editions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Magento Open Source:<\/strong> Free and self-hosted. It is the edition we install in this guide.<\/li>\n\n\n\n<li><strong>Adobe Commerce:<\/strong> The paid edition, with B2B features, advanced marketing tools, and Adobe support.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Both editions use the same installation process. A clean, well-planned Magento 2 setup on day one saves hours of troubleshooting later, and it gives you a stable base for themes, extensions, and performance tuning.<\/p>\n\n\n\n<h2 id=\"prerequisites-for-the-magento-2-setup\" class=\"wp-block-heading\">Prerequisites for the Magento 2 Setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you start the Magento 2 setup, make sure you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Server:<\/strong> Ubuntu 24.04 LTS (64-bit) with at least 4 GB RAM and 2 CPU cores. Magento needs at least 2 GB RAM for upgrades, so add a swap file on smaller servers.<\/li>\n\n\n\n<li><strong>Access:<\/strong> SSH access with a user that has sudo rights.<\/li>\n\n\n\n<li><strong>Domain:<\/strong> A domain or subdomain (for example, shop.example.com) pointed to your server&#8217;s IP address.<\/li>\n\n\n\n<li><strong>Magento access keys:<\/strong> A free Commerce Marketplace account to generate your public and private access keys.<\/li>\n\n\n\n<li><strong>Basic knowledge:<\/strong> Working with the Linux command line and editing files with nano or vi.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Adobe supports only Linux x86-64 for Magento. Microsoft Windows and macOS are not supported as host operating systems, so use a Linux server, a virtual machine, or Docker for local work.<\/p>\n\n\n\n<h2 id=\"9-steps-to-install-magento-2-4-9-on-ubuntu\" class=\"wp-block-heading\">9 Steps to Install Magento 2.4.9 on Ubuntu<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps-1024x576.png\" alt=\"Magento 2 setup guide flowchart of the 9 steps to install Magento 2.4.9 on Ubuntu, from server update to cron and admin login\" class=\"wp-image-13422\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps-1024x576.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps-300x169.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps-768x432.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps-1536x864.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide-9-steps.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Before you install Magento 2.4.9, check the software versions Adobe has tested for on-premises installations. We will install these versions.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Software<\/th><th>Version for Magento 2.4.9<\/th><\/tr><\/thead><tbody><tr><td>PHP<\/td><td>8.5<\/td><\/tr><tr><td>MariaDB \/ MySQL<\/td><td>MariaDB 12.3 or MySQL 8.4<\/td><\/tr><tr><td>OpenSearch<\/td><td>3<\/td><\/tr><tr><td>Composer<\/td><td>2.10<\/td><\/tr><tr><td>Nginx<\/td><td>1.30<\/td><\/tr><tr><td>Valkey (cache, optional)<\/td><td>9<\/td><\/tr><tr><td>Varnish (page cache, optional)<\/td><td>8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Update the Server and Install Basic Tools<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start the Magento 2 setup by logging in to your server over SSH and updating the system packages.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update &amp;&amp; sudo apt upgrade -y\nsudo apt install -y software-properties-common ca-certificates curl gnupg2 lsb-release unzip git<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a dedicated file system owner for Magento and add it to the web server group:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo adduser magento\nsudo usermod -aG www-data magento<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Install the Nginx Web Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To install Magento on Ubuntu, you first need a web server. Install Nginx and enable it to start on boot:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install -y nginx\nsudo systemctl enable --now nginx\nnginx -v<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The Ubuntu repository may ship an older Nginx version. If you need the exact tested version (1.30), add the official Nginx repository from nginx.org before you install.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Install PHP 8.5 and the Required Extensions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu 24.04 does not include PHP 8.5 by default, so add the widely used Ond\u0159ej Sur\u00fd PPA and install PHP-FPM with the extensions Magento needs:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo add-apt-repository ppa:ondrej\/php -y\nsudo apt update\nsudo apt install -y php8.5-fpm php8.5-cli php8.5-common php8.5-mysql \\\n  php8.5-xml php8.5-mbstring php8.5-curl php8.5-zip php8.5-gd \\\n  php8.5-intl php8.5-bcmath php8.5-soap php8.5-xsl\nphp -v<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, update the PHP settings that your Magento 2 setup needs. Magento requires at least 2 GB of memory for installation and Composer commands.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">for INI in \/etc\/php\/8.5\/fpm\/php.ini \/etc\/php\/8.5\/cli\/php.ini; do\n  sudo sed -i 's\/^memory_limit = .*\/memory_limit = 2G\/' $INI\n  sudo sed -i 's\/^max_execution_time = .*\/max_execution_time = 1800\/' $INI\n  sudo sed -i 's\/^zlib.output_compression = .*\/zlib.output_compression = On\/' $INI\n  sudo sed -i 's\/^;\\?realpath_cache_size = .*\/realpath_cache_size = 10M\/' $INI\n  sudo sed -i 's\/^;\\?realpath_cache_ttl = .*\/realpath_cache_ttl = 7200\/' $INI\ndone\nsudo systemctl restart php8.5-fpm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify the new memory limit:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php -i | grep memory_limit<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">memory_limit =&gt; 2G =&gt; 2G<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Install MariaDB 12.3 and Create the Magento Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Running Magento 2.4.9 on Ubuntu needs a supported database. Use the official MariaDB repository setup script to install the tested version:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -LsSO https:\/\/r.mariadb.com\/downloads\/mariadb_repo_setup\nchmod +x mariadb_repo_setup\nsudo .\/mariadb_repo_setup --mariadb-server-version=\"mariadb-12.3\"\nsudo apt update\nsudo apt install -y mariadb-server\nsudo mariadb-secure-installation<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now create a database and a database user for Magento. Replace <strong>StrongDbPass@123<\/strong> with your own strong password.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mariadb -e \"CREATE DATABASE magento;\nCREATE USER 'magento'@'localhost' IDENTIFIED BY 'StrongDbPass@123';\nGRANT ALL PRIVILEGES ON magento.* TO 'magento'@'localhost';\nFLUSH PRIVILEGES;\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> You can use MySQL 8.4 instead of MariaDB. Do not install both on the same server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Install OpenSearch 3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You cannot install Magento 2.4.9 without a search engine, because Magento uses OpenSearch for catalog search. The installation fails if OpenSearch is not running. Add the official OpenSearch APT repository:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mkdir -p \/etc\/apt\/keyrings\ncurl -fsSL https:\/\/artifacts.opensearch.org\/publickeys\/opensearch-release.pgp \\\n  | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/opensearch.gpg\necho \"deb [signed-by=\/etc\/apt\/keyrings\/opensearch.gpg] https:\/\/artifacts.opensearch.org\/releases\/bundle\/opensearch\/3.x\/apt stable main\" \\\n  | sudo tee \/etc\/apt\/sources.list.d\/opensearch-3.x.list\nsudo apt update<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a development or test server, install OpenSearch with the Security plugin disabled so Magento can connect over plain HTTP on localhost:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo env DISABLE_SECURITY_PLUGIN=true apt install -y opensearch\nsudo systemctl enable --now opensearch\ncurl -X GET http:\/\/localhost:9200<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The last command should return a JSON response with &#8220;distribution&#8221; : &#8220;opensearch&#8221; and the version number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Disabling the Security plugin is only for development or test servers where OpenSearch is not reachable from outside. For production, keep the Security plugin enabled, use your own TLS certificates, and pass the <code>--opensearch-enable-auth<\/code>, <code>--opensearch-username<\/code>, and <code>--opensearch-password<\/code> options during installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Install Composer and Get Your Magento Access Keys<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Install Composer globally:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd ~\ncurl -sS https:\/\/getcomposer.org\/installer -o composer-setup.php\nsudo php composer-setup.php --install-dir=\/usr\/local\/bin --filename=composer\ncomposer --version<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create your Magento access keys:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to Commerce Marketplace with your Adobe account.<\/li>\n\n\n\n<li>Go to <strong>My Profile &gt; Access Keys<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Create A New Access Key<\/strong> and give it a name.<\/li>\n\n\n\n<li>Copy the <strong>Public Key<\/strong> (used as the username) and the <strong>Private Key<\/strong> (used as the password).<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Keep your private key secret. Do not commit it to Git or share it in screenshots.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Download Magento 2.4.9 with Composer<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create the installation directory and give ownership to the magento user:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mkdir -p \/var\/www\/magento2\nsudo chown magento:www-data \/var\/www\/magento2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Switch to the magento user and download Magento Open Source 2.4.9. This is the core step to install Magento on Ubuntu with Composer:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo su - magento\ncd \/var\/www\/magento2\ncomposer create-project --repository-url=https:\/\/repo.magento.com\/ magento\/project-community-edition=2.4.9 .<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When Composer asks for a username and password, enter your <strong>public key<\/strong> and <strong>private key<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the download finishes, set the file permissions Magento needs:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/var\/www\/magento2\nfind var generated vendor pub\/static pub\/media app\/etc -type f -exec chmod g+w {} +\nfind var generated vendor pub\/static pub\/media app\/etc -type d -exec chmod g+ws {} +\nchmod u+x bin\/magento<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Run the Magento 2 Installation Command<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Still as the magento user, run <strong>setup:install<\/strong>. Replace the domain, database password, and admin details with your own values.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">bin\/magento setup:install \\\n--base-url=http:\/\/shop.example.com\/ \\\n--db-host=localhost \\\n--db-name=magento \\\n--db-user=magento \\\n--db-password='StrongDbPass@123' \\\n--admin-firstname=Store \\\n--admin-lastname=Admin \\\n--admin-email=admin@example.com \\\n--admin-user=storeadmin \\\n--admin-password='Admin@Pass2026' \\\n--language=en_US \\\n--currency=INR \\\n--timezone=Asia\/Kolkata \\\n--use-rewrites=1 \\\n--search-engine=opensearch \\\n--opensearch-host=localhost \\\n--opensearch-port=9200 \\\n--opensearch-index-prefix=magento2 \\\n--opensearch-timeout=15<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Magento 2 setup command takes a few minutes. At the end, you will see output similar to this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[SUCCESS]: Magento installation complete.\n[SUCCESS]: Magento Admin URI: \/admin_1a2b3c<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the <strong>Admin URI<\/strong>. Magento generates a random admin path, which is harder for attackers to guess.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Do not run <code>setup:install<\/code> as the root user. Always run <code>bin\/magento<\/code> commands as the file system owner (the magento user in this guide) to avoid permission problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 9: Configure Nginx, Cron Jobs, and Log In to the Admin<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Exit back to your sudo user and create an Nginx virtual host. Magento ships a ready-made Nginx configuration file called <code>nginx.conf.sample<\/code>, so you only need a small server block:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">exit\nsudo nano \/etc\/nginx\/sites-available\/magento<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"nginx\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">upstream fastcgi_backend {\n    server unix:\/run\/php\/php8.5-fpm.sock;\n}\n\nserver {\n    listen 80;\n    server_name shop.example.com;\n    set $MAGE_ROOT \/var\/www\/magento2;\n    include \/var\/www\/magento2\/nginx.conf.sample;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable the site, test the configuration, and reload Nginx:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo ln -s \/etc\/nginx\/sites-available\/magento \/etc\/nginx\/sites-enabled\/\nsudo rm -f \/etc\/nginx\/sites-enabled\/default\nsudo nginx -t\nsudo systemctl reload nginx<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now install the Magento cron jobs as the magento user. Cron runs indexers, sends emails, and processes scheduled tasks.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo su - magento\ncd \/var\/www\/magento2\nbin\/magento cron:install\ncrontab -l<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a development server, switch to developer mode so you can see errors while you build:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">bin\/magento deploy:mode:set developer\nbin\/magento cache:flush<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, open your store in the browser to confirm that Magento 2.4.9 on Ubuntu is live:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Storefront:<\/strong> http:\/\/shop.example.com\/<\/li>\n\n\n\n<li><strong>Admin panel:<\/strong> http:\/\/shop.example.com\/admin_1a2b3c (use your own Admin URI)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Log in with the admin username and password you set in Step 8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Magento enables Two-Factor Authentication (2FA) for the admin by default, and the setup link is sent by email. Make sure your server can send email before you log in. On a local development server only, you can disable 2FA with <code>bin\/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth<\/code>, followed by <code>bin\/magento setup:upgrade<\/code>. Never disable 2FA on a live store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Before you go live, install an SSL certificate (for example, with Let&#8217;s Encrypt) and update the base URLs to HTTPS. We will cover this in a later article in this series.<\/p>\n\n\n\n<h2 id=\"common-magento-2-setup-mistakes-to-avoid\" class=\"wp-block-heading\">Common Magento 2 Setup Mistakes to Avoid<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Using an untested PHP version:<\/strong> Always match the PHP version to your Magento release.<\/li>\n\n\n\n<li><strong>Forgetting OpenSearch:<\/strong> The installer stops with a search engine connection error if OpenSearch is not running.<\/li>\n\n\n\n<li><strong>Running commands as root:<\/strong> This creates files that the web server cannot write to.<\/li>\n\n\n\n<li><strong>Skipping cron jobs:<\/strong> Indexes go out of date, and order emails are not sent.<\/li>\n\n\n\n<li><strong>Low memory:<\/strong> Composer and the installer fail on servers with less than 2 GB RAM and no swap.<\/li>\n\n\n\n<li><strong>Exposing OpenSearch publicly:<\/strong> Keep port 9200 closed to the internet.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"conclusion\" class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You now have a working Magento 2.4.9 store running on Ubuntu with Nginx, PHP 8.5, MariaDB 12.3, and OpenSearch 3. This Magento 2 setup gives you a clean, supported base to build your online store on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Quick recap:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Match every service to the versions Adobe tested for <strong>Magento 2.4.9<\/strong>.<\/li>\n\n\n\n<li>Install Magento with <strong>Composer<\/strong> and your Marketplace access keys.<\/li>\n\n\n\n<li>Run <strong>bin\/magento setup:install<\/strong> as the file system owner, never as root.<\/li>\n\n\n\n<li>Configure <strong>Nginx with nginx.conf.sample<\/strong> and install <strong>cron jobs<\/strong> right away.<\/li>\n\n\n\n<li>Secure the store with <strong>2FA, SSL, and a closed OpenSearch port<\/strong> before going live.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Bookmark this Magento 2 setup guide for your next server. In the next article of this series, we will explore the Magento 2 admin panel and the key settings every store owner should know.<\/p>\n\n\n\n<h2 id=\"faqs\" class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What are the system requirements for Magento 2.4.9?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Magento 2.4.9 is tested with PHP 8.5, MariaDB 12.3 or MySQL 8.4, OpenSearch 3, Composer 2.10, and Nginx 1.30 on a 64-bit Linux server. Valkey 9 and Varnish 8 are optional for caching.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Is Magento Open Source free to use?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Magento Open Source is free to download and use. You only pay for hosting, extensions, themes, and development. Adobe Commerce is the paid edition with extra B2B and marketing features.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Can I install Magento 2 without OpenSearch?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Magento 2.4 and later need a search engine to install and run. For Magento 2.4.9, Adobe tests OpenSearch 3.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. How long does a Magento 2 installation take?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On a prepared server, downloading Magento with Composer and running setup:install usually takes 10 to 30 minutes, depending on your server speed and internet connection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Can I install Magento 2 on Windows or macOS?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Not directly. Adobe supports only Linux x86-64. On Windows or macOS, use a Linux virtual machine or Docker for local development.<\/p>\n\n\n\n<h2 id=\"related-articles\" class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-enable-maintenance-mode-in-magento-2\/\">How to Enable Maintenance Mode in Magento and Customize the Maintenance Page<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-reset-the-admin-password-in-magento2-using-the-command-line-interface-tool\/\">How to Reset the Admin Password in Magento 2 Using the Command Line Interface Tool<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-resolve-the-autoload-error-while-installing-magento2-in-ubuntu-18-04-20-04\/\">How to Resolve the Autoload Error While Installing Magento 2 in Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-update-secure-and-unsecure-urls-directly-in-the-magento-database\/\">How to Update Secure and Unsecure URLs Directly in the Magento Database<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-set-up-and-install-stripe-in-magento-2\/\">How to Set Up and Install Stripe in Magento 2<\/a><\/li>\n<\/ul>\n\n\n\n<h2 id=\"official-documentation\" class=\"wp-block-heading\">Official Documentation<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/system-requirements\" target=\"_blank\" rel=\"noopener\">Adobe Commerce System Requirements<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/composer\" target=\"_blank\" rel=\"noopener\">Quick Start On-Premises Installation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/prerequisites\/authentication-keys\" target=\"_blank\" rel=\"noopener\">Get Your Authentication Keys<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/prerequisites\/web-server\/nginx\" target=\"_blank\" rel=\"noopener\">Install Nginx for On-Premises Deployments<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/advanced\" target=\"_blank\" rel=\"noopener\">Advanced On-Premises Installation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.opensearch.org\/latest\/install-and-configure\/install-opensearch\/debian\/\" target=\"_blank\" rel=\"noopener\">Installing OpenSearch on Debian and Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mariadb.com\/docs\/server\/server-management\/install-and-upgrade-mariadb\/installing-mariadb\/binary-packages\/mariadb-package-repository-setup-and-usage\" target=\"_blank\" rel=\"noopener\">MariaDB Package Repository Setup and Usage<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/getcomposer.org\/download\/\" target=\"_blank\" rel=\"noopener\">Download Composer<\/a><\/li>\n<\/ul>\n\n\n\n<h2 id=\"talk-to-magento-experts\" class=\"wp-block-heading\">Talk to Magento Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up Magento 2 the right way takes time, and one wrong version can cost you days of debugging. At <strong><a href=\"https:\/\/pheonixsolutions.com\/ecommerce\/\">Pheonix Solutions<\/a><\/strong>, our team builds, hosts, and maintains Magento stores for businesses of every size.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can help you with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/ecommerce\/\">eCommerce development<\/a> on Magento 2, from installation to a fully custom store.<\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/vps-hosting\/\">VPS hosting<\/a> and <a href=\"https:\/\/pheonixsolutions.com\/devops-cloud\/\">DevOps and cloud services<\/a> tuned for Magento performance.<\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/software-maintenance-and-support\/\">Software maintenance and support<\/a> for upgrades, security patches, and monitoring.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Planning a new Magento store or stuck in the middle of an installation? <a href=\"https:\/\/pheonixsolutions.com\/contact\/\">Talk to our Magento experts<\/a> and get your store set up correctly the first time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow this Magento 2 setup guide to install Magento 2.4.9 on Ubuntu in 9 steps with PHP 8.5, MariaDB, OpenSearch 3, Nginx, Composer, cron, and admin login.<\/p>\n","protected":false},"author":507,"featured_media":13416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1092,1022],"tags":[],"class_list":["post-13415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-ecommerce","category-web-architecture","psol-cat-magento-ecommerce"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-3un","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2026\/11\/magento-2-setup-guide.png","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/13415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/507"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=13415"}],"version-history":[{"count":8,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/13415\/revisions"}],"predecessor-version":[{"id":13431,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/13415\/revisions\/13431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media\/13416"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=13415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=13415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=13415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}