Setting up Trellis on Windows - or Not


#1

I’ve been attempting to install Trellis on my workstation. First, I set up XAMPP with the intention of running it there. Then, I found tutorials here that talked about using VirtualBox so I installed that on my Windows PC. After the third step, it recommended using yet another link for Windows users. I checked that out and it said to use VMWare install of VirtualBox but that there would be several things you have to install manually. Finally, after joining Roots Discourse, I received an email referring me another set of instructions.

Should I install Ubuntu and then do a “normal” VirtualBox install there? Or does using Ubuntu eliminate the need for VirtualBox? If I could only get started. :slight_smile:

Can someone give me the dummy checklist of where and what I should install when I’m working on a Windows PC. I have no problem with XAMPP, Ubuntu or VMWare, I just need to know which one to pick.


#2

I’ve written a first draft for the tools I’ve used in Windows w/ Trellis, Bedrock, and Sage that may help: https://github.com/roots/docs/blob/6a22d87424f89ff201612fe43a0b3de3594bd500/getting-started/win10-basic-setup.md The official docs also have a second on Windows-specific concerns: https://roots.io/trellis/docs/windows/

I don’t know if XAMPP can work w/ Trellis, but I doubt it. I would avoid XAMPP completely: Trellis does everything it does.

Trellis uses Vagrant to manage virtual machines, which can connect to several different virtual machine providers (including VMWare), but in my experience the most common is VirtualBox, so that’s what I recommend.

I’m not sure what you mean by “Install Ubuntu” unless you’re referring to using Windows Subsystem Linux (WSL) to run Ubuntu w/o a virtual machine. You can set up WSL to run Ansible, et al, but it can be daunting depending on your level of familiarity w/ the operating systems involved and their configuration. The virtual machine can’t actually run inside of WSL, so running Vagrant inside WSL requires some configuration to communicate w/ a version of Vagrant running “outside” in Windows proper, and setting that up can be confusing.


#3

alwaysblank,

Thank you for your response. I have followed the document you linked to…thank you! I have downloaded and installed everything on the list. What is next? I’m still missing some pieces of putting this puzzle together. Do I need a Web server in order to develop on a Sage theme?


#4

I’d recommend reading through the docs for Trellis, Bedrock, and Sage. They explain pretty well how to set up a project using the Roots stack.

Sage isn’t any different from a normal WordPress theme in this regard.


#5

Thanks for the info.

Just wanted to make a comment as a fellow Windows user (I assume there aren’t many of us). You don’t have to install PHP, Composer and Python on Windows. You can run them on the virtual machine.

Trellis will install Python and run Ansible there (on the VM). You just have to remember to do any composer work there too.

For a full roots.io stack on Windows, may want to mention other items to install:


#6

I haven’t done any word press development. This is all completely new to us. I’m struggling to see where all the pieces go. So you install a vm, then start it and install roots and safe within the VM?


#7

As a general rule we don’t recommend Sage or Trellis be anyone’s first WordPress experience. It’s a lot to take in and relies somewhat heavily on knowing how WordPress works normally so that you can understand how the Roots tools modify that behavior.

Of course we’d like to help with your situation. You said elsewhere that you’re taking over a site that was developed with a Sage theme. Was it also developed using Trellis? If not, it might be easier/faster for the short term to remove Trellis from the equation and focus on getting a standard WordPress site set up on a host you control, and getting your Sage theme working first.


#8

Thanks for the response! Yes, I can tell it’s better to take smaller bites and not go for Sage first off. But, that isn’t an option for us. We don’t know for sure about whether or not the existing site uses Trellis, but we think it might not be. In fact, we think it isn’t using Yarn and that it is using Package Lock. We are learning a lot of new terms.

We are some pretty smart people that feel pretty dumb right now. This technology is so different than what we are used to, but we are bound and determined to get it working.

I think your suggestion is sound. I would like to set up a Word Press/Sage theme development environment. I have a Windows 10 computer, but already have VMWare installed. I’ve also used Ubuntu which someone replied sounded silly…like “why would you use Ubuntu”. My response is because I don’t know what to use and I’ll use whatever it takes. LOL

