skip to Main Content

I am new to Laravel development, and I spent the last 5 hours trying to get a Laravel project up and running using Docker (which apparently is obligatory). Every single time I try to create a new Laravel project using the provided curl cmd, it says Docker is not running although it is. Literally spent the last hour browsing the internet for possible solutions, but nothing works.

Why do I have to install Docker, Debian & co on my Windows 10 machine for Laravel development?

3

Answers


  1. If you want to use Laravel with the local server it’s absolutely fine.

    You can use the composer command rather than the docker command.

    If you want to use the docker command, you must have to install the docker in your PC and keep it running.

    Here is the composer command:

    composer global require laravel/installer

    To run this command, you need composer installed. Use this link to download and install composer: https://getcomposer.org/

    Laravel official Link: https://laravel.com/docs/8.x#the-laravel-installer

    Login or Signup to reply.
  2. You don’t need Docker, it just (arguably) simplifies your development experience. Docker is a containerization solution where people create images that contain applications and packages which when deployed, provide an environment that meets their requirements. It’s kind of similar to virtualization, only it works closer to the hardware so is more performant.

    With Laravel the basic requirements are PHP, MySQL/MariaDB, and Apache/Nginx. There are other packages people frequently use alongside Laravel such as Redis, RabbitMQ & Memcache to name a few. Laravel Sail provides a wrapper around the Docker commands for starting and stopping containers (instances of Docker images) and some pre-configured environments. Sail currently provides images for PHP 7.4 and PHP 8 and Nginx and a choice of RDBMS and some other things like Redis.

    By using Sail, you don’t need to install and configure these things on your host system. You install Sail then run a few commands to install the packages you want and away you go.

    Aside from simplifying the development experience, another nice added benefit is that you can create Docker environments for development and use the same image for production so you can be confident there will be no deployment issues (or at least shouldn’t be!).

    Again, you don’t have to use Docker with Laravel. You are not missing out on anything by not using it, you just need to install and configure your environment manually on your host.

    So in your scenario, if you were to not use Sail, you will need to install PHP, Nginx and either MySQL or MariaDB and Composer at a minimum. Take a look at this LEMP installation tutorial on how to go about and then watch the Laravel 8 from Scratch series (or at least the environment setup part) for things like Composer.

    Login or Signup to reply.
  3. Interestingly, it seems that from Laravel 9 and above, they’ve removed the dedicated documentation section on composer installing to "Your First Laravel Project" section, right in the beginning. So you miss this entirely if you head on to the Linux or Windows install sections.
    Insert your specific version or leave the version out for latest release:

    composer create-project laravel/laravel:^10.0 your_project_folder
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search