<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vladislav Satsko</title>
    <description>The latest articles on DEV Community by Vladislav Satsko (@satskoweb).</description>
    <link>https://dev.to/satskoweb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3327630%2F22ec1579-b518-45d6-a1d9-81fbd501bcdc.png</url>
      <title>DEV Community: Vladislav Satsko</title>
      <link>https://dev.to/satskoweb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/satskoweb"/>
    <language>en</language>
    <item>
      <title>How to deploy phpMyAdmin with Docker Compose and Traefik in 5 Minutes</title>
      <dc:creator>Vladislav Satsko</dc:creator>
      <pubDate>Wed, 30 Jul 2025 17:48:01 +0000</pubDate>
      <link>https://dev.to/satskoweb/how-to-deploy-phpmyadmin-with-docker-compose-and-traefik-in-5-minutes-21h2</link>
      <guid>https://dev.to/satskoweb/how-to-deploy-phpmyadmin-with-docker-compose-and-traefik-in-5-minutes-21h2</guid>
      <description>&lt;p&gt;Many times, there's a need to view a MySQL or MariaDB database in a production or local environment. Installing a management tool via a package manager or deploying it manually through Nginx or Apache can be inconvenient. A more efficient solution is to deploy it using Docker Compose. While there are valid security concerns, in some cases, it’s acceptable to use this setup for a short time frame.&lt;/p&gt;

&lt;p&gt;To improve security, it's important to avoid the default path /phpmyadmin. Instead, set a PathPrefix to a long, non-obvious string, so bots can’t easily scan and find it. While there are always security concerns, this setup can be acceptable for short-term use in controlled environments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;traefik.http.routers.phpmyadmin.rule: Host(`example.com`) &amp;amp;&amp;amp; PathPrefix(`/Wwz3UdlBz4`)`

traefik.http.middlewares.phpmyadmin-stripprefix.stripprefix.prefixes: "/Wwz3UdlBz4"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you also need to enable the prefix middleware so that the path prefix works correctly. Additionally, there's an authentication middleware available for extra security.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;traefik.http.routers.phpmyadmin.middlewares: "phpmyadmin-stripprefix,auth"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The auth middleware sets up basic authentication—you’ll need to define a username and password. Note that passwords must be hashed using MD5, SHA1, or BCrypt. If your hash contains special characters like $, you must escape them by writing the symbol twice (e.g., $$).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;traefik.http.middlewares.auth.basicauth.users: "admin:$$2y$$05$$RkJHVGt64gXEyL1yurYnaepMS2jxfBHUp0GVoHd1kgfnOhp727ND"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, you need to set the PMA_ABSOLUTE_URI correctly, including the http or https scheme. This is different from the Host directive. For PMA_HOST, specify the hostname or IP address of the MySQL container. It's important that both containers are on the same Docker network.&lt;/p&gt;

&lt;p&gt;You can also connect to a MySQL instance running on the host (e.g., 127.0.0.1:3306). To do this, ensure that remote connections are allowed in the my.cnf (or mysql.conf) by removing or commenting out the bind-address directive. If you're using a bridge network between the container and the host, just set your host IP in PMA_HOST, and it should connect successfully.&lt;/p&gt;

&lt;p&gt;Here is the complete configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services:
  phpmyadmin:
    restart: always
    image: phpmyadmin/phpmyadmin
    networks:
      - web_network
    labels:
      traefik.enable: "true"
      traefik.http.routers.phpmyadmin.rule: Host(`example.com`) &amp;amp;&amp;amp; PathPrefix(`/Wwz3UdlBz4`)
      traefik.http.middlewares.auth.basicauth.users: "admin:$$2y$$05$$3zPppyLkS2h5XilKgnkvsuWaohSJccU5z0DYS16yMiUv3WTDX3Fo2"
      traefik.http.routers.phpmyadmin.middlewares: "phpmyadmin-stripprefix,auth"
      traefik.http.middlewares.phpmyadmin-stripprefix.stripprefix.prefixes: "/Wwz3UdlBz4"
      traefik.http.routers.phpmyadmin.tls: "true"
      traefik.http.routers.phpmyadmin.entrypoints: websecure
    environment:
      - PMA_HOST=backend_mysql
      - PMA_USER=admin
      - PMA_PASSWORD=password
      - PMA_ABSOLUTE_URI=https://example.com/Wwz3UdlBz4/

networks:
  web_network:
    external: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>phpmyadmin</category>
      <category>mysql</category>
      <category>docker</category>
      <category>traefik</category>
    </item>
  </channel>
</rss>
