What is MySQL?
MySQL is the most widely deployed open-source relational database, behind a huge share of web apps and frameworks. This template is a single MySQL 8.4 LTS node, configured entirely through the official image’s environment variables, with data on a volume and an app database and user created on first boot.
It runs internal-only on Lyngbak - apps in the same project connect at mysql:3306. Lyngbak also offers managed MySQL as an addon (backups and failover handled for you), which is the better choice for most apps; this template is for full control of the version and configuration.
For high availability, the catalogue has mysql-innodb-cluster (Group Replication) and percona-xtradb-cluster (synchronous multi-primary); for the MariaDB fork, see the mariadb templates.
What you get
- MySQL 8.4 LTS, the standard relational database
- Configured entirely by environment variables
- App database + user created on first boot
- Internal-only - reached at mysql:3306
- Data on a volume
- GPLv2
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
mysql | relational database (:3306) | no (internal) |
Before you deploy
MYSQL_ROOT_PASSWORDroot password
MYSQL_PASSWORDpassword for the app user
Sizing and billing
1 GiB suits small-to-medium workloads; raise RAM for larger buffer pools. A single node is not HA - see mysql-innodb-cluster or percona-xtradb-cluster.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 9.77 GiB of volumes cost $0.15 per GiB a month ($1.47/mo) for as long as they exist. One workspace can use both. See pricing
Compared with the managed service
| Service | Plan | Price | Includes |
|---|---|---|---|
| AWS RDS | db.t4g.micro | $15/mo | smallest single-AZ instance/mo + storage |
| PlanetScale | Scaler | $39/mo | from $39/mo, then usage-based |
Managed MySQL bills per instance (and per AZ for HA) plus storage/transfer; here it is billed for the compute it reserves. Prices from each vendor's pricing page, June 2026.
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
Should I use this or managed MySQL?
For most apps, managed MySQL is less to operate (backups, failover, upgrades handled for you). Use this template when you need a specific version, custom configuration, or a private in-project database you fully control.
What does this save vs RDS?
AWS RDS for MySQL prices by instance size, roughly doubling for Multi-AZ, plus storage and transfer. This runs on your own infrastructure, on a flat resource or by the second on Usage Billing.
How do I get high availability?
A single node has a single point of failure. For HA use mysql-innodb-cluster (Group Replication with automatic failover) or percona-xtradb-cluster (synchronous multi-primary).