Easily deploy a Laravel application with Docker

Easily deploy a Laravel application with Docker


docker on shared hosting

Want to learn more about how to develop and deploy Laravel applications with Docker? I’ve released a premium course featuring 23 videos for just $29! Check it out here:

In this 21 minute video, I’ll show you how to easily deploy a Laravel application using Docker and two separate methods to get source files on a server.

Join my weekly newsletter for tips on Laravel + more:

Docker installation tutorial for Ubuntu 18.04:

Docker Compose install tutorial for Ubuntu 18.04:

You’ll learn how to:

– Set up Docker and Docker Compose on a remote Ubuntu server
– Send files to a server using rsync
– Use git and GitHub to commit, push, and pull files to a remote server
– Run docker-compose on the remote server to deploy your app

Follow me on Twitter!

Thanks Patreon supporters!
– Sam Ross
– PK
– Melissa Kipp

Directly support these videos @

31 thoughts on “Easily deploy a Laravel application with Docker

  1. hi, i am building a website with laravel, it implements video calling and chatting, and to use socket.io i have to use node server in my project, but i am confused about how to deploy the project in a platform like aws or digital ocean?

  2. Hello, when running docker-compose locally is doesn't set laravel sessions, also the cookies can't be set. The only cookie available is the code editor's (phpstorm). What would be the issue

  3. 1:35 $ cp docker-compose.yml docker-compose.prod.yml
    1:38 Adjust the nginx port to 80:80
    1:47 Harden mysql passwords!
    4:05 Deployment options: 4:20 rsync
    8:19 Just after you've uploaded your Laravel project to the src/ folder … However you wanted to (rsync, git, ftp, shell, putty, cmder, bitwise, etc)
    9:06 $ docker-compose -f docker-compose.prod.yml up -d –build
    9:30 how to add the laravel user to the docker group
    10:23 Update the Laravel's .env file for database credentials, app domain, etc.
    11:10 Run the migrations with $ docker-compose run –rm artisan migrate
    14:40 Deploy with git
    17:45 Cloning Laravel project into the src/ folder
    18:09 Editing .env file
    19:10 Run composer install: $ docker-compose run –rm composer install
    19:23 $ docker-compose run –rm artisan migrate
    19:33 $ docker-compose run –rm artisan db:seed
    20:43 : Everybody wondering … where is the domain setup, SSL let's encrypt, Redis, memcached, supervisor, … part ?

  4. Thank you very much. The best docker laravel tutorials that I have ever watched . Every videos you uploaded are related each others and these are all enough to clearly figure out Docker for laravel development.

    https://www.youtube.com/watch?v=5N6gTVCG_rw

    https://www.youtube.com/watch?v=ozKxWsojYJ4

    https://www.youtube.com/watch?v=I980aPL-NRM

    https://www.youtube.com/watch?v=LFrBmvgamGI

    https://www.youtube.com/watch?v=G5Nk4VykcUw

    https://github.com/aschmelyun/docker-compose-laravel

  5. Hi, @Andrew Schmelyun. Can you make a video that deploys the Laravel app using Nginx and PHP-fpm in one Dockerfile and MySQL to another Dockerfile in the production environment? I had been researching about it and tried to make my own Dockerfile, but wanna see from your perspective and your opinion. Nice video

  6. Andrew, cannot thank you enough!
    I have been playing recently with docker and your videos are the best, once again thank you and keep it up!
    BTW. do you consider any tutorials for Kubernetes?

  7. You missed few things for complex projects.
    1.) Deploy to actual domain.
    2.) SSL for that domain.
    3.) Socket connection.
    4.) Using SSL with socket connection.
    5.) Redis
    6.) Memcached
    7.) Digital ocean Spaces for reliable storage.
    8.) MySQL data will be lost once you bring docker down, how to solve that?

    I'm hoping part 2 to cover these problems.

Leave a Reply

Your email address will not be published. Required fields are marked *