Mac OS Trellis Setup with Lima instead of Vagrant

Wordpress vet old dawg learning some new tricks here with the roots.io / bedrock

I want to build out my new projects in a much better way hence I find myself here and looking to setup Trellis on MacOS for my new Dev environment

I am stuck because I get this error –

└─(12:33:13)──> trellis up --debug
Starting galaxy role install process

  • composer (1.9.2) is already installed, skipping.
  • ntp (2.5.0) is already installed, skipping.
  • logrotate (v0.0.5) is already installed, skipping.
  • swapfile (v2.0.38) is already installed, skipping.
  • mailpit (v1.0.0) is already installed, skipping.

Running command => vagrant up --debug
exec: “vagrant”: executable file not found in $PATH

I did install lima prior and thus skipped the Vagrant steps.

What I think I should do is point vagrant cmds to lima’s location but I don’t know if that is the correct way forward here

Thank you for your help here

  • bb

You need to use trellis vm start instead of trellis up
You will also need to set the port in hosts/development :
Use limactl ls to display the port, then add it e.g.
ansible_host=127.0.0.1 ansible_port=49967 ansible_connection=ssh ansible_user=...

The other vm commands can be found here

1 Like

Ok this is helpful thank you hypotune

I think what I have done here now is that I bypassed the ansible prequesite

because I don’t see it here
└─(21:50:57)──> whereis ansible ──(Sun,Jan12)─┘
ansible:

but I can install with brew it looks like

└─(21:51:18)──> brew search ansible ──(Sun,Jan12)─┘
==> Formulae
ansible ansible-cmdb ansible-language-server ansible@10 ansible@9
ansible-builder ansible-creator ansible-lint ansible@8

==> Casks
ansible-dk

I’m just not sure which one to choose and then I am also needing to learn more about ansible once I know which cask is best for my use so off to that now from here

Thank you again for the help

  • bb

found this link which I think should clear up some of these clouds for me

You don’t need to worry about installing Ansible

thanks Ben I think I understand now it’s already going to be included within the lima VM that I create and I modify the files there

A lot of new stuff here for me so I do appreciate the help

Backtracking a bit now on Python - I did install it with homebrew and I have 3.13 installed

What I am unsure of now from reading this page - Python and Trellis | Trellis Docs | Roots

do I now what to remove python with HomeBrew?

HB doesnt seem to like that because it’s already now using python 3.13 in some places –

└─(10:43:00)──> brew uninstall python@3.13 Error: Refusing to uninstall /opt/homebrew/Cellar/python@3.13/3.13.1
because it is required by glib, graphicsmagick, libheif and shared-mime-info, which are currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python@3.13

so I could do that… but then I am unsure on 2 things…

how to make sure trellis is using python the way it wants to AND then be able to repair these dependencies with homebrew?

I’m not sure you need to do anything?

What’s happening when you run trellis vm start from a freshly created Trellis project with trellis new? It should provision the development VM

If not, share the output on here. Please start formatting your output in fenced backticks.

right I may not I just wasn’t sure after reading that link

I will do better on the formatting sry

and then show you what I see there on a fresh project

  • bb

so I did get almost everything cleared up here

Your Trellis VM is ready to use!

  • Composer and WP-CLI commands need to be run on the virtual machine for any post-provision modifications.

  • You can SSH into the machine with ‘trellis vm shell’

  • Then navigate to your WordPress sites at ‘/srv/www’

the past few days left me with more reading and backtracking to determine my path fwd here an except from my notes -

Goal from here is to properly build with composer / git private repo a small wp site in Bedrock

Include some of the things we will need on the next real project

Then create DigitalOcean Trellis staging / production Server provision it and push site to staging > production

To figure out to navigate that process on a simple site

Then will build out next (yet to be determined project) with same methods

thank you again Ben and Hypotune for your help here

1 Like