Local ran into a problem when trying to update the hosts file. Please ensure that the hosts file is not locked by anti-virus

What issue or error are you experiencing?

Local ran into a problem when trying to update the hosts file.
Please ensure that the hosts file is not locked by anti-virus.

How do you fix this error on Mac?



What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:

  • Operating System (OS) and OS version:


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @StudioSupport

Do you have any antivirus, security, or firewall applications that could be blocking Local? It looks like from the log it might be having trouble connecting.

More details about troubleshooting this here: Router Mode

Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.

I’m running Mac OS so there isnt any antivirus as far as i’m aware. I have the firewall turned off currently.

any ideas on this following that guide?

Screenshot 2023-09-11 at 16.41.14

Also i do. have Mamp installed but not running should i remove this?

MAMP could be preventing Local from making changes to the machine. You could try just completely quitting it first, and then doing a reboot. If that doesn’t work you may need to do an uninstall.

Deleted mamp and everything else

Uninstalled and this doesn’t work.

Is there a conmand to grant access in the terminal? Only way I can use it is by entering the hosts manually

You can’t grant access but you could edit the Hosts File manually, however Local will need to make changes to this often so it would quickly become a chore and would be better to address the source of the issue so it can work normally.

Are you still getting the “Can’t Update Hosts” errors or something different?

Now that you have MAMP and other stuff removed, maybe it will be worth trying a big refresh.

  • Export any sites that you have on Local and save them to a folder somewhere on your computer.

  • Fully uninstall Local from your computer.

  • Install the latest version of Local on this link.

  • Once installed, please restart the computer.

  • When the computer is restarted and turned on, close any applications that automatically run in the background (AntiVirus, Firewall, and other Developer applications included).

  • Check and see if the issue still persists. If so, please provide us with an updated log. Retrieving Local’s Log File

Keep us posted and we’d be happy to help further!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.