{"id":364,"date":"2025-04-15T16:30:00","date_gmt":"2025-04-15T15:30:00","guid":{"rendered":"https:\/\/davagordon.co.uk\/blog\/?p=364"},"modified":"2025-04-21T20:20:54","modified_gmt":"2025-04-21T19:20:54","slug":"how-to-apply-a-magento-2-patch-without-composer-step-by-step","status":"publish","type":"post","link":"https:\/\/davagordon.co.uk\/blog\/how-to-apply-a-magento-2-patch-without-composer-step-by-step\/","title":{"rendered":"How to Apply a Magento 2 Patch Without Composer (Step-by-Step)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Keeping your Magento 2 store secure and up to date is not just best practice, it\u2019s essential. Every unpatched vulnerability leaves your store open to potential exploits, risking customer trust and site stability. In this guide, you\u2019ll learn how to apply a <strong>Magento 2 patch<\/strong> manually, without using Composer to keep your store safe and running smoothly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide walks you through how to manually apply a Magento 2 patch (commonly provided in <code>.composer.patch<\/code> format), using the recent Adobe Commerce APSB24-40 security update as an example.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step-by-Step Guide to Manually Applying a Magento 2 Patch<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Download the Patch<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Visit Adobe&#8217;s official <a class=\"\" href=\"https:\/\/experienceleague.adobe.com\/docs\/release-notes\/experience-cloud\/current.html\">Security Bulletins<\/a> and navigate to the patch relevant to your Magento 2 version. For this guide, we\u2019ll reference:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd17 <a class=\"\" href=\"https:\/\/helpx.adobe.com\/security\/products\/magento\/apsb24-40.html\">Adobe Commerce APSB24-40 Patch<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Be sure to choose the patch that matches <strong>your exact Magento version<\/strong>, such as 2.4.6-p5 or 2.4.5-p6.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Unzip the Patch File<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once downloaded, unzip the <code>.zip<\/code> archive. Inside, you&#8217;ll typically find one or more files ending in <code>.composer.patch<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VULN-27015-2.4.6x.composer.patch<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Apply the Patch Manually<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SSH into your server<\/strong> and navigate to the Magento root directory<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/path\/to\/your\/magento2\/root<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">    2. <strong>Run the patch command<\/strong>: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>patch -p1 &lt; VULN-27015-2.4.6x.composer.patch<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the filename above with the actual name of your patch file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udca1 <strong>Note<\/strong>: The <code>-p1<\/code> option tells the patch command how to interpret file paths inside the patch. If you see \u201cfile not found\u201d errors, try adjusting the <code>-p<\/code> number (e.g., <code>-p0<\/code>, <code>-p2<\/code>) depending on your directory structure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Clear Cache and Recompile<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After applying the patch, clear Magento\u2019s cache and recompile (if necessary):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento cache:clean\nphp bin\/magento cache:flush\nphp bin\/magento setup:di:compile<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 5: Verify the Patch Was Successful<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t stop at applying the patch, <strong>validate<\/strong> it.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 Check your web server or Magento log files (<code>var\/log\/<\/code>, <code>var\/report\/<\/code>) for errors.<\/li>\n\n\n\n<li>\u2705 Test core store functionality: browsing, checkout, customer login, etc.<\/li>\n\n\n\n<li>\u2705 Run a security scan with <a class=\"\">Adobe\u2019s Security Scan Tool<\/a> or an external tool like <a class=\"\" href=\"https:\/\/www.magereport.com\/\">MageReport<\/a>.<\/li>\n\n\n\n<li>\u2705 Look at patch-specific files to confirm they were updated as expected.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Patch Management<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here are some key tips for staying ahead:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Test in staging first<\/strong>: Always apply patches in a staging environment before production.<\/li>\n\n\n\n<li><strong>Backup everything<\/strong>: Ensure both files and database are backed up.<\/li>\n\n\n\n<li><strong>Track patch history<\/strong>: Keep a log of which patches you\u2019ve applied and when.<\/li>\n\n\n\n<li><strong>Stay informed<\/strong>: Subscribe to <a class=\"\" href=\"https:\/\/experienceleague.adobe.com\/docs\/commerce-operations\/release\/patches.html\">Adobe Commerce Security Updates<\/a> and <a class=\"\" href=\"https:\/\/developer.adobe.com\/commerce\/\">Magento DevDocs<\/a> to stay ahead of new releases.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\ud83d\udd10 <a class=\"\" href=\"https:\/\/experienceleague.adobe.com\/docs\/commerce-operations\/security\/best-practices.html\">Adobe Commerce Security Best Practices<\/a><\/li>\n\n\n\n<li>\ud83e\uddf0 <a class=\"\" href=\"https:\/\/developer.adobe.com\/commerce\/security\/patches\/\">Magento DevDocs \u2013 Patch Info<\/a><\/li>\n\n\n\n<li>\ud83d\udce2 <a class=\"\" href=\"https:\/\/github.com\/magento\/magento2\/issues\">Magento GitHub for Community Patches<\/a><\/li>\n\n\n\n<li>\ud83d\udcac <a class=\"\" href=\"https:\/\/magento.stackexchange.com\/\">Magento Stack Exchange<\/a> \u2013 For troubleshooting and help from the community.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Applying Magento 2 patches is vital to safeguarding your store and customer data. Even if you&#8217;re not using Composer, you can still manually apply critical updates with a few simple terminal commands. Follow the steps above, test thoroughly, and make patching part of your regular maintenance routine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keeping your store secure isn\u2019t just a one-time task, it\u2019s an ongoing commitment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Keeping your Magento 2 store secure and up to date is not just best practice, it\u2019s essential. Every unpatched vulnerability leaves your store open to potential exploits, risking customer trust and site stability. In this guide, you\u2019ll learn how to apply a Magento 2 patch manually, without using Composer to keep your store safe and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":367,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,38,39],"tags":[],"class_list":["post-364","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-tips-insights-best-practices","category-security","category-web-development"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/posts\/364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=364"}],"version-history":[{"count":4,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/posts\/364\/revisions"}],"predecessor-version":[{"id":369,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/posts\/364\/revisions\/369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/media\/367"}],"wp:attachment":[{"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davagordon.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}