Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lorenzo's avatar

Laravel and Laradock Development Application Workflow - from local development to updating live app!

Hello Everyone, I am getting my feet wet with Laradock as local development environment. I am a window user so cannot use Valet and Homestead works fine but a bit hungry in terms of resources.

I have though a few concepts clinging in my head and I can't see the right path. I have just started with Docker so the answer might reside in Docker-Machine which I have not studied yet but still would appreciate some guidance.

I can setup a working local environment with Laradock, I then build my small app and I want to deploy let's say to digital ocean to make it easy. This guide does a pretty good job at setting up the above http://laradock.io/guides/#Digital-Ocean. But this is the exact copy of the local setup, how do they talk / synch to each other (docker machine maybe?)

Here my dumb questions:

  1. Where should I start first? Setting up all in digital ocean and then pull it (somehow) locally? Does not seem right...

  2. Can I use docker-machine and propagate local changes to the live repo by rebuilding all containers?

  3. Should I look to something like heroku where I can push from local repo to github and then to live site?

What's the recommended workflow to update the app locally and reflect the changes online for a small size app, without having to implement continuous integration and all the fuzz.

It's a simple requirement, use laradock as local dev env, and reflect changes to laradock on digital ocean.

Thanks for all your kind support!

0 likes
9 replies
aurawindsurfing's avatar
Level 50

Hi @lorenzo,

I'm using fairly similar set up. The simple answer is you have to set it up on your live server the same way you were setting it up on your local machine so as per your guide http://laradock.io/guides/#Digital-Ocean:

Install docker first:

Install Docker

Visit DigitalOcean and login.
Click the Create Droplet button.
Open the One-click apps tab.
Select Docker with your preferred version.
Continue creating the droplet as you normally would.
If needed, check your e-mail for the droplet root password.

Install laradock with all of the image docker configurations:

$root@server:~# apt-get install git
$root@server:~# git clone https://github.com/laravel/laravel
$root@server:~# cd laravel
$root@server:~/laravel/ git submodule add https://github.com/Laradock/laradock.git
$root@server:~/laravel/ cd laradock

Once you have both then you tell docker to pull in all of the images

$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$root@server:~/chmod +x /usr/local/bin/docker-compose

Once images are downloaded then you create the containers that you need:

$root@server:~/laravel/laradock# docker-compose up -d nginx mysql

Once that is ready to go, you enter your workspace container and pull in the Laravel:

docker-compose exec workspace bash


$ root@workspace:/var/www# composer install
$ root@workspace:/var/www# cp .env.example .env
$ root@workspace:/var/www# php artisan key:generate
$ root@workspace:/var/www# exit
$root@server:~/laravel/laradock# cd ..
$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache

And then once you set up all your nginx, dns etc to point to the correct folder for instance:

root /var/www/public

You install another git in that folder and pull your private repository with your project that you commited from your local machine to github, bitbucket etc.

After you set it up then the only thing you will be doing is:

On you local machine:

git add .
git commmit -m 'My another commit'
git push

On your Digital Ocean:

git pull

Here is Jeffrey lesson on git:

https://laracasts.com/series/git-me-some-version-control

I hope it helps!

3 likes
lorenzo's avatar

Hello @aurawindsurfing many thanks! You solved my doubts, the missing point was to pull from the github / bitbucket repo! It makes sense, I will try it out! Will also have to dig deeper into docker, it's a really cool tool.

Thanks again for now, laracasts community thumb up!

PiotrG's avatar

@aurawindsurfing thanks for your write up, helped me as well!

Just a quick question:

When you say "You install another git in that folder and pull your private repository with your project...", I'm a little confused as to which folder you should commit/pull.

Coming from Homestead, I would commit from /laravel-app/, but here you are saying one should commit from /laravel-app/public. What about the changes in the other folders in /laravel-app/ ?

aurawindsurfing's avatar

@PiotrG up to that point all you have is a docker and plain laradock, probably with a default nginx site.

Now in the nginx's sites-enabled you need to add your site configuration lets say called mytestproject.

Then you need to move your local repository from home computer to digital ocean server with git pull.

Hope it makes sense.

PS. I started to use valet for home developement and Forge for deploying sites to Digital Ocean. I find it easier and cleaner then with docker ;-)

rhand's avatar

Do not think we should run composer as root now should we? And should the webroot files not be another user than root in general?

aurawindsurfing's avatar

Hi Guys,

Just a quick update if someone is looking for laradock. I have to say that I find Laravel Valet much superior to laradock.

  1. It is so much easier to set up.
  2. It does not pull in GB of dependencies on first install (not sure but I have tried it this week and it was awful lot of stuff being downloaded and it took ages)
  3. I was using laradock for backward compatibility but with Adam Wathan https://github.com/adamwathan contributions it now fully supports php56.

So long story short I think at the moment that Laravel Valet and Laravel Forge are the easiest to spin and manage.

justl00king's avatar

@aurawindsurfing - thanks, wouldn't it depend on your setup though? If you need a vps, you can't add the servers created from forge to a private subnet, at least not in aws. In that case, Forge won't work for spinning up servers.

aurawindsurfing's avatar

Hmm forge works with AWS, DO, Vultr. What will not work? Again this is not about using it in production but using it in development env. You can use whatever you like to deploy your code to your AWS.

Please or to participate in this conversation.