A nice local dev env using WordPress, Roots/Bedrock and Docker.
Making it easy to version control and maintain your next wp theme or plugin.
You need Docker Desktop and Composer installed to use this setup.
-
Start by cloning this repo:
git clone git@github.com:borgenfalkskott/WordPress.git your-folder
, and move into the folder:cd your-folder
. -
Then simply delete the
/.git
folder by typingrm -R .git
. After this you can setup your own versioning withgit init
and push it to your own repo. -
Rename the container names in
docker-compose.yml
, if you want to. -
Go to the
/bedrock
folder and make a copy of.env.example
, name it.env
and enter your credentials. You can keep most of what's in there already for your dev environment. Important! Do not version control your.env
file, only the.env.example
file. -
Generate your salts at https://roots.io/salts.html and paste them in env format, into your
.env
file. Also, if you are using the ACF Pro plugin, enter your license key inACF_PRO_KEY=''
. -
Run
composer update
in the/bedrock
folder.
Note: If you are NOT using ACF Pro, simply remove this dependency fromcomposer.json
, both underrepositories
and underrequire
. -
Open a new tab in your terminal at the root of the project and start the local dev env:
docker compose up
-
Install WordPress by going to http://localhost:8080
-
Open a new tab in your terminal and shut down:
docker compose down
Login page: http://localhost:8080/wp/wp-login.php
Wp admin: http://localhost:8080/wp/wp-admin/
❤️ Big thanks to @Jitesoft for their contribution with the Docker part of this setup.