0 votes
in Other by (340 points)

how to install wordpress with docker on ubuntu

MariaDB in a container:
Start of by making a new directory where you wish to store the files for WordPress and MariaDB for example in your home directory.

mkdir ~/wordpress && cd ~/wordpress

MariaDB Environment variables, these are marked in the Docker command with -e:
docker run -e MYSQL_ROOT_PASSWORD=<password> -e MYSQL_DATABASE=wordpress --name wordpressdb -v "$PWD/database":/var/lib/mysql -d mariadb:latest

confirm that the MariaDB container is running by using the following command:
docker ps

WordPress with Docker:
docker run -e WORDPRESS_DB_PASSWORD=<password> --name wordpress --link wordpressdb:mysql -p 80:80 -v "$PWD/html":/var/www/html -d wordpress

Now in browser open your local IP and start installing..

Please log in or register to answer this question.

Welcome to My QtoA, where you can ask questions and receive answers from other members of the community.
...