Deploy MaxScale with Docker
Overview
This guide explains how to deploy MariaDB MaxScale using the official Docker image available via the MariaDB Enterprise Registry. MaxScale is a database proxy that offers load balancing, high availability, and security between MariaDB database servers and your applications.
Prerequisites
Before deploying MaxScale with Docker, ensure the following requirements are met:
Docker installed and running on your system
A MariaDB Enterprise subscription
Your MariaDB Enterprise token and account credentials
Authenticate to the MariaDB Enterprise Registry
MariaDB Docker images are stored in the private MariaDB Enterprise Docker Registry. To retrieve MaxScale Docker images, you must first authenticate with the MariaDB Enterprise Registry using the Customer Download Token.
Obtain Customer Download Token
Log in to the MariaDB Customer Portal.
Locate your Customer Download Token.
Copy the token to use for authentication when logging in to Docker.
As a best practice, ensure that your token is stored securely.
Log in to Docker Registry
For authentication, use your Customer Download Token to the MariaDB Enterprise Registry:
echo "<ENTERPRISE_TOKEN>" | docker login docker.mariadb.com -u <your-mariadb.id-email> --password-stdinReplace:
<ENTERPRISE_TOKEN>with your Customer Download Token.<your-mariadb.id-email>with the email associated with your MariaDB account.
Available Image Tags
The following tags are available for MaxScale Docker image:
latest
Latest stable MaxScale release
25.01
MaxScale 25.01.x series
25.01.1
MaxScale version 25.01.1
25.01.2
MaxScale version 25.01.2
Select the appropriate Docker image tag from the maxscale repository.
Pull the MaxScale Image
Pull the latest MaxScale image using docker pull:
docker pull docker.mariadb.com/maxscale:latestOr pull a specific version:
docker pull docker.mariadb.com/maxscale:25.01.1Run MaxScale in a Container
Basic Example
The default setup of MaxScale, which just activates the REST API, is used by this command:
docker run -d -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latestQuick Start Example
For a quick start that includes database proxy port access:
## Authenticate, pull, and run in one sequence
echo "<ENTERPRISE_TOKEN>" | docker login docker.mariadb.com -u <your-mariadb.id-email> --password-stdin
docker pull docker.mariadb.com/maxscale:latest
docker run -d -p 3306:3306 -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latestConfigure MaxScale
MaxScale must be configured to define backend servers, monitoring, routing services, and listeners. For production deployments, you can either use the default basic configuration or provide a custom configuration file.
Default Configuration
The REST API, which listens on port 8989, is the only feature enabled by the container's minimum default configuration. The default login credentials are:
Username:
adminPassword:
mariadb
Basic Container Setup
Run MaxScale with default configuration using docker run:
docker run -d -p 3306:3306 -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latestParameters:
-d: Run container in detached mode--name mxs: Container name "mxs"-p 3306:3306: Map database proxy port-p 8989:8989: Map REST API port
After launching the container, test the REST API using curl:
curl -u admin:mariadb http://localhost:8989/v1/maxscaleUsing a Custom Configuration File
Before starting the container:
Create a directory on your system to store the configuration file.
Place
your-maxscale.cnffile in this directory.The container will mount this directory in order to enable persistent configuration.
Create a custom MaxScale configuration file and mount it into the container:
docker run -d -p 8989:8989 --name mxs -v /path/to/your-maxscale.cnf:/etc/maxscale.cnf.d/custom.cnf docker.mariadb.com/maxscale:latestOverriding the Default Configuration
If you need to modify the maxscale section, override the main configuration file:
docker run -d -p 8989:8989 --name mxs -v /path/to/your-maxscale.cnf:/etc/maxscale.cnf.d docker.mariadb.com/maxscale:latestAccess the Container
To access the running the container's shell:
docker exec -it mxs bashVerify MaxScale is Running
After starting the container, verify that MaxScale is running correctly. Check the container status by executing the below command:
docker ps --filter "name=mxs"Managing the Container
Stop the Container
To stop the running container, use:
docker stop mxsRemove the Container
Delete the container after use with the following command:
docker rm mxsLast updated
Was this helpful?

