[Docker] PhpMyAdmin on Synology NAS
![[Docker] PhpMyAdmin on Synology NAS](/content/images/size/w1200/2025/09/phpmyadmin.png)
phpMyAdmin is one of the easiest ways to manage MySQL or MariaDB databases through a web interface. On Synology NAS, you can quickly spin it up with Docker.
In this setup, we’ll assume:
- You already have a running database (not creating a new one here).
- The database is reachable at yourdbdomain.com on port 3306.
- We’ll connect phpMyAdmin to that existing database.
docker-compose.yml
Here’s a simple configuration:
services:
phpmyadmin:
image: phpmyadmin:5.2.1
container_name: phpmyadmin
restart: unless-stopped
ports:
- "3077:80" # Access phpMyAdmin at http://your-nas-ip:3077
environment:
PMA_HOST: yourdbdomain.com
PMA_PORT: 3306
PMA_ABSOLUTE_URI: https://db.yourdomain.com
Without docker-compose
If you prefer not to use docker-compose
, you can run phpMyAdmin directly as a container. All you need is a few environment variables and a port mapping:
docker run -d \
--name phpmyadmin \
-p 3077:80 \
-e PMA_HOST=yourdbdomain.com \
-e PMA_PORT=3306 \
phpmyadmin:latest
This gives you the exact same result — phpMyAdmin will connect to your existing database at yourdbdomain.com:3306
and be available at http://your-nas-ip:3077
.
How it works
PMA_HOST
andPMA_PORT
tell phpMyAdmin which database server to connect to.- Since the database already exists, phpMyAdmin will simply connect to it. No new database container is created in this stack.
- Port 3077 on your NAS is mapped to port 80 inside the container. So you can reach phpMyAdmin at:
http://your-nas-ip:3077
or, if you set up Synology’s Reverse Proxy, at:
https://db.yourdomain.com
Notes
- Login with your existing database username and password.
- phpMyAdmin does not create databases; it only connects to your existing one.
- For better security, configure Synology’s Reverse Proxy + SSL certificate and avoid exposing port 3077 directly to the internet.
✅ That’s it — phpMyAdmin is now running on your Synology NAS, connected to your existing database at yourdbdomain.com:3306
.