I’ve read a lot of the documentation, maybe not all, and I’m still missing a link somewhere. For starters, should I use a virtual machine for this? If so, can it be Windows? Or, should it be something else…Linux?

We REALLY appreciate the guidance.

Lisa


#9

Where is your site hosted now? Are you keeping the site hosted where it is, or are you planning to migrate it to different hosting as part of this update project?


#10

I apologize if any of this seems too basic, but I just want to make sure all the bases are covered.

WordPress is software written in PHP. In order to run, it needs a server environment that provides it with a PHP executable and a MySQL database. In order to develop a WordPress site locally, you need the same things. Best practice for local development is to create a virtual machine running an operating system identical to the operating system that your site will be hosted on when you put it on your remote server. Trellis is a collection of scripts that create a virtual machine for this purpose, and configures (on demand) a remote VPS server for deploying your site to. It does this using Ansible (an application written in Python), and Vagrant. Ansible runs the scripts, and Vagrant is used to manage Virtual Machines. This is useful because it isolates your development from your day-to-day operating system, making it easier to catch bugs, do daily work, and avoid having to juggle configuration changes. Whether you use Trellis or not, you will need a local development environment that can fulfill WordPress’s requirements (PHP and MySQL).

“Developing a WordPress site” usually means doing a combination of the following things:

  • Coding a WordPress theme (a theme tells WordPress how to display content)
  • Creating content with WordPress (i.e. blog posts)
  • (optionally) Adding WordPress plugins to add certain functionality (i.e. an event calendar)
  • (optionally) Coding WordPress plugins to add certain functionality (i.e. custom post types)

Bedrock provides a system for managing WordPress and WordPress Plugins as dependencies of your overall site. This is useful because it allows you to lock dependencies to specific versions, and track their updates/changes in your repository. It uses Composer to do this, which is a PHP application.

Sage is a starting point and collection of development tools packaged as a WordPress Theme. It isn’t really a theme on its own, which is why we talk about sites being “Built on Sage.” Depending on the version of Sage you’re using, it will use Gulp and Bower or Webpack. These are installed with npm (in older versions of Sage) or yarn (in newer versions) which are both JavaScript package managers that run in Node. Sage also uses Composer for its dependencies.

You might also consider talking to the Roots Team about consulting: https://roots.io/services/#consulting They can help you get up to speed and train you on using the Roots stack quickly and easily, and teach you appropriate best practices for WordPress development.


#11

The plan is to host it in-house. We already have it running on IIS. We basically took a database dump and stood it up. When I say we, I mean our DBAs. Me and one other developer are looking at how to set up the development side to get to where we can edit the site.


#12

I appreciate the definitions and how the pieces fit together. I had surmised some of this already so you are confirming some of what I have found.

This may sound odd, but at this point, it doesn’t matter what platform I use to stand up a development environment. Chances are, whatever I do now will be trashed and we will begin again. We are at the point of proving a theory…to know it is possible. I’d like to set up a development environment in both Linux and Windows so we have options. I may find that the DBAs are open to setting up the production server on a Linux box or they may not. If I can work with either decision, it will be a lot easier on the developers.

Here’s my disconnect as far as using Linux. I was expecting to set up a virtual machine and then go into that vm and install all of the various pieces. The instructions don’t really say to do that so I’ve been installing everything on my Windows PC.

Not sure where to go next…


#13

In that case can you create a second copy of the site on the IIS server, which won’t be exposed to the world, and do your development on that copy of the site? This way you’d be able to review your changes in real time while you work.

Your biggest challenge is getting a server set up to run your site. Since you already have that done for production, just copy that effort.

If you can do that, you’re 3/4 of the way home.


#14

Don’t some of the files need to be compiled after editing them?


#15

Yes, but you can run those compilation tools right on that development server, or run them locally on your Windows computer and then drag-and-drop the compiled result over to the development server.


#16

MWDelaney,

Did I read somewhere that you offer support? How much and to what end?

Lisa


#17

The roots team offers support. We would want to get an outline of what you’re trying to achieve and what you’d like the outcome to be. I’m probably not the best resource for this call, since I’ve never developed for Sage on Windows, but we have staff who does, so we should be able to set you straight.