<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zen Programmer on Medium]]></title>
        <description><![CDATA[Stories by Zen Programmer on Medium]]></description>
        <link>https://medium.com/@jay_eneki?source=rss-b10179d8bf7a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*J8h1Zwuy3qUoN4DZvDK7YQ.jpeg</url>
            <title>Stories by Zen Programmer on Medium</title>
            <link>https://medium.com/@jay_eneki?source=rss-b10179d8bf7a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 19:48:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jay_eneki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Setting Up Multiple Local Instances Of Homestead]]></title>
            <link>https://medium.com/@jay_eneki/setting-up-multiple-local-instances-of-homestead-a311a69fcb66?source=rss-b10179d8bf7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a311a69fcb66</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[homestead]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Zen Programmer]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 19:46:34 GMT</pubDate>
            <atom:updated>2023-01-23T18:02:52.625Z</atom:updated>
            <content:encoded><![CDATA[<p>This article assumes that you have an existing Homestead box.</p><p>There are a few reasons you might need to set up more than one instance of Homestead. In my case, I had a couple of projects that required MySQL 5.7. Homestead base box version 10+ ships with MySQL 8 as the default.</p><p><strong>TL;DR<br></strong>A few years ago, I ran into this challenge and compiled the steps which worked for me as a guide to my future self. When I attempted to run these steps yesterday, I hit a wall. I thought of rewriting the whole thing but there are a few claps and I choose to imagine that it still works in certain use cases.</p><p>The solution I came up with yesterday is labelled <em>Alternative #1</em>. The original series of steps follows right after as <em>Alternative #2</em>.</p><p>Steps 1–4 are shared regardless of the direction you choose to take.</p><blockquote><strong>Fair warning:</strong> Alternative #1 is fairly hacky and some might argue even dirty. However, this is a local environment. As far as I can see it has no far reaching consequences. If you disagree, I’m happy to engage in the comments.</blockquote><p>The following is a list of steps to set up a subsequent box:</p><ol><li>Download the desired Homestead box version. For my use case (running MySQL 5.7 with Laravel 5.7), box version v9 is ideal.</li></ol><pre>vagrant box add laravel/homestead --box-version 9.7.2</pre><p>Access all Homestead box versions <a href="https://app.vagrantup.com/laravel/boxes/homestead">here</a>.</p><blockquote><strong>Note</strong>: after copy-pasting the command above, you might have to confirm that the <em>box</em> flag is preceded by two hyphens without a space in between. This could get distorted after pasting which may lead to an error along the lines of <em>the command was not properly invoked </em>as seen below.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*py2cKJzM5iqe9gwYoooavQ.png" /></figure><p>2. Clone the Homestead repository into a folder separate from your first Homestead box.</p><pre>git clone <a href="https://github.com/laravel/homestead.git">https://github.com/laravel/homestead.git</a> ~/<strong><em>Homestead9</em></strong></pre><p>3. Navigate to the folder you created in step 2 and check out the appropriate release of Homestead.</p><pre>git checkout v8.0.1</pre><blockquote><strong><em>Note</em></strong><em>: Don’t confuse the </em>Homestead base box version <em>for the</em> Homestead release<em>.</em></blockquote><p>A list of all Homestead releases is accessible <a href="https://github.com/laravel/homestead/releases">here</a>.</p><p>4. Once you have cloned the Homestead repository, run the bash init.sh for Mac/Linux or init.bat for Windows to create the Homestead.yaml configuration file.</p><h3>Alternative #1</h3><p>5. Navigate to the scripts/homestead.rb file present in your Homestead folder and find the config.vm.box_version variable.</p><p>6. Replace its value with the Homestead box version you downloaded in step 1. In my case, my key-value pair now reads:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VW5Nq7UDatotl6dJzS2CQ.png" /></figure><p>7. Runvagrant up &amp;&amp; vagrant ssh</p><h3>Alternative #2</h3><p>5. Edit the init.sh file inside the folder you created in step 2. The goal is to change the paths to the config files. This is the trick to making sure installing a subsequent instance of Homestead doesn’t overwrite the first box’s config files.</p><pre>#!/usr/bin/env bash</pre><pre>homesteadRoot=~/<strong><em>Homestead9</em></strong></pre><pre>mkdir -p &quot;$homesteadRoot&quot;</pre><pre>if [[ -n &quot;$1&quot; ]]; then<br>    cp -i resources/Homestead.json &quot;$homesteadRoot/Homestead.json&quot;<br>else<br>    cp -i resources/Homestead.yaml &quot;$homesteadRoot/Homestead.yaml&quot;<br>fi</pre><pre>cp -i resources/after.sh &quot;$homesteadRoot/after.sh&quot;<br>cp -i resources/aliases &quot;$homesteadRoot/aliases&quot;</pre><pre>echo &quot;Homestead initialized!&quot;</pre><p>6. Publish the config files by running bash init.shfor Mac/Linux or init.bat for Windows.</p><p>7. Edit the Homestead.yaml file to distinguish between the server addresses.</p><p>For example, this was my first box’s .yaml file</p><pre>ip: &quot;192.168.10.10&quot;<br><strong>name: &quot;homesteadLatest&quot;</strong><br>memory: 2048<br>cpus: 2</pre><p>and this is the .yaml file for the second Homestead box:</p><pre><strong>ip: &quot;192.168.10.11&quot;<br>name: &quot;homestead9&quot;</strong><br>memory: 2048<br>cpus: 2</pre><p>8. Edit the hostnames file (/etc/hosts in Mac and Linux; C:\Windows\System32\drivers\etc\hosts in Windows) to reflect the different server addresses</p><pre>192.168.10.10 project-one.appp // a site mapped to the original box<br>192.168.10.11 project-two.appp // a site mapped to the new box</pre><p>9. Create the environment and ssh into it by running the following commands in the folder you created in step 2.</p><pre>vagrant up &amp;&amp; vagrant ssh</pre><blockquote>Remember that provisioning is only done automatically on the first vagrant up. Thus, remember to call the provision flag (vagrant reload --provision) if you make subsequent changes to the Homestead.yaml file. More details on provisioning can be found <a href="https://www.vagrantup.com/docs/provisioning">here</a>.</blockquote><h3>Conclusion</h3><p>To confirm that the desired Homestead box has been successfully installed, check the second line produced by running vagrant up. It will detail the version of Homestead while it checks for updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrWPwvqBIUTI3ZkyA-Aqdw.png" /></figure><h3>Bonus</h3><p>Running vagrant box listfrom your local environment will show you a list of the boxes that are installed.</p><figure><img alt="List of installed Homestead boxes." src="https://cdn-images-1.medium.com/max/584/1*5M6E1DpsIvNm63pDT0ZOow.png" /></figure><p>To get rid of any of them, run vagrant global-status — prune and then vagrant destroy <strong>[id]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a311a69fcb66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>