Windows Basic Setup

Trellis, Bedrock, and Sage development on Windows is supported by several libraries and software packages. This guide describes how to get the following packages installed and configured on your computer:

  • Git
  • PHP
  • Composer
  • WP-CLI

⚠️ All commands must be run from WSL (Windows Subsystem for Linux).

Git

Configure Git with your user information:

$ git config --global user.name "Your Name"
$ git config --global user.email "yourname@example.com"

PHP

Install PHP 7.3:

$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php7.3 php7.3-mbstring php7.3-xml

Composer

Install Composer:

$ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

WP-CLI

Install WP-CLI:

$ cd ~ && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
$ chmod +x wp-cli.phar
$ sudo mv wp-cli.phar /usr/local/bin/wp

SSH keys

Create SSH keys

Trellis and GitHub both use SSH keys to communicate securely without the need to type a username and password each time. Create your SSH key:

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

For more details on generating SSH keys, see GitHub's excellent documentation.

Add your new public SSH key to your GitHub account. To copy your public key from the terminal to the clipboard:

$ cat ~/.ssh/id_rsa.pub | clip.exe

Add your SSH key to the ssh-agent

Modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

Edit your ~/.ssh/config file and add the following lines:

Host *
  AddKeysToAgent yes
  IgnoreUnknown UseKeychain
  UseKeychain yes
  IdentityFile ~/.ssh/id_rsa

Join over 6,000 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?

“Easily the best WordPress email I get.” Colin OBrien

Follow us on Twitter @rootswp

Ready to checkout?