This document outlines the steps I take to setup my environment on windows using WSL. This requires being on the windows 10 Creative update or greater with an Ubuntu 16 installed as WSL.
- Install WSL.
- Install Terminus and setup to use bash for windows (optional).
- Install Acrylic DNS Proxy.
- Download WSL Startup Scripts.
- Install Xming (optional).
- Open a bash instance in a terminal.
- Run
sudo visudo
. - Add
ALL ALL = (root) NOPASSWD: /usr/sbin/service
andusername ALL=(ALL) NOPASSWD: ALL
to sudoer config. - Run
sudo add-apt-repository ppa:ondrej/php
. - Run
sudo apt-get update && sudo apt-get upgrade
- Run
sudo apt-get install network-manager libnss3-tools jq xsel build-essential libssl-dev dnsmasq nginx mysql-server php-fpm php-cli php-mysql php-sqlite3 php-intl php-zip php-xml php-curl php-mbstring redis-server php-redis
- Run
sudo usermod -d /var/lib/mysql/ mysql
- Run
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
. - Run
sudo bash nodesource_setup.sh
. - Run
sudo apt-get install nodejs
.
- Run
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
. - Run
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
. - Run
sudo apt-get update && sudo apt-get install yarn
.
- Run
wget https://getcomposer.org/installer
. - Run
php installer
. - Run
sudo mv composer.phar /usr/local/bin/composer
. - Run
vi ~/.composer/composer.json
.
- Run
composer global require valeryan/valet-wsl
.
- Run
vi ~/.bash_aliases
. - Add
export PATH=~/.composer/vendor/bin:$PATH
. - Also if you want to use Gui application via Xming add
export DISPLAY=:0.0
. (optional) - Run
source ~/.bashrc
.
- In Windows hit the windows key and search for Acrylic and find Edit Acrylic Host File.
- Add
127.0.0.1 *.dev
to bottom of file and save. - Hit the windows key again and search for Stop Acrylic Service.
- Search again for Start Acrylic Service.
- Run
valet install
. - Run
valet domain dev
. (optional: defaults to .test and my preference is .dev) - Browse to a laravel project folder and run
valet link
. - To test, browse to folder.dev.
- In WSL and in project folder run
valet secure
.
- In Windows Explorer browse to C:/tools/valet/certs/ and double click the install_certs.cmd file. This will install any certs in the folder as trusted root certificates.
- Refersh your browser and see if HTTPS in enabled and valid. You may need to restart valet and your browser to get everything in sink.
- Move the WSL startup scripts you downloaded earlier to C:/tools/wsl-startup/.
- Make any adjustments to services.sh.
- Create a Task Scheudule to run bash-start.vbs at logon.
- Reboot to test startup. You should be able to browse to any valet configured sites after reboot.
- Run
sudo apt-get install dbus-x11 meld
.
1 Run sudo crontab -e
.
*/5 * * * * php /mnt/c/username/Projects/folder/artisan schedule:run >> /dev/null 2>&1