Synology Install MariaDB With Portainer

Synology Install MariaDB With Portainer

My previous guide for MariaDB involved the use of Task Scheduler. Today I’m offering a recommended and excellent alternative for installing the latest MariaDB version via Portainer. Synology already supports MariaDB having made it downloadable via Package Center. But in today’s article I want to teach you how to install the Docker version of MariaDB which will help you set up a database for each Docker package you want to install that requires a database. MariaDB is one of the most popular database server. MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system, intended to remain free and open-source software under the GNU General Public License. In this step by step guide I will show you how to install MariaDB on your Synology NAS using Docker & Portainer.

💡Note: This guide works perfectly with the latest MariaDB 11.2.2 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Install Text Editor via Synology “Package Center”. (Mandatory STEP.) If you already have Text Editor installed on your Synology NAS, skip this STEP.

Synology Install Text Editor 2023

  • STEP 4

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it mariadb. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

MariaDB Synology NAS Portainer Set up 1

  • STEP 5

Now create one new folder inside the mariadb folder that you have previously created at STEP 4 and name it phpmyadmin. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

MariaDB Synology NAS Portainer Set up 2

  • STEP 6

Download (click on the blue link below) then unzip and upload the uploads.ini file below in the phpmyadmin folder that you have previously created at STEP 5. Follow the instructions in the image below. 🔒Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

👉🏻Download uploads.ini

MariaDB Synology NAS Portainer Set up 3

  • STEP 7

Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 8

In the Name field type in mariadb. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: '3.9'
services:
    mariadb:
        image: mariadb:11.2.2
        healthcheck:
         test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
        restart: on-failure:5
        volumes:
            - /volume1/docker/mariadb:/var/lib/mysql:rw
        environment:
            - MYSQL_ROOT_PASSWORD=mariushosting
            - TZ=Europe/Bucharest
            - PGID=100
            - PUID=1026
        ports:
            - 3306:3306
        container_name: MariaDB

    phpmyadmin:
        image: phpmyadmin:latest
        healthcheck:
         test: curl -f http://localhost:80/ || exit 1
        restart: on-failure:5
        environment:
            - PMA_PORT=3306
            - PMA_HOST=192.168.1.18
        volumes:
            - /volume1/docker/mariadb/phpmyadmin/uploads.ini:/usr/local/etc/php/conf.d/php-phpmyadmin.ini:rw
        ports:
            - 2500:80
        container_name: phpMyAdmin

Note: Before you paste the code above in the Web editor area below, change the value for MYSQL_ROOT_PASSWORD and type in your own password. mariushosting is an example for a password. You will need this password later at STEP 12. ⚠️Warning: Do NOT use a complicated password with special characters.
Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value numbers for PUID and PGID with your own values. (Follow my step by step guide on how to do this.)
Note: Before you paste the code above in the Web editor area below, change the value of PMA_HOST and add your own LOCAL NAS IP. 192.168.1.18 is my own Synology NAS IP you should use your own Synology NAS IP.

MariaDB-Synology-NAS-Portainer-Set-up-4-new-2024

  • STEP 9

Scroll down on the page until you see a button called Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

MariaDB Synology NAS Portainer Set up 5

  • STEP 10

If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.

MariaDB Synology NAS Portainer Set up 6

  • STEP 11

Go back to STEP 1 or you will deal with karma 🙂

  • STEP 12

The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection. Now open your browser and type in http://Synology-ip-address:2500 Connect to your MariaDB using root as Username and the MYSQL_ROOT_PASSWORD you have previously chosen at STEP 8. Click Log in. Follow the instructions in the image below. Note: MariaDB doesn’t have a graphical interface; it works in the background. In order to view and create new databases you will need to use phpMyAdmin.

MariaDB Synology NAS Portainer Set up 7

  • STEP 13

Your phpMyAdmin container with MariaDB database at a glance!

MariaDB Synology NAS Portainer Set up 8

  • STEP 14 

Fix the phpMyAdmin configuration storage issue.

Enjoy MariaDB!

🆘TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issues article.

Note: If you want to run the the phpMyAdmin graphical interface container over HTTPS, check How to Run Docker Containers Over HTTPS. In order to make phpMyAdmin work via HTTPS, it’s mandatory to activate WebSocket.

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: Find out how to update the MariaDB container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Wednesday / February 21st, 2024 at 5:43 PM