BrewWorks is a powerful Homebrew formula that allows you to easily set up project-specific development environments without using Docker. It enables you to install and manage common services such as PHP, MySQL, Redis, Memcached, Nginx, Apache, and Node.js with customized configurations for each project.
myapp start
, myapp stop
).For a detailed exploration of this approach, its design philosophy, and how it compares to other options, please refer to our self-review document.
If you simply want a quick PHP development environment or are a beginner, try this method. You can build an environment in no time. All you need is homebrew.
brew install koriym/brewworks/brewworks
Next, open the formula and set up your dependencies. (If you don’t know what it says, just close it. No problem.)
brew edit brewworks
If you have made any edits, Reinstall to reflect them.
brew reinstall brewworks
Now start the services! All necessary services will be started at once.
brewworks start
You should be able to see it at http://localhost:8080/ .
Edit the configuration file in $(brew --prefix)/opt/brewworks/conf/
for further development.
For multiple projects or a project-specific setup, you can use the formula as a local file to share the build with other members of the team.
wget https://raw.githubusercontent.com/koriym/homebrew-brewworks/1.x/brewworks.rb
Modify the settings in brewworks.rb
according to your project’s requirements.
Rename the file and the class within the file brewworks.rb
to reflect the PROJECT_NAME you specified.
Install the formula.
brew install ./myapp.rb
Your project-specific development environment is now set up and ready to go!
BrewWorks automates the installation of PHP and Composer, eliminating the need for manual setups and permission configurations. Once the installation is complete, you’ll have a fully configured, project-specific development environment ready to go. BrewWorks sets up all the necessary services, such as PHP, MySQL, Redis, and more, with optimized configurations tailored to your project’s needs.
myapp start
myapp stop
. brewworks env
These simple yet powerful commands, unique to BrewWorks, dramatically simplify the management of your development environment. No more navigating through complex docker-compose files or manually starting and stopping individual services. With BrewWorks, you can control your entire development stack with ease and efficiency.
BrewWorks generates a dedicated folder for each project:
myapp
├── config
│ ├── httpd_8082.conf
│ ├── memcached_11212.conf
│ ├── my_3306.cnf
│ ├── my_3307.cnf
│ ├── nginx_8080.conf
│ ├── nginx_main.conf
│ ├── php-fpm_9000.conf
│ ├── php.ini
│ └── redis_6379.conf
├── logs
│ ├── php-fpm-access_9000.log
│ ├── php-fpm_9000.log
│ └── redis_6379.log
├── public
│ └── index.html
├── tmp (sys_temp_dir, upload_tmp_dir..)
├── mysql_0 (datbase data folder)
├── mysql_1
This project-specific folder structure makes it easy to manage configuration files and logs for each service and allows for smooth switching between projects.
Uninstallation is also easy: the brew uninstall
command will erase all unique files, including database folders. This also means that you can reset the environment at any time with the reinstall
command. The database is also initialized.
myapp stop
brew uninstall ./myapp.rb
BrewWorks is an excellent alternative to Docker, enhancing development efficiency with its customizable, user-friendly interface. Unlike Docker, which relies on virtualizing Linux containers to run, BrewWorks leverages native services for better performance.
BrewWorks simplifies the setup process by allowing the installation of PHP, Composer, and other necessary services through Homebrew, reducing complexity.
While Docker is crucial for production, BrewWorks provides an optimized alternative for local development. By combining native performance with Homebrew’s simplicity, BrewWorks enhances productivity and development experience.
For a detailed comparison of BrewWorks with Docker, please refer to our comparison article.