How do I log into phpMyAdmin in Coolify using the internal IP?
Authenticate initially using the database container's internal IP address with the root username and password to establish a stable connection. This bypasses Docker DNS resolution failures and allows you to configure persistent users that resolve future "access denied" or "getaddrinfo" errors.
At InfraCordeX, we often find that relying on service aliases like db or mysql in a fresh Coolify environment is a recipe for failure. While building the infrastructure for high-traffic platforms, we realized that a direct IP handshake is the only way to guarantee a successful first-time login when the Docker networking layer is still initializing.
Initial Login via Internal IP
Before you can use your application-specific credentials, you must gain entry as the superuser. Since Docker's internal DNS can be flaky during initial container orchestration, you need to find the specific bridge IP assigned to your database.
Access your server via SSH and run this command:
Bash
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' [DATABASE_CONTAINER_ID]
Take the resulting IP (e.g., 11.0.1.77) and enter it into the Server field on the phpMyAdmin login page. Use root as the username and your defined root password to gain access.
Configuring Your Primary Database User
Once you have established the root session, you must create a user that is permitted to connect from any internal container within the Docker network. Using the % wildcard ensures that even if your backend container's internal IP changes, the database remains accessible.
Run these SQL commands in the phpMyAdmin SQL tab:
SQL
-- Create the user with a wildcard host for internal network access CREATE USER IF NOT EXISTS 'username'@'%' IDENTIFIED BY 'your_normal_password'; -- Grant full privileges to the specific database GRANT ALL PRIVILEGES ON `default`.* TO 'username'@'%'; -- Refresh the privilege tables to apply changes FLUSH PRIVILEGES;
Switching to Persistent Credentials
After running these commands, log out of the root account immediately. From this point forward, always use your new username and your_normal_password for both phpMyAdmin and your application’s environment variables. This practice isolates your root credentials and prevents permission-related connection drops during scaling.
| Credential Type | Use Case | Host Permission | Stability |
| Root User | Initial setup / Recovery | Often restricted | High (via IP) |
| App User | Daily Operations | Wildcard (%) | Highest |
| Service Alias | Development | N/A | Variable |
For deeper insights into managing your stack, refer to the Docker Networking Guide or the official MySQL User Management documentation.
Struggling with server deployments or Coolify configurations? InfraCordeX optimizes your infrastructure for speed and security. Contact Us
