Deploy Laravel in India with managed MySQL and an in-memory cache
Deploy Laravel in India: Plexivo App Runner in Mumbai, Plexivo Database for MySQL 8.4 over TLS, and Plexivo Cache for sessions, cache and queues.

A Laravel app in production is more than PHP. It needs a web process, a MySQL database, somewhere fast for sessions and cache, a queue for jobs, and a safe home for keys such as APP_KEY. Running all of that close to your users in India, on one bill, is what this guide sets up.
You will deploy Laravel on Plexivo App Runner in Mumbai, connect it to Plexivo Database for MySQL 8.4 over TLS, and use Plexivo Cache, powered by Valkey, for sessions, cache and queues.
What does a Laravel app need in production?
- A web process that serves HTTP. Plexivo App Runner runs it from your Git repository, with HTTPS.
- A MySQL database. Plexivo Database for MySQL is managed MySQL 8.4 LTS for WordPress, WooCommerce, Laravel, Magento and any app that speaks MySQL.
- An in-memory store for sessions, cache and queues. Plexivo Cache is a managed in-memory cache powered by Valkey that the client library your app already uses reaches over TLS.
- Configuration and secrets, kept out of your repository and delivered to the app as environment variables.
All of it runs in Mumbai. India (Mumbai) is live today, and more countries are available on request. Database backups are kept in Mumbai and copied to Hyderabad, so your data and its backups stay in India.
How does Plexivo App Runner build a Laravel app?
Plexivo App Runner builds PHP and Laravel, as well as Node.js, Python, Go, static sites and any Dockerfile. Each build runs in its own isolated sandbox, and every image is signed before it is released.
- Without a Dockerfile, Plexivo detects your language and framework, installs your dependencies, builds and sets the start command.
- With a Dockerfile at the repository root, Plexivo builds it as it is. Use this when you want a specific PHP version, extensions or web server.
Whichever you choose, the app must listen on the port in the PORT environment variable, on 0.0.0.0. Unless your image declares another port with EXPOSE, it is 8080. A build is not live until its instances pass their health check, and the current release keeps serving until then. See builds.
Setting up Plexivo Database for MySQL for Laravel
Every Plexivo Database for MySQL database comes with a database named app in utf8mb4, a user named app with a generated password, and TLS required on every connection. It takes a full backup every day and archives binary logs continuously, so you can restore to any second within your backup period. Each session uses your organisation's time zone, India Standard Time in India.
Each size has a fixed number of connections, shown on the create form before you buy:
| Size | vCPU | Memory | Connections | Price a month |
|---|---|---|---|---|
| nano | 0.25 | 512 MB | 60 | US$11.98 |
| micro | 0.5 | 1 GB | 120 | US$22.05 |
| small | 1 | 2 GB | 250 | US$42.20 |
| medium | 2 | 4 GB | 500 | US$82.50 |
This matters for Laravel. Every PHP-FPM worker, queue worker and scheduled job holds a connection, so size your pools below the limit. A standby with automatic failover is included on Business and available on every plan. Read managed MySQL in Mumbai for backups and failover in depth.
How do I connect Laravel to MySQL over TLS?
Open the database and choose the Connect tab. It has ready-to-paste settings for Laravel, and a CA certificate download, plexivo-mysql-ca.pem. Apps in the same project use the private address, on port 3306; anything outside Plexivo uses the public host and its own port, so always use the port shown.
In .env, the documented Laravel settings are:
DB_CONNECTION=mysql
DB_HOST=your-host.db.plexivo.app
DB_PORT=your port
DB_DATABASE=app
DB_USERNAME=app
DB_PASSWORD=your password
MYSQL_ATTR_SSL_CA=/path/to/plexivo-mysql-ca.pemLaravel's standard config/database.php passes MYSQL_ATTR_SSL_CA to the driver, which then connects over TLS with your database's certificate. Keep the CA file beside your app; it lets the client verify it is talking to your database. Full details are in connect to Plexivo Database for MySQL.
When you connect a Plexivo App Runner app to the database in the console, it also receives MYSQL_URL and MYSQL_CA_CERT, and they follow the password when it rotates.
Using Plexivo Cache for Laravel sessions, cache and queues
Laravel talks to Redis for sessions, cache and queues, and Plexivo Cache speaks the same protocol. Its connection string looks like rediss://default:<password>@sessions-3f9a1c.db.plexivo.app:<port>; rediss:// means TLS. Apps you connect to the cache in the console receive REDIS_URL and REDIS_CA_CERT on their own. Point your client at the CA certificate, and never turn off TLS verification.
In Laravel, that usually means setting the session, cache and queue drivers to redis and pointing the Redis connection at REDIS_URL.
Two choices at create time shape how the cache behaves:
- Persistence. AOF, the default, appends every write to a log on the data volume, so data survives a restart. None keeps memory only, which suits a pure cache.
- When memory is full.
allkeys-lru, the default, removes the least recently used keys.noevictionkeeps every key and refuses new writes.
The documented advice fits Laravel well: keep sessions and rate-limit counters in a Plexivo Cache with allkeys-lru and AOF, and keep job queues on noeviction, so a full cache refuses writes instead of dropping jobs. The smallest size is 256 MB, persisted on its own disk and 1,000 client connections, for US$6.06 a month. See Plexivo Cache.
Step by step: deploy Laravel on Plexivo
- Create the database. Choose Create, then Plexivo Database for MySQL. Enter the Database name, choose the project, keep MySQL 8.4 LTS, pick the Database size and Backups kept, check the Estimated monthly cost and choose Deploy.
- Create the cache. Choose Create, then Plexivo Cache, in the same project. Choose persistence and what happens when memory is full.
- Start the app. Choose Create, then Plexivo App Runner. Under Source, pick GitHub, GitLab or Bitbucket, choose Connect GitHub (or GitLab, or Bitbucket), then the Repository and Branch.
- Size and deploy. Choose a size and the Minimum instances and Maximum instances, check the Estimated monthly cost and choose Deploy. Follow the build on the Deployments tab.
- Connect MySQL and the cache. On the app's Environment tab, under Add a database or cache, choose each Resource and Connect.
- Add your settings. Choose + Add variable for each Laravel setting, such as
APP_ENVand the drivers, then apply. AttachAPP_KEYfrom Plexivo Secrets (see below). - Push to ship. Every push to that branch now builds and deploys a new release, and you can roll back to an earlier one.
How do I run Laravel migrations?
From your laptop, the Plexivo CLI opens an encrypted tunnel to the database, even when it is private:
plexivo auth login
plexivo db connect shop-dbIt listens on 127.0.0.1:3306, or a free port if that one is taken, and prints the connection string to use. Keep it running, point your local Laravel at it, and run Laravel's own php artisan migrate. Opening a tunnel needs the owner or admin role, and every tunnel is recorded in your organisation's audit log. Before a large migration, choose Back up now on the database's Backups tab. See install the Plexivo CLI.
Environment variables and secrets for Laravel
Values on the Environment tab are encrypted at rest. Keys that look like secrets stay masked until you choose Show, and each read is recorded in the audit log. When you apply a change, Plexivo restarts the instances onto the new values one at a time, and each old instance keeps serving until its replacement is ready.
For keys you share across apps, such as APP_KEY or a payment provider's secret, use Plexivo Secrets. On the Environment tab, in Secrets, choose Attach a secret…, pick it and choose Attach. When you change the secret, the app picks up the new version, so one rotation reaches every app that uses it. Plexivo also sets TZ to your organisation's time zone, India Standard Time for India, unless you set it yourself. Read environment and secrets.
Keeping admin tools and workers private
Plexivo App Runner runs web apps, APIs and workers. An app can be public, with its HTTPS address and custom domains, or private, with no internet address at all. Use private apps for internal APIs, workers and admin tools. On the app's Settings tab, in Network access, choose Private and Apply changes. Under Allowed callers, you can then limit which of your apps may connect.
Every instance must pass its health check before it receives traffic. The default check is that the app's port accepts connections, so a worker app should listen on PORT too. See private services.
What does a Laravel stack cost?
The smallest Plexivo App Runner size is US$6.04 a month, the smallest Plexivo Database for MySQL size US$11.98 and the smallest Plexivo Cache size US$6.06: US$24.08 a month together, plus your plan. The Developer plan is US$9 a month billed yearly. Resources are charged by the day, and Indian customers pay in rupees by UPI, card or net banking, with a GST tax invoice. Every limit is on the pricing page.
FAQ
Can I host Laravel in India with managed MySQL?
Yes. Plexivo App Runner runs your Laravel app in Mumbai, and Plexivo Database for MySQL 8.4 LTS runs beside it. Put both in one project and the app reaches the database over the private network on port 3306.
Does Laravel work with Plexivo Cache?
Yes. Plexivo Cache is powered by Valkey and works with the client library your app already uses over TLS, so Laravel's Redis drivers for sessions, cache and queues connect to it. Connected apps receive REDIS_URL and REDIS_CA_CERT.
Do I need a Dockerfile for Laravel?
No. Without one, Plexivo detects PHP and Laravel, installs dependencies and sets the start command. Add a Dockerfile at the repository root when you need a particular PHP version, extensions or web server.
How many MySQL connections does my Laravel app get?
It depends on the size: 60 on the smallest, 120 on 1 GB, 250 on 2 GB and 500 on 4 GB. Count your PHP-FPM workers, queue workers and scheduled jobs, and keep them below the limit.
Where should I keep APP_KEY?
In Plexivo Secrets, attached to the app on its Environment tab. It is encrypted and given to your app as a variable; a revealed value hides itself after 30 seconds, and every reveal is recorded.
Deploy your Laravel app
Create your organisation at cloud.plexivo.io and connect your repository. The free trial is on the Developer plan, and no credit card is required. For more on caching, read an in-memory cache in India.