What's the cleanest way to remove Homestead and Vagrant from a Windows system?

58,087

Solution 1

Virtual Machine

Remove the homestead VM by running

vagrant box remove laravel/homestead

Homestead

If you installed Homestead via composer with the following command:

composer global require laravel/homestead

run the opposite to remove it:

composer remove laravel/homestead

This will remove the .composer/vendor/laravel directory, including its 'homestead' subdirectory. The 'global' keyword is not required.

On a Mac or Linux system, the Homestead configuration files can be removed by deleting the '~/.homestead' directory. You may need to hunt a little to find the directory on your Windows system. Don't worry too much if you can't find it; the directory is small and innocuous.


Composer

Composer is usually installed as a Windows application; check Add/Remove programs (or the Windows 10 equivalent) to uninstall it.

If you installed Composer manually and it does not appear in your list of installed apps, simply remove the 'composer' binary and the configuration directory (~/.composer on Mac/Linux systems).

Solution 2

Step 1: Get a list of all installed boxes using

$ vagrant box list

Step 2: Run vagrant remove command, specify the box name, version, and provider for example

$ vagrant box remove laravel/homestead --box-version=0.4.4 --provider=virtualbox
Share:
58,087

Related videos on Youtube

aalaap
Author by

aalaap

I build things.

Updated on July 09, 2022

Comments

  • aalaap
    aalaap almost 2 years

    I followed the instructions in Laravel docs to install Vagrant and Homestead on Windows 10, but now I've decided to move the whole development stuff to another dedicated server running Debian.

    I need to fully remove Vagrant, Homestead, Composer as well as AMPPS (old stuff) from the Windows 10 desktop. It should be easy to simply uninstall Vagrant and AMPPS, but how do I go about cleaning up the remaining things?

    I don't need to keep any of the code etc. I've already got that in a different location.

    • Laurence
      Laurence over 9 years
      Just delete it. Homestead is just files within your directory.
  • kevnk
    kevnk about 9 years
    The composer remove laravel/homestead command gave me this error: ``` [RuntimeException] Could not read ./composer.json file_get_contents(./composer.json): failed to open stream: No such file or directory ```
  • Fernando S. Kroes
    Fernando S. Kroes almost 9 years
    @kevnk I had the same problem. At first you need to 'cd' into the folder where you composer.phar are located then I resolved it with adding "sudo". So it now looks like this "sudo composer remove laravel/homestead" maybe this can help other people as well.
  • Mirceac21
    Mirceac21 almost 9 years
    If you have composer installed globally try composer global remove laravel/homestead else follow feri advice.
  • Lpgfmk
    Lpgfmk over 8 years
    For removing virtual machines I did vagrant box remove laravel/homestead --all since I had several versions of laravel/homestead boxes. You can find the boxes with vagrant box list
  • Ryan Kozak
    Ryan Kozak about 7 years
    This is exactly what I needed, a way to remove a specific version of the same box.
  • Ryan Kozak
    Ryan Kozak over 6 years
    Looks like I'm back again to reference the same thing, thanks twice!
  • nroy
    nroy about 4 years
    Yes, Me to, this is exactly what I was looking.