Blog.

How to install Wordpress with Docker in 4 easy steps

How to install Wordpress and MarinaDB with Docker in 4 easy steps

in 4 copy and paste commands

Prerequisits

Working Docker installation

Test it with this command

docker --version // docker version 

Output something like this

Docker version 19.03.13, build 4484c46d9d 

Step 1

Pull marinaDB

sudo docker pull mariadb 

Step 2

Run the marinaDB container

NOTE YOUR PASSWORD IN YOUR PASSWORD MANAGER. YOU WILL NEED IT LATER.

sudo docker run -e MYSQL_ROOT_PASSWORD=<YOURPASSWORD> -e MYSQL_DATABASE=wordpress --name wordpressdb -v "$PWD/database":/var/lib/mysql -d mariadb:latest 

Step 3

Pull wordpress

sudo docker pull wordpress 

Step 4

Run the marinaDB container

NOTE USE MARINADB PASSWORD AGAIN

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

Open your browser to finish the wordpress setup

Visit localhost. Or enter http://localhost/ in your browser.

Like my content?Follow me on Twitter.

More Stories

React Finnland is amazing !!! LIVE

Cursus vitae congue mauris rhoncus aenean. Pellentesque habitant morbi tristique senectus et. Nisl

Die Frau im Garten

Eine Frau, schm├Ąchtiger Figur, genickte, ja sogar ein geknechtet Haltung, lief Stunden lang in Ihrem Garten umher. Ein langsamer Schritt nach