Introduction
Laravel Cloud allows you to create MySQL and Serverless Postgres databases and attach them to your application’s environments directly from the Laravel Cloud dashboard.
Laravel MySQL
Laravel MySQL provides a fully-managed MySQL database for your application. Laravel MySQL databases are assigned a fixed compute and storage size, but can be scaled at any time. Laravel MySQL databases do not currently support hibernation. For information on connecting to your MySQL database from your application or local machine, see Connecting to Database Clusters.Creating MySQL Databases
To create and attach a MySQL database to an environment:- Navigate to your environment’s infrastructure canvas dashboard
- Click “Add database”
- Select an existing database cluster or create a new one:
- To create a new cluster: Select “Laravel MySQL” as your database cluster type and configure:
- Cluster name: A unique name for your database cluster
- Instance size: Choose from available compute options (Flex or Pro sizes)
- Storage: Configure storage from 5GB to 1,000GB
- Region: Must match your compute cluster’s region
- To create a new cluster: Select “Laravel MySQL” as your database cluster type and configure:
- Select an existing database within the cluster or create a new one:
- Database name: The name of the database within the cluster
You can also create MySQL databases from your organization’s “Resources” page, but they will need to be attached to an environment separately.

MySQL databases can only be attached to compute clusters in the same region.
Database Backups
Laravel MySQL databases support automated and manual backups.Backup Configuration
To configure backups for your MySQL database cluster:- Navigate to “Org > Resources > Databases”
- Click on your MySQL cluster
- Click “Backups”
- Select a backup type:
- Daily backups: Enable automatic daily backups
- None: Disable automatic backups
Backup Retention Period
If you select daily backups, you can configure the retention period from 1-30 days. Automatic backups occur during a daily 3-hour backup window, scheduled between 3AM and 6AM EDT.Manual Backups
You can also create manual backups on-demand from the database cluster’s backup page at any time, regardless of your automatic backup settings.Restoring from Backups
Backups restore to a new database cluster rather than overwriting the existing cluster. To restore from a backup, select the restore action from the “Restore backup” section. Next, give the restored database a name and select which backup snapshot you want to restore from. Once the backup has been restored, you will now have two database clusters, the original database cluster and a database cluster restored from the backup snapshot you selected. At this point you can either detach the original database from your application and re-attach the restored backup, or connect to each database and selectively restore any missing information you might have. When you no longer need one of the database clusters, you may delete it.Backup Pricing
Laravel MySQL backup storage is billed separately from database storage:- Storage pricing:
$0.10/GB-mo
(US regions) and$0.12/GB-mo
(other regions) - Backup pricing: Billed at the same rate as storage pricing
Importing MySQL Data
After enabling your MySQL Public Endpoint, you can use any standard database tools to import your SQL data. For optimal performance, we recommend generating database dumps with the--skip-extended-insert
option, especially for smaller Laravel MySQL instances, to reduce memory usage.
Recommended MySQL Import Tools
The following tools offer efficient and reliable database imports, particularly for larger datasets: These tools support parallel execution, making them significantly faster than the traditionalmysqldump
and mysql
commands when handling large databases. Additionally, GUI-based tools like TablePlus can be used for imports. However, be aware that smaller Laravel MySQL instances may encounter memory limitations when using such tools.
Database Sizing and Performance
Choosing the Right Database Size
Several key factors influence the right database size for your workload: connection requirements, queue workload, backup retention needs, and planned database migrations.Connection Limits
The amount of RAM your database has determines how many simultaneous connections it can support:Server Memory | MySQL Connection Limit |
---|---|
512 MB | 51 |
1 GB | 102 |
2 GB | 204 |
4 GB | 408 |
8 GB | 816 |
16 GB | 1,632 |
32 GB | 3,264 |
All databases are fronted by a proxy layer in Laravel Cloud, which helps multiplex connections for read-only queries, enabling up to 10,000 connections in some conditions. However, writes and transactions cannot be multiplexed—those will count against your MySQL connection limit. Plan your size based on your expected read/write mix.
Queue Workload Considerations
If your application runs queue workers with a low--sleep
interval (such as --sleep=1
or lower), expect high CPU usage. That’s acceptable for development environments, but in production, we recommend a minimum of 2 vCPUs, possibly more for high-throughput jobs.
Backup Retention Planning
Backups are essential—especially for production databases. If you’re working with a disposable or development database, it’s fine to set the retention period to 0 days. For anything else, we recommend at least 2 days of backup retention for basic protection and recovery.Database Migrations and Imports
Planning to transfer or import a database? You may need to temporarily scale up your database’s CPU and memory to handle large or fast MySQL imports.- CPU and memory can be scaled up and down easily
- Storage size can only be increased—not decreased—so plan for long-term needs before import
Database Upgrades
Laravel MySQL databases created before July 2, 2025 require an upgrade to access backup functionality. To check if your database requires an upgrade, click the ”…” menu for your database cluster. If an “Upgrade Database” option is present, an upgrade is required. To upgrade your database:- Navigate to “Org > Resources > Databases”
- Click on your MySQL cluster
- Click the ”…” menu and select “Upgrade Database”
- Confirm the upgrade
Backups are not visible in the UI for databases that have not been upgraded. Contact support if you need assistance with backups for non-upgraded databases.
Troubleshooting
Common Error Messages
Too Many Connections Error
Connection Timeout Error
- If this message appears constantly, confirm you have plenty of disk space and allow 15 minutes for the database to restart after changing disk space limits
- Check notifications to be alerted before reaching these limits
- If this message appears occasionally, you may need to increase your database RAM as the database likely hit an out-of-memory error and restarted during a query or connection burst
- Contact support if issues persist
Performance Monitoring
Monitor your database performance through the metrics dashboard available in your database cluster settings. Watch for:- High CPU usage: May indicate inefficient queries or insufficient compute resources
- High memory usage: Could lead to connection issues or query failures
- Low disk space: Can cause database failures and connection timeouts
Enable notifications in your organization settings to receive alerts before reaching resource limits.
Laravel Serverless Postgres
Powered by Neon

