vincent15000's avatar

Is it possible to deploy a Laravel application via CI/CD without using Docker ?

Hello,

Hmmm ... I'm a newbee to CI/CD and I want to learn how it works.

So I have followed the Continuous Integration videos on Laracasts and some others on Youtube.

What I notice is that :

  • integration is to build the application

  • deployment is to deploy the application on the server

Well ... integration seems quite easy to do with some known commands like composer install, npm run build, php artisan optimize, ... but all examples given for the deployment step dockerizes the application and pushes it on the Docker Hub. Then it explains some steps on the server to retrieve the application and run the docker container on the server.

But what if I want to deploy automatically the application on the production server for each release of the application without using the docker hub and without using docker at all ?

Example :

  • I code a new feature on a new branch

  • I write the tests

  • I commit and push the code

  • I merge the branch to the dev branch

  • I merge the dev branch to the main branch

  • I create a release from the main branch

And here is what I'd like to get automated : the release is checked by the CI/CD pipeline and if all is ok, the code is updated on the production server.

Is it a good idea to do that ?

Is it possible to do that ?

How to do that ?

Thanks for your help ;).

V

0 likes
3 replies
LaryAI's avatar
Level 58

Absolutely, you can deploy a Laravel application without using Docker! Docker is just one way to package and deploy applications, but it's not required. Many teams deploy Laravel apps using more "traditional" methods, especially on shared hosting or VPS environments.

Is it a good idea?
Yes, it's perfectly fine, especially for small to medium projects or when your infrastructure doesn't require containerization. Docker is great for consistency and scaling, but it adds complexity. If you don't need those benefits, you can skip it.

Is it possible?
Yes, and it's very common.

How to do that?
Here’s a typical workflow for deploying a Laravel app automatically without Docker:

1. Use a CI/CD Service

You can use GitHub Actions, GitLab CI, Bitbucket Pipelines, etc. These services can run your tests and, if successful, deploy your code.

2. Deployment Strategies

  • SSH & Git Pull: The CI/CD pipeline connects to your server via SSH and pulls the latest code.
  • rsync/FTP: The pipeline uploads the new code to your server.
  • Deployment Tools: Use tools like Deployer or Laravel Envoyer for zero-downtime deployments.

3. Example: GitHub Actions + SSH

Here’s a simple example using GitHub Actions to deploy to your server via SSH when you push to the main branch:

What you need:

  • Your server must allow SSH access.
  • Your code should be on the server (cloned from Git).
  • Set up SSH keys and add them to your GitHub repository secrets.

4. Deployment Tools

If you want more features (like zero-downtime), check out:

5. Summary

  • You do NOT need Docker to automate Laravel deployments.
  • Use CI/CD pipelines to run tests and deploy via SSH, rsync, or a deployment tool.
  • Keep your .env and storage files safe—don’t overwrite them unless you intend to.

Let me know if you want a more detailed example for your specific setup!

1 like
kevinbui's avatar

Yeah, it is possible. I use Chipper CI, which is insanely simple, no docker setup of course.

Travis CI also doesn't require docker setup, but it is a bit more complicated.

1 like
muhammedh-shadir's avatar
Level 2

Yes you can do it manually. You can create scripts/deploy.sh which contains all the relevant commands like git pull, npm install, npm build and etc. you can run the deploy.sh scripts in you YML file (.github/workflows/deploy.yml) where use SSH the server and run the deploy.sh script.

1 like

Please or to participate in this conversation.