Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fsdolphin's avatar

What is the proper way to refresh Homestead after making changes to the Homestead.yaml file

Hi,

I have noticed that if I add a new site to my Homestead.yaml file the changes do not take effect immediately.

What is the proper way to refresh Homestead after making changes to the Homestead.yaml file?

Thanks

0 likes
11 replies
aarondfrancis's avatar
Level 6

I agree, this is not 100% clear.

I always call 'vagrant global-status' to get the Id of my homestead machine, then call 'vagrant provision [id]' to redo the provisioner.

8 likes
vmunich's avatar

After quite some time researching for a solution for this, I came upon this Vagrant command:

vagrant reload --provision

It will restart your homestead machine and apply the changes you made, while keeping your database data intact.

17 likes
fsdolphin's avatar

It looks like there is not a consistent process. Sometimes it works just by doing homestead provision but sometimes I need to do what @aarondfrancis suggested, run vagrant global-status to get the Id and then run vagrant provision [id]. In some cases I actually need to do all that plus reboot homestead with homestead halt and homestead up.

2 likes
vmunich's avatar

@fsdolphin That sounds like too much work, have you tried running vagrant reload --provision? , it never failed me.

2 likes
fsdolphin's avatar

I actually did but it didn't seem to do the refresh. I will give it another try to see what happens, I need to find the best option.

fsdolphin's avatar

FYI - I just tried vagrant reload --provision after adding a new site to my .yaml file and it didn't do the refresh.

This is what I see when I typed it.
default: VM not created. Moving on...

2 likes
michaeldyrynda's avatar

Stick with using the serve helper function from within the homestead VM. Guaranteed to work every time :)

2 likes
fsdolphin's avatar

@deringer So you just type serve or homestead serve?

I don't see any options or commands in the homestead list.

computecoholic@gmail.com's avatar

create an alias for homestead (latest version or 3.0.2) command on your .bash_profile, or .bashrc or .zshrc

alias homestead='function __homestead() { (cd ~/Homestead && vagrant $*); unset -f __homestead; }; __homestead'

don't forget to reload it (source command). You can run homestead provision to reload homestead configuration after updating your Homestead.yaml file

Please or to participate in this conversation.