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
/.gitfolder by typingrm -R .git. After this you can setup your own versioning withgit initand push it to your own repo. -
Rename the container names in
docker-compose.yml, if you want to. -
Go to the
/bedrockfolder and make a copy of.env.example, name it.envand enter your credentials. You can keep most of what's in there already for your dev environment. Important! Do not version control your.envfile, only the.env.examplefile. -
Generate your salts at https://roots.io/salts.html and paste them in env format, into your
.envfile. Also, if you are using the ACF Pro plugin, enter your license key inACF_PRO_KEY=''. -
Run
composer updatein the/bedrockfolder.
Note: If you are NOT using ACF Pro, simply remove this dependency fromcomposer.json, both underrepositoriesand 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.