I was running WordPress on an Aliyun LNMP setup with Nginx and never bothered installing a traditional FTP server. SFTP was already convenient enough, and the connection speed was perfectly usable, so adding FTP just felt like an unnecessary waste of server resources.
The problem showed up whenever WordPress offered an update. Clicking the automatic upgrade button never actually started the upgrade process. Instead, WordPress would jump to a screen asking for FTP account information. At first, it seemed like this was simply because FTP was missing and that SFTP would not help here, so I left it alone and handled every update manually.
Later I found out that on another server with a similar setup, automatic updates were working fine even though no FTP service had been installed there either. That made it clear this was not really about FTP being absent. After some trial and error, it turned out that WordPress can update normally in this kind of environment, but the permissions and filesystem access method have to be set correctly.
For many people using LNMP, this issue appears because Nginx is running under a user that does not own the WordPress files. When that happens, WordPress cannot write to its own installation directory directly, so it falls back to asking for FTP credentials.
Fix the ownership of the WordPress files
Assume your WordPress installation is located at:
/home/wwwroot/lnmp.org
Log in to the Linux VPS with PuTTY and run:
chown -R www /home/wwwroot/lnmp.org
This changes the ownership of everything under /home/wwwroot/lnmp.org to www. In many LNMP environments, that is enough to stop WordPress from asking for FTP information during automatic updates.
If it still does not work
On my setup, changing ownership alone was still not enough. WordPress continued to refuse automatic upgrades, so one more change was needed in wp-config.php.
Add this line:
define('FS_METHOD', "direct");
After saving the file, go back to the WordPress admin panel and try the upgrade again. Once that line was added, the update completed successfully.
So if WordPress on Nginx keeps asking for FTP credentials even though you are not using FTP at all, the usual cause is file ownership, and in some cases WordPress also needs to be told explicitly to use direct filesystem access.