{"id":5011,"date":"2019-08-21T18:00:46","date_gmt":"2019-08-21T12:30:46","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5011"},"modified":"2026-10-29T12:29:35","modified_gmt":"2026-10-29T06:59:35","slug":"how-to-install-update-wordpress-automatically-without-using-ftp","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-install-update-wordpress-automatically-without-using-ftp\/","title":{"rendered":"How to Install \/ Update WordPress Automatically Without Using FTP"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date:<\/strong> August 21, 2019 <br><strong>Last Updated:<\/strong> October 29, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to update WordPress automatically without being asked for FTP details. When WordPress can&#8217;t write to its own files, it stops and shows a screen like this when you try to update a plugin, theme, or core:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">To perform the requested action, WordPress needs to access your web server.\nPlease enter your FTP credentials to proceed.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To update WordPress automatically, WordPress has to be able to write to its own folders. The WordPress FTP credentials prompt appears when it decides it can&#8217;t. The original guide suggested adding one line to <code>wp-config.php<\/code>, which can work, but it doesn&#8217;t fix the underlying problem and can leave you with &#8220;Could not create directory&#8221; errors instead. This version explains why the prompt appears and gives the safer fix first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you update WordPress automatically without FTP, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Shell (SSH) access to the server, or a hosting control panel with a file manager<\/li>\n\n\n\n<li>Administrator access to your WordPress dashboard<\/li>\n\n\n\n<li>A recent backup, since you&#8217;ll be changing file ownership and permissions<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Architecture<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you start an update, WordPress creates a small temporary file in <code>wp-content<\/code> and checks who owns it<\/li>\n\n\n\n<li>It compares that owner with the user PHP is running as, such as <code>www-data<\/code> or <code>apache<\/code><\/li>\n\n\n\n<li>If they match, WordPress writes files directly and updates straight away. If they don&#8217;t, it falls back to asking for the WordPress FTP credentials so it can write the files through an FTP login instead<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The image below shows how the check works when you try to update WordPress automatically. See the WordPress <a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/wordpress\/wp-config\/\" target=\"_blank\" rel=\"noopener\">wp-config.php documentation<\/a> for the constants involved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart-1024x576.png\" alt=\"\" class=\"wp-image-12653\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart-1024x576.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart-300x169.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart-768x432.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart-1536x864.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/WordPress-Update-Ownership-Flowchart.png 1672w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Update WordPress Automatically Without FTP<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Find Out Who Owns the Files and Who PHP Runs As<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check who owns your WordPress folders (adjust the path to your site):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">stat -c '%U:%G' \/var\/www\/html\/wp-content \/var\/www\/html\/wp-content\/plugins\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then check which user your web server and PHP run as:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ps aux | grep -E 'apache2|httpd|nginx|php-fpm' | grep -v grep | head\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the file owner and the PHP user are different, that&#8217;s why WordPress asks for FTP credentials.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Fix the File Ownership<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On a server you manage yourself, give the web server&#8217;s user ownership of the site. Use <code>www-data<\/code> on Debian and Ubuntu, or <code>apache<\/code> on CentOS and AlmaLinux:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo chown -R www-data:www-data \/var\/www\/html\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> On shared hosting, cPanel, or Plesk, PHP normally runs as your account&#8217;s own user, so you shouldn&#8217;t need to change ownership. If you still see the prompt there, files were probably uploaded or extracted as a different user. Ask your host to correct the ownership rather than changing it yourself.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">3. Set Safe Permissions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use WordPress&#8217;s recommended permissions, which are 755 for folders and 644 for files:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo find \/var\/www\/html -type d -exec chmod 755 {} \\;\nsudo find \/var\/www\/html -type f -exec chmod 644 {} \\;\nsudo chmod 600 \/var\/www\/html\/wp-config.php\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> The original suggested changing the folder permission to 775 instead of 755. That only helps if the web server&#8217;s user belongs to the folder&#8217;s group, so on its own it often does nothing. Never use 777, which lets every user on the server write to your site.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">4. Add FS_METHOD Only If WordPress Still Asks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you fixed the ownership and WordPress still shows the FTP prompt, force the direct method. Open <code>wp-config.php<\/code> and add this line <strong>above<\/strong> the comment that says &#8220;That&#8217;s all, stop editing!&#8221;:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">define( 'FS_METHOD', 'direct' );\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is the line that lets you update WordPress automatically when WordPress&#8217;s own detection gets it wrong. For example, it can happen when files are writable through group permissions but owned by a different user.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Notes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The original said to append the line at the end of the file. Constants should go above the &#8220;stop editing&#8221; line, before WordPress finishes loading its settings.<\/li>\n\n\n\n<li><code>FS_METHOD<\/code> doesn&#8217;t grant any permissions. It only tells WordPress to try writing directly. If PHP can&#8217;t actually write to the folders, you&#8217;ll get &#8220;Could not create directory&#8221; errors until Steps 2 and 3 are done properly.<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">5. Test an Update<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In the dashboard, go to <strong>Dashboard \u2192 Updates<\/strong> (or <strong>Plugins<\/strong>) and update a plugin. It should complete without asking for any FTP details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you still can&#8217;t update WordPress automatically, check these:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>&#8220;Could not create directory&#8221; or &#8220;Installation failed&#8221;:<\/strong> PHP can&#8217;t write to the folder. Recheck ownership and permissions from Steps 1 to 3<\/li>\n\n\n\n<li><strong>Updates are blocked entirely, with no prompt:<\/strong> look for <code>define( 'DISALLOW_FILE_MODS', true );<\/code> in <code>wp-config.php<\/code>. That constant switches off all plugin, theme, and core changes from the dashboard<\/li>\n\n\n\n<li><strong>The prompt appears only for some folders:<\/strong> a subfolder, such as one inside <code>wp-content\/plugins<\/code>, is owned by a different user. Repeat the <code>chown<\/code> in Step 2<\/li>\n\n\n\n<li><strong>You&#8217;d rather skip the dashboard:<\/strong> run updates with WP-CLI as the file owner&#8217;s user, for example <code>sudo -u www-data wp plugin update --all<\/code>. No FTP prompt can appear<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To update WordPress automatically without FTP, find out why WordPress thinks it can&#8217;t write to its files, fix the ownership and permissions (Steps 1 to 3), and add <code>define( 'FS_METHOD', 'direct' );<\/code> only if the prompt remains. That fixes the cause, not just the symptom. Avoid 777 permissions and avoid storing FTP passwords in <code>wp-config.php<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Is it safe to update WordPress automatically with FS_METHOD set to direct?<\/strong> It&#8217;s fine as long as only the web server&#8217;s user can write to your site. The trade-off is that a compromised plugin could then modify files too. Keep permissions at 755 and 644, keep <code>wp-config.php<\/code> locked down, and keep plugins updated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why does WordPress ask for FTP credentials?<\/strong> Because the user PHP runs as doesn&#8217;t own the files it needs to change, so WordPress can&#8217;t write them directly and falls back to FTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can I update WordPress automatically on shared hosting?<\/strong> Usually, yes. On most shared hosts PHP runs as your own account, so direct updates work without any changes. If you get the prompt, ask your host to check your file ownership.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Should I put my FTP details in wp-config.php instead?<\/strong> It&#8217;s possible, but it stores a password in a plain file. Fixing ownership and using the direct method is safer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-deploy-wordpreapachess-behind-a-reverse-proxy-on-cpanel-\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Deploy WordPress Behind a Reverse Proxy on cPanel\/Apache<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-recaptcha-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install reCAPTCHA in WordPress<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to Our Technology Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tired of WordPress update errors or permission problems on your server? Our team can help with WordPress maintenance, server configuration, security hardening, and ongoing hosting support.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/contact\">Connect with our technology experts.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: August 21, 2019 Last Updated: October 29, 2026 Introduction This guide explains how to update WordPress automatically without [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12654,"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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[185,167],"class_list":["post-5011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-architecture","tag-ftp-2","tag-wordpress-2","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1iP","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/08\/Automatic-WordPress-Updates-Without-FTP.png","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5011","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5011"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5011\/revisions"}],"predecessor-version":[{"id":12655,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5011\/revisions\/12655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media\/12654"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}