MariaDB (LinuxServer.io)

Deploy a MariaDB database server using a secure, multi-arch Docker image. Features easy user mapping, regular updates, and a custom base image for stability.

This Docker image provides a simple way to run MariaDB, a popular open-source relational database server created by the original developers of MySQL. Maintained by the LinuxServer.io team, this container is designed for ease of use, security, and regular maintenance.

The image comes with several key benefits inherent to the LinuxServer.io ecosystem:

  • Regular Updates: Both the application and the base OS receive timely updates.
  • Easy User Mapping: Configure user and group permissions effortlessly using PUID and PGID variables to avoid permission issues.
  • Efficient Design: A custom base image with s6 overlay and common layers across all their images minimizes disk space and bandwidth usage.
  • Multi-Arch Support: The container supports both x86-64 and arm64 architectures, automatically pulling the correct image for your system.

Configuration is straightforward using environment variables to set the root password, create an initial database, and define a user. For more advanced setups, you can bootstrap a new instance by placing .sql files in the /config/initdb.d/ directory, which will be executed on the first run. The container also includes tools like mariadb-check for database maintenance and repair.

Directory Structure

mariadb-linuxserver-io
mariadb
config
.env
docker-compose.yml

docker-compose.yml

services:
  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
      - ./config:/config
    ports:
      - 3306:3306
    restart: unless-stopped

.env

MYSQL_ROOT_PASSWORD=your_super_secret_root_password
MYSQL_DATABASE=my_database
MYSQL_USER=my_user
MYSQL_PASSWORD=your_super_secret_password
Categories:

Share:

Ad
Favicon

 

  
 

Similar to MariaDB (LinuxServer.io)

Favicon

 

  
  
Favicon

 

  
  
Favicon