Install and running yii2 from docker

Dear all,

I want to install an app in local network. I want to have a safe system so that nobody will not mess around with the app and the system. I think docker would be great solution to host my app. I am new to docker though.

I am stuck with ubuntu 16.04 server (php 5.6) to host docker. I installed docker as instructed here,

I clone the yii2 docker from here,

But then, stuck. How to build the yii2 docker? is the docker include mysql and phpmyadmin?

please help,


Ok. I tried this yii2 docker recently and hit some walls first. then after some goofing around / googling / docs I finally managed to run the Yii2 on docker in my local machine. Please check the steps I followed as below.

I used LinuxMint for this steps - please make required changes if you are in a different OS/Distro
follow the instructions here - GitHub - yiisoft/yii2-docker: Official Docker images suitable for Yii 2.0

  • I cloned the repo to my local machine

  • I CDed in the folder and ran cp .env-dist .env

  • did not change any thing in .env since I need the php7.4

  • I did docker-compose build which went successful

  • I ran docker-compose run --rm php php /tests/requirements.php and also successful

  • then I did this step docker-compose run --rm -w /yii2 php bash which landed me inside the container

  • then I did this composer create-project yiisoft/yii2-app-basic /app which installed the framework inside the /app ( inside the container )

  • I opened a new terminal tab and ran docker-compose up which brought the container up

I am confused about the difference in docker-compose run and docker-compose up, anyway !

voila ! I can see the congratulation page !

1 Like