---
title: "Laravel Docker 13 - Set Up MySQL and Adminer in Docker"
url: "https://magecomp.com/blog/laravel-docker-13-set-up-mysql-and-adminer/"
date: "2026-04-15T12:41:19+00:00"
modified: "2026-04-15T12:41:21+00:00"
author:
  name: "Bharat Desai"
  url: "https://magecomp.com"
categories:
  - "Laravel"
word_count: 690
reading_time: "4 min read"
summary: "Laravel is a great PHP framework for building web applications that need databases. When you work with databases, you need a way to view and manage your data easily. Adminer is a simple tool that l..."
description: "Set up MySQL and Adminer in Docker for Laravel 13 with this step-by-step guide."
keywords: "Laravel"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Implement API Versioning in Laravel"
    url: "https://magecomp.com/blog/implement-api-versioning-laravel/"
  - title: "Write Cleaner Laravel Code Using the when() Helper"
    url: "https://magecomp.com/blog/write-cleaner-laravel-code-using-when-helper/"
  - title: "How to Add Blur Effect to Image in Laravel 12?"
    url: "https://magecomp.com/blog/add-blur-effect-to-image-laravel-12/"
---

# Laravel Docker 13 - Set Up MySQL and Adminer in Docker

_Published: April 15, 2026_  
_Author: Bharat Desai_  

![Laravel Docker 13 - Set Up MySQL and Adminer in Docker](https://magecomp.com/blog/wp-content/uploads/2026/04/Laravel-Docker-13-Set-Up-MySQL-and-Adminer-in-Docker-1024x512.webp)

Laravel is a great PHP framework for building web applications that need databases. When you work with databases, you need a way to view and manage your data easily. Adminer is a simple tool that lets you manage your MySQL database in a web browser. It works like phpMyAdmin but is much lighter and easier to use.

Docker makes it simple to set up Laravel with MySQL and Adminer. You can view your database tables, add new data, and run SQL queries right from your web browser. This blog will show you how to install Adminer with your Laravel Docker setup. You will learn how to connect to your MySQL database and manage it easily.

[![Laravel Development Service](https://magecomp.com/blog/wp-content/uploads/2025/01/Laravel-Development-Service-1024x284.webp)](https://magecomp.com/services/laravel-development-services/)

## Steps to Set Up MySQL and Adminer in Laravel Docker 13:
### Step 1: Create a Laravel Project
First, create a new Laravel project using the following command:

```
laravel new my-app
```

This will generate a fresh Laravel application with all the necessary files.

### Step 2: Create Dockerfile
Now, create a Dockerfile in your project root

```
FROM php:8.3-fpm

WORKDIR /var/www/html

RUN apt-get update && apt-get install -y 
    libzip-dev unzip curl supervisor nginx 
    && docker-php-ext-install zip pdo pdo_mysql

RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - 
    && apt-get install -y nodejs 
    && npm install -g npm@latest

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

COPY . /var/www/html

RUN rm -f /etc/nginx/conf.d/default.conf /etc/nginx/sites-enabled/default

COPY ./.docker/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY ./.docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN mkdir -p /var/lib/nginx && chown -R www-data:www-data /var/lib/nginx

RUN composer install
RUN npm install && npm run build

RUN echo "listen = 9000" >> /usr/local/etc/php-fpm.d/zz-docker.conf

RUN chown -R www-data:www-data /var/www/html

EXPOSE 80

CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
```

### Step 3: Create NGINX Config File
Create this file:

```
.docker/nginx/default.conf

server {
    listen 80;
    index index.php index.html;
    root /var/www/html/public;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
        include fastcgi_params;
        fastcgi_pass web:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    }

    location ~ /.ht {
        deny all;
    }
}
```

### Step 4: Create docker-compose.yml
Now, create a docker-compose.yml file:

```
services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    image: laravel-app
    volumes:
      - .:/var/www/html
    ports:
      - "8080:80"
    depends_on:
      - db

  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: laravel
      MYSQL_USER: laravel
      MYSQL_PASSWORD: secret
    ports:
      - "3307:3306"
    volumes:
      - dbdata:/var/lib/mysql

volumes:
  dbdata:
```

### Step 5: Create supervisord.conf
Create this file:

```
.docker/supervisord.conf

[supervisord]
nodaemon=true

[program:php-fpm]
command=php-fpm
autostart=true
autorestart=true

[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
```

### Step 6: Download Adminer
Now download Adminer so you can easily manage your database:

```
curl -L https://www.adminer.org/latest.php -o public/adminer.php
```

This will place Adminer inside your Laravel public folder.

### Step 7: Run Docker Containers
Start your application using Docker:

```
docker-compose up -d --build
```

### Step 8: Access the Laravel Application
Open your browser and visit:

http://localhost:8080

### Step 9: Access Adminer
To manage your database, open:

http://localhost:8080/adminer.php

Use the following credentials:

System: MySQL

Server: db

Username: laravel

Password: secret

Database: laravel

## Final Words
In conclusion, setting up MySQL and Adminer in Laravel 13 with Docker helps you simplify your development process. Now you have your Laravel application running in Docker with MySQL and Adminer, making it easier for you to manage your database directly within your web browser without having to add any extra tools or software to manage your database.

[![Hire laravel Developer](https://magecomp.com/blog/wp-content/uploads/2024/12/Hire-Laravel-Expert-Now-3-1024x284.webp)](https://magecomp.com/services/hire-laravel-developer/)

## FAQ
**1. What is Adminer and why should I use it?**

Adminer is a small database management tool that works like phpMyAdmin. Adminer will enable you to manage MySQL databases via a very simple web-based interface.

**2. Why use MySQL in Docker instead of local installation?**

You will run MySQL by using Docker because it will allow you to configure your MySQL DB environment on an isolated, consistent, easily portable, and resettable environment so it does not interfere with your host operating system.


---

_View the original post at: [https://magecomp.com/blog/laravel-docker-13-set-up-mysql-and-adminer/](https://magecomp.com/blog/laravel-docker-13-set-up-mysql-and-adminer/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-04-16 15:48:31 UTC_  
