Skip to main content
Version: 1.6.6

Custom Domain for phpMyAdmin

In OpenPanel, each user has isolated services, including a dedicated phpMyAdmin instance accessible via a unique port.

By default, a user’s phpMyAdmin instance is accessible at:

http://IP:PORT

Tip: The assigned address is visible in OpenPanel under MySQL > phpMyAdmin.


Setting a Custom Domain for All Users

You can configure a single custom domain for all users’ phpMyAdmin instances. Users will then access phpMyAdmin via:

https://your-domain:PORT

Example:

Steps

1. Add Your Domain in Caddy

Edit the Caddy configuration file:

nano /etc/openpanel/caddy/Caddyfile

Add a section for your phpMyAdmin domain (example: phpmyadmin.my-domain.com):

# START PHPMYADMIN DOMAIN #
phpmyadmin.my-domain.com: {
@withPort {
host phpmyadmin.my-domain.com
}
reverse_proxy localhost:{http.request.port}
}
# END PHPMYADMIN DOMAIN #

caddyfile

Next, create an empty file for Caddy to manage SSL automatically:

touch /etc/openpanel/caddy/domains/phpmyadmin.my-domain.com.conf

Restart the Caddy service:

docker restart caddy

2. Configure PMA_ABSOLUTE_URI for New Users

Edit the .env file for new users:

nano /etc/openpanel/docker/compose/1.0/.env

Under # PHPMYADMIN, add:

PMA_ABSOLUTE_URI="http://phpmyadmin.my-domain.com:{PMA_PORT}/"

Save the file.

env file

From now on, all new users will have phpMyAdmin accessible via your custom domain. This will also be reflected in the OpenPanel UI.


Allow Users to Set Their Own Custom Domains

Users can choose their own domains for phpMyAdmin instead of using IP:PORT.

Example:

Steps

  1. Enable the edit_vhost module in OpenAdmin > Settings > Modules :

    module

    and ensure it’s included in the feature sets used by hosting plans: feature

  2. Users will see an Edit (pencil) button on MySQL > phpMyAdmin. edit

  1. To configure a custom domain, users must:

    1. Add the domain under Domains > New.
    2. Edit the VirtualHost for the domain to proxy traffic to phpmyadmin:80.
    3. Set the domain in MySQL > phpMyAdmin. edit
    4. Restart the phpMyAdmin service.

Once completed, phpMyAdmin is accessible via the user’s chosen domain.