---
title: "Deploy MySQL InnoDB Cluster"
description: "Deploy a MySQL InnoDB Cluster for high availability"
category: "Storage"
url: https://railway.com/deploy/ha-mysql
---

# Deploy MySQL InnoDB Cluster

Deploy a MySQL InnoDB Cluster for high availability

**[Deploy MySQL InnoDB Cluster on Railway](https://railway.com/template/ha-mysql)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/ha-mysql/manifest.json

- **Creator:** Railway Templates
- **Category:** Storage
- **Total deploys:** 52

## Template content

### initService - delete when done

- **Source:** https://github.com/railwayapp-templates/mysql-cluster

### mysql3 https://devicons.railway.app/mysql

- **Source:** https://github.com/railwayapp-templates/mysql-cluster

### mysql2 https://devicons.railway.app/mysql

- **Source:** https://github.com/railwayapp-templates/mysql-cluster

### mysql1 https://devicons.railway.app/mysql

- **Source:** https://github.com/railwayapp-templates/mysql-cluster

### mysql router https://devicons.railway.app/mysql

- **Image:** mysql/mysql-router

## Documentation

This template deploys a MySQL InnoDB Cluster for a more highly available and redundant data layer.

### Requirements

You will need a [Railway Public API token](https://docs.railway.app/guides/public-api#creating-a-token) for the initialization service.

### Private Networking

All communication between nodes is done over the [private network](https://docs.railway.app/reference/private-networking).

### Configuration Tuning

To tune the configuration of the MySQL Cluster, refer to the [MySQL documentation](https://dev.mysql.com/doc/mysql-shell/8.4/en/mysql-innodb-cluster.html) or the [documentation page in Docker Hub](https://hub.docker.com/_/mysql).

### Connecting to the Cluster

An instance of the [MySQL Router](https://dev.mysql.com/doc/mysql-router/8.4/en/) is deployed with the cluster.  It is recommended to connect to the cluster via the MySQL router, instead of connecting to any one of the nodes directly.

For an example client which connects via the router, see the [exampleApps folder](https://github.com/railwayapp-templates/mysql-cluster/tree/main/exampleApps/python) in the source repo.

### Template Source

The source for this template can be found in the [Railway Templates GitHub](https://github.com/railwayapp-templates/mysql-cluster/tree/main).

The MySQL nodes are built almost directly from the [official MySQL image in Docker Hub](https://hub.docker.com/_/mysql), with the only customization being the addition of a my.cnf file.

### Resources
- [MySQL InnoDB Cluster documentation](https://dev.mysql.com/doc/mysql-shell/8.4/en/mysql-innodb-cluster.html)
- [Example apps](https://github.com/railwayapp-templates/mysql-cluster/tree/main/exampleApps/python) for reference on setting up a client to connect to the cluster

## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/ha-mysql
