Can't setup sitemap


I’m trying to setup sitemap.xml but it giving an error “Please make sure that “/” is writable by the web-server.” I have check the permission and ownership and it have the right permission. ( I had try rebuilding the whole server and Magento over from the beginning and still have the same issue.

Please help with this error. Thanks

Setup follow direction on How to install Magento 2.3 and build a web server

1 Like

Hi @kitnghi and welcome!

Your ls -la output looks spot on, with the exception of the /var/www/html/ folder itself - As this still belongs to the root user. Which would explain why you can’t create the sitemap.xml file.

Try running the below command as the “superuser” from within any directory:

sudo chown magento:www-data /var/www/html

This will specifically set the folder itself to magento:www-data. That seems like the most obvious problem. Let me know how you get on.

Hi Craig,

Thank you for the reply.
So I ran the command as the superuser and it seem like nothing had change. I run the command “ls -la” after running the command “sudo chown magento:www-data /var/www/html” and nothing have change. (
Any other way to change this? Thanks

I’m an idiot. It was late when I read your post last night. I miss read the image. The folder is fine as it is.

It’s the Permissions which needs changing. Try running the below command as the “superuser” from within any directory:

sudo chmod 775 /var/www/html

Your /var/www/html folder is currently set to 755. This means that magento user can create folders/files but not www-data. When Magento creates new files, they are created as www-data. Therefore, it doesn’t have the permissions to create the sitemap.xml file. Switching the /var/www/html folder to 775 grants access to www-data to create new files.


Thanks. It working now.

Great solution. Thank you!