Common Practice
There is a common practice on how to setup WordPress development locally. Mostly used are XAMPP and WAMP for this purpose or similar. How to install Wordpress without these?
Quickest and Fastest Way
Today I would like you to show for me the easiest and fastest way how to make WordPress work for you on your local machine in almost a few simple steps. We gonna use Docker hub and it will take 10 minutes.
Download and Install
Download Mac stable installation on official Docker hub domain here:
Run installation from the dmg
file you have downloaded.
Approve access and privileged access that Docker Desktop will ask for.
Copying WordPress Docker Image File
Create a directory for the website for example on Desktop, so go to Desktop
, create directory wpwebsite
and enter into it using these commands one by one.
cd Desktop
mkdir wpwebsite
cd wpwebsite
Save this docker-compose.yml
you will find hereunder file into wpwebsite
directory. It's an image for WordPress docker container installation that will set up all needed, like WordPress directory structure and MariaDB database as well.
Running WordPress Docker Container
Now type into terminal this simple command.
docker-compose up
Login Into WordPress And Install
You are ready to go through WordPress installation on your local machine. Go into the browser and type this URL
.
http://localhost:2000
Docker Desktop Dashboard
Pass all this installation and now you are ready to login to your local WordPress installation. You can check it as well on Docker Desktop Dashboard clicking on a tiny icon on your top panel.
And check it anytime how DB and website are running and stop or delete it anytime.
Login Into Wordpress CMS
When you want to access your local WordPress installation next time just type wp-login.php
after localhost:2000
, so whole url to start installation will be like this.
http://localhost:2000/wp-login.php
And yeah, don't forget to copy some theme into wpwebsite/wp-content/themes
to see something real in your browser, cos this standard installation doesn't have any.
Enjoy Local WordPress Development
Hope you enjoyed this little WordPress installation adventure and found it interesting and now you are ready to go with a local WordPress theme or plugin development.
If you have questions or enjoyed this article, please feel free to comment or message me here or share if you think others might be interested too.
Thanks to Isaac Ibbott for the cover image from Unsplash.
Top comments (2)
thanks but after following the steps getting this error Error establishing a database connection? Any ideas
hi @ajs sorry for the late reply. It worked in my environment quite well. Maybe try this compose file