Deploy Laravel on CloudPloy
CloudPloy deploys a Laravel app from Git into a Docker container on your own server: a server in your AWS account, or a server you connect over SSH. This page explains what CloudPloy does with a Laravel app and what you still set up yourself.
Deploy a Laravel app
- In the console, choose New app.
- Pick a repository from GitHub, GitLab or Bitbucket, or paste the URL of a public repository, and choose the branch.
- Leave the type on Detect automatically. CloudPloy reads the repository and finds Laravel.
- Pick the server and deploy.
You can also ask your AI agent to do this through the CloudPloy MCP server.
How CloudPloy builds a Laravel app
For Laravel and other PHP apps, CloudPloy uses its own Dockerfile on a PHP 8.4 image with Nginx. The build:
- runs
composer install --no-dev --optimize-autoloader; - runs
npm ciandnpm run buildwhen the repository has apackage.json; - serves the
publicfolder.
CloudPloy does not run php artisan migrate for you. Run migrations against your database from your own machine or your CI before you deploy code that needs them.
Settings every Laravel app needs
APP_KEY: create one withphp artisan key:generate --showand save it as a secret variable.APP_ENV=productionandAPP_DEBUG=false.LOG_CHANNEL=stderr, so your logs show on the app page.DB_HOST,DB_DATABASE,DB_USERNAMEandDB_PASSWORDfor your own database.SESSION_DRIVERandCACHE_STOREset todatabaseor to your own Redis, because files do not survive a deploy.
Environment variables
Set environment variables on the app page. Mark a value as Secret to store it encrypted; it cannot be viewed again after you save it. CloudPloy gives the app its values when it starts, plus PORT, APP_URL and PRIMARY_DOMAIN. Deploy again after you change a variable.
Deploys, logs and rollback
- Each deploy builds a new container. The old one keeps serving until the new one is ready. If a deploy fails, the old version stays live.
- Turn on automatic deploys on the app page to deploy on every push to the branch.
- The app page shows the build log of each deploy and the latest lines your app writes to stdout and stderr. Write your logs there, not to files.
- Use Rollback on the app page to go back to the version that was live before.
- Run more copies of the app with its Scale settings. CloudPloy does not scale apps automatically.
Domains
Every app gets an address under cloudploy-apps.link with HTTPS. To use your own domain, see Add a custom domain.
What CloudPloy does not do yet
- It can run PostgreSQL, MySQL and Redis (Valkey) on the same server and link them to your app, which then gets the connection URL as an environment variable. Other services you run yourself or use as managed services.
- It keeps no files between deploys. Each deploy starts a fresh container, so store uploads in object storage such as Amazon S3.
- It does not back up your app or your data.
CloudPloy also does not run queue workers or the Laravel scheduler for you yet.