Compute Units
When creating a Laravel Serverless Postgres database cluster, you may configure the range of “compute units” your cluster should scale between based on demand. Compute units correspond to the following vCPU / RAM configurations:Compute Units | vCPUs | RAM |
---|---|---|
.25 | .25 | 1 GB |
.5 | .5 | 2 GB |
1 | 1 | 4 GB |
2 | 2 | 8 GB |
3 | 3 | 12 GB |
4 | 4 | 16 GB |
Connection Pooler
Laravel Serverless Postgres offers connection pooling via pgbouncer, enabling up to 10,000 concurrent connections to your cluster. To connect to the pgbouncer endpoint of your database cluster, append-pooler
to the first segment of the cluster’s host name. For example, if your database cluster’s host name is ep-frosty-shadow-a57j6ubb.us-east-2.pg.laravel.cloud
, the corresponding pgbouncer endpoint is ep-frosty-shadow-a57j6ubb-pooler.us-east-2.pg.laravel.cloud
.
Then, add the new host name as the DB_HOST
environment variable in your environment’s General Settings:
Hibernation
Laravel Serverless Postgres databases may be configured to automatically hibernate after not receiving any incoming database queries for a given number of seconds. When a Serverless Postgres database is hibernating, you will not be billed for its compute resources. If the database receives an incoming query while it is hibernating, the database will automatically wake up within a few hundred milliseconds.
Autoscaling Compute
Serverless compute can autoscale up and down based on your database cluster’s utilization. Set a minimum and maximum range and only pay for the compute resources you actually need.
Database Clusters vs. Databases
When creating a new database cluster, you will be asked to provide the desired name of the cluster and the desired name of the initial “database” that will be created within the cluster. Each database cluster can have as many databases as needed within the cluster. In web development, these databases are sometimes referred to as “schemas”. When attaching a database cluster to an environment, you will actually be selecting a particular database within the cluster that you would like to make available to the environment via theDB_DATABASE
environment variable used by Laravel.
Connecting to Database Clusters
From Your Application
When a database is attached to an environment, Laravel Cloud will automatically inject the environment variables needed by the Laravel application to connect to the database, including theDB_HOST
, DB_USERNAME
, DB_PASSWORD
, and DB_DATABASE
variables. You may view these environment variables in your environment’s General Settings.
From Your Local Machine
To connect to your database from your local machine using a database management client like TablePlus, navigate to your organization’s “Resources” page and click the ”…” icon next to an available database. Then, click “View credentials”.
Postgres SSL Connections
Neon, which powers Laravel Serverless Postgres, uses the public ISRG Root X1 certificate issued by Let’s Encrypt. Due to this, you can create an SSL Connection with your Postgres cluster by using the appropriate CA certificate for your operating system. If you are using macOS, this certificate should already be located within your/etc/ssl/cert.pem
path.
MySQL Public Endpoints
Before connecting to a MySQL database cluster, you must enable its public endpoint. From your organization’s “Resources” page, navigate to the “Databases” tab and click the ”…” icon for the MySQL database cluster you would like to connect to. Then, click “Edit settings” and enable the “Enable public endpoint” toggle. Once the public endpoint has been enabled, you may click the ”…” icon next to the MySQL database cluster and click “View credentials”. When you are finished interacting with your database from your local machine, you are free to disable the public endpoint.MySQL SSL Connections
To connect to MySQL databases that require SSL, you should add the following environment variable to your application:Editing and Resizing Database Clusters
To edit your database clusters and adjust their compute / storage settings, navigate to “Org > Resources > Databases” and click the ”…” icon for the database cluster you would like to edit or resize. Then, click “Edit settings”.Laravel MySQL storage can only be increased once every 6 hours and cannot be decreased.