Laravel

Setting up your local environment for Laravel

Before creating your first Laravel project, you need to make sure that your local machine has PHP and Composer installed. There are more than a way to accomplish this depending on which Operating System you're running, but in order to get you up and running as quick as possible, we'll explore the easiest routes to set up your local environment.

Setting up your local environment for Laravel

macOS

If you are developing on macOS, PHP, Composer, nginx and dnsmasq can be installed easily through Laravel Herd. In addition, you'll need to install Node and NPM.

For database, you can't go wrong with DBngin, a free All-in-One Database Version Management Tool.

Aaron Francis made a detailed YouTube video about all these tools and how to get everything set up on your Mac to start coding in no time.

Terminal

macOS ships with a terminal out of the box, all you need to do is to search for terminal on your machine and you'll be good to go.

Though, you can also install dedicated tools that some people prefer as they look a little bit cleaner. My favorite is iTerm2 which's completely free and comes with many features like: Split Panes, Search, Autocomplete and many more.

There's also Warp, which I recently started trying out. It is free, but it does come with some paid features.

No matter which one you pick, you'll be set.

Windows

Just like on Mac, you can set your local environmment up on Windows with the help of different tools:

Laragon includes MySQL, PHP, Redis, Apache and is probably the fastest and easiest way to get started with your Laravel journey on your Windows machine.

There's also XAMPP and WAMPServer. Both are popular and reliable Windows development softwares, with XAMP being available for Linux-based operating systems and macOS, while WAMPServer only supports Windows.

However, I highly recommend Laragon for its simplicity as it gets many things right and it has a very clean UI. But to help you make the right decision, here's an article by PHP.watch that explains what Laragon does and how it's different from XAMP and WAMP.

Follow this YouTube Video for a step by step installation of Laragon.

Terminal

Windows also ships with a terminal out of the box called PowerShell which can be customized to your liking following the steps in this YouTube Video.

Linux

To be honest, I've never set up a development environment on a Linux machine but here's a guide on how to do so on Ubuntu 23.04.

You can always use XAMPP if you wanna keep it simple.

Alternatives

You can always follow Laravel's official installation guide to get started. Though, if you're a beginner, I'd recommend you to stick with the tools mentioned above to keep things easy.

Code Editors

Of course, you will need a code editor or an IDE (Integrated Development Environment). There are tons out there, paid and free, but the ones I frequently use are:

  • PhpStorm by JetBrains: is a development tool for PHP and Web projects. It's a perfect PHP IDE for working with Laravel, Symfony, Drupal, WordPress, and other frameworks. It includes a trial license key for 30 days, and you can get a free license if you're a student. Available for Linux, macOS, and Windows.
  • Visual Studio Code by Microsoft: is a code editor redefined and optimized for building and debugging modern web applications. It is free and available on your favorite platform - Linux, macOS, and Windows.

These are my recommendations, but it doesn't matter what you pick, just make sure it's reliable and easy to work with.

Now, give yourself a tap on the back as you're ready to start using Laravel.

Until next time. ✌️