Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nahbyr's avatar

Laravel 10.x docker + PHPStorm guide

Is there a step-by-step guide out there to access the files of a Docker container in PHPStorm? Let me start off by mentioning I'm new to PHPStorm and Docker. The installation page for Laravel 10.x has you install docker and Sail. The documentation then suggests VSC as an editor. However, I'm using PHPStorm. Now, PHPStorm has a plugin to connect to Docker. And all of this I've got working. But I don't understand how to access the files created in the container. Laracast tutorial videos don't mention anything about connecting the 2. They don't even mention Docker. Tbh, I find the videos outdated. They're still installing Laravel 8.x. Neither does the PHPStorm videos go into how to connect to Docker.

Help is greatly appreciated!

0 likes
1 reply
LaryAI's avatar
Level 58

To access the files of a Docker container in PHPStorm, you can follow these steps:

  1. Make sure you have Docker installed on your machine.

  2. Install the Docker plugin in PHPStorm. You can do this by going to "Settings/Preferences" -> "Plugins" and search for "Docker". Install and enable the plugin.

  3. Once the Docker plugin is installed, you can connect PHPStorm to your Docker container. Go to "View" -> "Tool Windows" -> "Docker" to open the Docker tool window.

  4. In the Docker tool window, click on the "+" button to add a new Docker configuration. Select "Docker Compose" if you are using Docker Compose, or "Dockerfile" if you are using a Dockerfile.

  5. Configure the Docker connection by specifying the Docker server URL, the Docker Compose file or Dockerfile, and any other necessary settings.

  6. After configuring the Docker connection, you should see your Docker container listed in the Docker tool window. Right-click on the container and select "Attach Shell" to open a terminal inside the container.

  7. In the terminal, navigate to the directory where your Laravel project is located. Typically, it would be something like /var/www/html.

  8. Once you are inside the container's directory, you can access the files using PHPStorm's file explorer. You can open, edit, and save files just like you would with any other project in PHPStorm.

Here is an example of how you can access the files of a Docker container in PHPStorm:

1. Install Docker on your machine.

2. Install the Docker plugin in PHPStorm.

3. Open the Docker tool window in PHPStorm.

4. Add a new Docker configuration by clicking on the "+" button.

5. Configure the Docker connection by specifying the Docker server URL, Docker Compose file or Dockerfile, and other settings.

6. Open a terminal inside the Docker container by right-clicking on the container in the Docker tool window and selecting "Attach Shell".

7. Navigate to the directory where your Laravel project is located.

8. Use PHPStorm's file explorer to access and modify the files in the container.

By following these steps, you should be able to access and modify the files of your Docker container in PHPStorm.

Please or to participate in this conversation.