This project provides a fully containerized and reproducible WordPress development environment using Nix, Podman, and Direnv.
- Nix: Must be installed with Flakes enabled.
- Direnv: Must be installed and hooked into your shell.
- Podman: The container engine.
-
Clone the Repository:
git clone <your-repo-url> my-new-site cd my-new-site
-
Configure Environment: Copy the template
.envrcfile and customize it for your project.cp .envrc.template .envrc
Now, edit
.envrcto set yourCOMPOSE_PROJECT_NAME, database passwords, and any API keys likeACF_PRO_KEY. -
Allow Direnv: Authorize
direnvto load the environment variables.direnv allow
-
Enter the Nix Shell: This will download all the necessary tools like
podman-compose.nix develop
-
Start the Services: Build the custom image and launch all the containers.
make start
The first time you run this, it will take a few minutes to download and build the WordPress image. Subsequent starts will be much faster.
-
Run WordPress Setup: After the containers are running, visit
http://localhost:8080in your browser to complete the famous WordPress 5-minute installation. -
Install Recommended Plugins: Use the built-in
makecommand to automatically install plugins like WPGraphQL.make setup
- Start environment:
make start - Stop environment:
make stop - View logs:
make logs - Restart:
make restart
Your WordPress files are located in the ./src directory. You can now start developing your theme or plugin.