composer.json, so no Dockerfile is needed.
This guide explains how to deploy a Laravel app with MySQL in two ways:
Your repo needs a standard Laravel layout: a composer.json requiring laravel/framework, an artisan file at the root, the usual app/, config/, public/, and routes/ folders, and a .env.example listing the DB and app config variables you use.
The guide assumes your app reads DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD from the environment (Laravel’s default config/database.php does), and APP_KEY, APP_ENV, APP_DEBUG, and APP_URL for app-level config.
Deploy using the Canvas
Create a project from your repo
composer.json. See Import from a GitHub repository for the full set of import options.Click Create project. Suga opens the canvas with the app service already connected to your repo.Add MySQL from a template
MYSQL_DATABASE (defaults to mydb) and MYSQL_USER, and pre-fills generated values for MYSQL_PASSWORD and MYSQL_ROOT_PASSWORD./var/lib/mysql.Expose the app on HTTPS
8000. Then, in the Public Network section, click Add Endpoint → HTTPS Domain and choose port 8000.Wire the database and app config
PORT:8000— FrankenPHP reads this to know which port to bind to.DB_CONNECTION:mysqlDB_HOST:mysqlDB_PORT:3306DB_DATABASE: whatever you set forMYSQL_DATABASEon the mysql containerDB_USERNAME: whatever you set forMYSQL_USERon the mysql containerDB_PASSWORD: choose Reference, pickmysql→MYSQL_PASSWORDAPP_ENV:productionAPP_DEBUG:falseAPP_URL: set tohttps://followed by this container’sSUGA_PUBLIC_HOSTNAMEreference, using the{{...}}picker to insert it alongside literal textLOG_CHANNEL:stderr

Apply to deploy
APP_KEY as a Sensitive env var on the app container. Generate one locally with php artisan key:generate --show and paste the value (starts with base64:). Click Apply in the top right.Suga clones the app repo, runs composer install, applies migrations, links storage, runs php artisan optimize, and boots FrankenPHP on port 8000, serving public/ as the web root. Open the public URL and you’ll get your app’s home route.Deploy using an Agent
To deploy with a coding agent such as Claude Code, Codex, or OpenCode, follow these steps:Connect the Suga MCP
Ask your agent to deploy
Set the sensitive values
MYSQL_PASSWORD and MYSQL_ROOT_PASSWORD on the mysql container: click each value input and paste values generated with openssl rand -hex 32. On the app container, add APP_KEY as a Sensitive env var (generate one locally with php artisan key:generate --show and paste the value).Apply to deploy
composer install, applies migrations, links storage, runs php artisan optimize, and boots FrankenPHP on port 8000, serving public/ as the web root. Open the public URL and you’ll get your app’s home route.FAQ
My deploy fails with 'could not find driver' or 'Table sessions doesn't exist'
My deploy fails with 'could not find driver' or 'Table sessions doesn't exist'
could not find driverat runtime means the PDO extension for your database isn’t installed in the build. Add"ext-pdo_mysql": "*"tocomposer.json’srequireblock (orext-pdo_pgsqlfor Postgres), runcomposer update, and redeploy. Production Laravel apps that shipped on Heroku almost always have this; fresh Laravel 12+ scaffolds don’t.Table 'sessions' doesn't existmeansSESSION_DRIVER=databaseis set (the fresh-Laravel default in the.env.example) but no sessions migration lives indatabase/migrations/. Either runphp artisan session:tablelocally to generate the migration and commit it, or setSESSION_DRIVER=fileon the app container if your app doesn’t need database-backed sessions.
Do I need a Dockerfile to deploy Laravel on Suga?
Do I need a Dockerfile to deploy Laravel on Suga?
composer.json and runs the standard install and start flow. If you already have a Dockerfile, you can tell the agent to use it instead; otherwise auto-detect handles the common case.Which PHP versions does Suga support?
Which PHP versions does Suga support?
composer.json under require.php, and defaults to PHP 8.4 when there isn’t one.How do I set APP_KEY?
How do I set APP_KEY?
php artisan key:generate --show and add the returned string (starts with base64:) as a Sensitive env var named APP_KEY on the app container. Laravel uses it for session encryption and other cryptographic operations, and refuses to run without it.How do I run migrations before the app starts?
How do I run migrations before the app starts?
php artisan migrate --force at every container boot, so migrations happen without any extra configuration. Storage symlinks and php artisan optimize also run automatically.Can I skip auto-migrations at boot?
Can I skip auto-migrations at boot?
RAILPACK_SKIP_MIGRATIONS=true as an env var on the app container. Run migrations manually instead — from the container’s shell in the dashboard, or from your CI pipeline before you Apply.Can I use Laravel Octane?
Can I use Laravel Octane?
laravel/octane and the matching extension (ext-swoole) to composer.json, then pass RAILPACK_START_CMD=php artisan octane:start --server=swoole --host=0.0.0.0 --port=8000 as a build arg.How do I run queue workers or scheduled tasks?
How do I run queue workers or scheduled tasks?
RAILPACK_START_CMD=php artisan queue:work for a worker or RAILPACK_START_CMD=php artisan schedule:work for the scheduler. Set the same env vars and leave it with no public endpoint. For Redis-backed queues, add a Redis container from the template and set QUEUE_CONNECTION=redis with a reference to the Redis password.What if my asset pipeline uses Vite or Mix?
What if my asset pipeline uses Vite or Mix?
package.json, Suga installs the Node dependencies and runs its build script as part of the build. For Mix, whose script is usually named something else, point RAILPACK_BUILD_CMD at it as a build arg, for example npm run production. Compiled assets land in public/build/ and FrankenPHP serves them alongside the app.Where do uploaded files go?
Where do uploaded files go?
FILESYSTEM_DISK and mount a managed volume at /var/www/html/storage/app (or wherever your app writes files). For public assets on a multi-replica deployment, an S3-compatible bucket via Laravel’s s3 disk is a better fit than local storage.Can I use a database other than MySQL?
Can I use a database other than MySQL?
mysql:8.4 container for a MariaDB or Postgres image. Update DB_CONNECTION, the driver-specific env vars, and the PHP extension in your composer.json (ext-pgsql for Postgres, and so on) to match.Can I use a custom domain?
Can I use a custom domain?
APP_URL to the new domain so signed URLs and email links resolve correctly.What does deploying Laravel plus MySQL cost on Suga?
What does deploying Laravel plus MySQL cost on Suga?