Skip to main content

Install Releem for MySQL on Docker

Run the Releem Agent in a Docker container for MySQL.

Prerequisites​

Create the monitoring account from MySQL permissions, including query visibility if you use the example below. Install Docker, and make sure the Agent container can reach MySQL. Install Docker Compose only if you want to use the Compose method below. Choose a memory limit in MB for MySQL; use 0 only when MySQL can use the host's full memory budget.

Manual installation​

Choose Docker or Docker Compose. Replace every bracketed value before starting the Agent.

Docker​

Run the container with persistent configuration directories:

docker run -d --name releem-agent \
-e RELEEM_API_KEY="[RELEEM_API_KEY]" \
-e RELEEM_HOSTNAME="[SERVER_NAME]" \
-e DB_HOST="[MYSQL_HOST]" \
-e DB_PORT="3306" \
-e DB_USER="releem" \
-e DB_PASSWORD="[MONITORING_PASSWORD]" \
-e MEMORY_LIMIT="[MYSQL_MEMORY_LIMIT_MB]" \
-e RELEEM_QUERY_OPTIMIZATION="true" \
--restart unless-stopped \
-v /etc/mysql/releem.conf.d/:/etc/mysql/releem.conf.d/ \
releem/releem-agent:[VERSION_FROM_DOCKER_HUB]

Check the startup log:

docker logs --tail=100 releem-agent

Docker Compose​

Create compose.yaml:

services:
releem-agent:
image: "releem/releem-agent:[VERSION_FROM_DOCKER_HUB]"
container_name: releem-agent
environment:
RELEEM_API_KEY: "[RELEEM_API_KEY]"
RELEEM_HOSTNAME: "[SERVER_NAME]"
DB_HOST: "[MYSQL_HOST]"
DB_PORT: "3306"
DB_USER: "releem"
DB_PASSWORD: "[MONITORING_PASSWORD]"
MEMORY_LIMIT: "[MYSQL_MEMORY_LIMIT_MB]"
RELEEM_QUERY_OPTIMIZATION: "true"
restart: unless-stopped
volumes:
- /etc/mysql/releem.conf.d/:/etc/mysql/releem.conf.d/

Start the Agent:

docker compose up -d
docker compose logs --tail=100 releem-agent

Use a version shown on Releem Agent tags on Docker Hub. Keep a Compose file containing credentials out of version control.

Connect the generated configuration to MySQL​

Complete this section if you want the MySQL container to load configuration files generated by the Releem Agent. The Agent and MySQL containers must use the same host directory.

  1. Mount the host directory in the MySQL service or container:
services:
mysql:
volumes:
- /etc/mysql/releem.conf.d/:/etc/mysql/releem.conf.d/:ro
  1. Add this line to the active MySQL configuration file inside the database container:
!includedir /etc/mysql/releem.conf.d
  1. Review the generated configuration, then restart the MySQL container during your approved maintenance window.

If you do not connect the generated configuration directory, add the following settings to the active MySQL configuration so Releem can collect statement and slow-query data:

performance_schema=ON
performance-schema-consumer-events-statements-current=ON
performance-schema-consumer-events-statements-history=ON
slow_query_log=ON

Restart the MySQL container after changing its configuration. Confirm that the settings are effective before relying on the related metrics or Query Optimization data.

Installer parameters​

  • DB_HOST, DB_PORT, DB_USER, and DB_PASSWORD configure the MySQL connection.
  • RELEEM_API_KEY connects the Agent to your Releem account.
  • RELEEM_HOSTNAME sets the server name displayed in the Dashboard.
  • MEMORY_LIMIT limits the memory considered for MySQL recommendations; 0 uses the host total.
  • RELEEM_QUERY_OPTIMIZATION=true enables query collection. Remove the line for baseline monitoring only; review the query permissions before enabling it.

Expected result​

After you start the Agent, the Dashboard should show Agent Status: Connected and current metrics or a current data timestamp.

Verify the installation​

Confirm both the Agent connection and current metrics in the Dashboard. If either is missing, check the Agent logs.

Troubleshooting​

Use Troubleshoot the Releem Agent. Correct the reported permission, network, or configuration issue before you re-run or restart the supported procedure.