Windows or Mac / Linux - Which is better for Laravel?
Oliver Sarfas • July 3, 2020laravel programming rant
Having worked at a vast range of firms ranging from in house development, agency, self-employed, and that awful stint in IT Support - I've worked on all types of Operating Systems and have a rather eclectic experience range.
But, if I'm working on a new Laravel project, either from scratch or through a client; I have my go to OS and setup.
Why? What options are there? Is one better than the rest? Is there something that works on ALL operating systems?
What are the options
The Big 3 we'll be discussing here are;
- Linux (I'll be referencing Ubuntu, however other distributions are available)
Windows is the most common Operating System around the world for desktop and laptop based devices. It's licensed by Microsoft and has had controlled over the market for as long as I can remember. Well known for it's "easy-to-use" interface, and classic Start Menu
MacOS is Apple's Operating System. Based on the Unix Kernel, it's underlying operations differ to that of Windows, however it's not quite Linux either. Known most for it's floating Menu Bar, and sleek design.
Linux is the outlier from the 3. Unless someone works in IT, they most likely don't even know that Linux exists. It's distributions are built for the advanced user and allows for granular manipulation and control. Those who know Linux outside of IT, most likely know it from "Hacking Videos" from a TV show, such as Mr Robot.
There's a clear winner here - Ubuntu. It's free. You can go to the Ubuntu website today, download the image to a USB stick - and run the OS within minutes.
MacOS is also free; however there are a lot of hardware restrictions. MacOS will only run on Mac systems. There are ways around this - Hackintosh for example - however we're only interested in running off the shelf setups here. So MacOS is "free", if you're on a Mac.
Running up last is Windows. For a long time Windows 10 was free to download, and free to upgrade from older systems. However, that offer has since expired. Windows 10 Home will cost you £119.99 from the Microsoft Store. You can use the OS for 30 days with no license as a trial, however you will need to activate thereafter.
Ubuntu and Windows will run on 'most any system. MacOS as mentioned will "only run on Apply systems". Apple does charge a LOT for these systems considering the hardware, for that reason alone - they have to be bottom of the pile for affordability.
- ⭐️ Ubuntu
Availability in Shops / Online
Most people nowadays when purchasing goods will do so online. However, there's still a large group who will go to a computer / electronics shop and want to see the machine first.
For this reason, Windows will win this category. MacOS is available to the general public at some retailers, however they must be licensed with Apple.
Online, all 3 are available, however Windows is still more common than Apple, and Ubuntu. I'd even go as far to say that Windows outnumbers the two together.
Unless you shop at a specialist retailer, you're not going to fund Ubuntu anywhere on the market, so that will come last.
- ⭐️ Windows
Configurability with Laravel
How simple is it to get a new laravel project running on these Operating Systems?
Windows does not use a Unix based kernel in the background, so installing PHP can be a bit of a chore. To circumvent this, most developers will opt for a virtual environment - essentially removing the restrictions of Windows entirely.
If this isn't your style, you can install programs such as chololatey and then instruct that to install PHP. It's a headache, but it works. The same goes for Composer.
Most Windows Laravel developers will use Laravel Homestead which is a virtualized Ubuntu server.
With MacOS you can run local PHP with ease using Homebrew, MySQL using it's native installer as well as Redis, and other Laravel tools. all the installation docs "just work". There's also a tool called
Laravel Valet which is great and easy to use.
Laravel Valet is only available to MacOS. It's a single line command that will serve your Laravel application on your local machine, as well as allow you to share the instance with others through ngrok. How I worked without it before, I'll never know.
Much the same as MacOS, however is not supported by Laravel Valet. For Ubuntu I usually install PHP using
apt and then tinker away there. It takes a lot of manual configuration, but that's what you get with Ubuntu and other Unix systems.
- ⭐️ MacOS
This is going to cause a lot of controversy. "Why is Windows above Ubuntu?" I hear you all scream. I find it very difficult to break Windows. However Ubuntu allows you to change anything, and as such a little change in the wrong place can brick your Laravel install, but also your entire OS. Tread carefully.
My experiences / opinion
If I had a Windows machine, Ubuntu, and MacOS solution in front of me and had to choose one for my projects. I'm grabbing the Mac without hesitation.
Yes, it costs more upfront - but the amount of time saving I get from the joys of Valet, MacOS itself being a joy to work in, as well as other Development tooling available; it's invaluable.
If Mac isn't allowed, I'm reaching for Windows. Ubuntu is just too raw for me, and I'm still not 100% comfortable building on it as I'll probably break it!
There are ways around OS limitations such as using virtual machines, or even Docker. I've previously used Virtual Environments on Mac as well as Windows using Laravel Homestead, Scotch Box, and Vagrant.
I've dabbled in Docker a little, however I want to learn more about it and how to manage it best before making a comment on it compared to local development.
What about you? What do you use? If you have any comments on what I've raised here, please contact me on my social links below and we'll have a chat.