Create small but fully functional websites or blogs in no time and with little effort 👌
Herbie is a blazing fast, lightweight, and highly customizable flat-file Content Management System (CMS) running on PHP, Twig, Markdown, Textile, reStructuredText, and other human-readable text files.
Herbie relies on battle-tested libraries:
- Markdown, reStructuredText, and Textile for page content formatting
- Twig as the template engine for layouts and core extensibility
- YAML and JSON for structured data
- Composer and Packagist for dependency and plugin management
Its plugin system makes Herbie highly extensible, with built-in support for:
- Application and route middlewares
- Event listeners
- Custom Twig filters, functions, tests, and globals
- Console commands
Herbie follows the PHP-FIG standards:
- PSR-3 Logger Interface
- PSR-4 Autoloading Standard
- PSR-7 HTTP Message Interface
- PSR-11 Container Interface
- PSR-14 Event Dispatcher
- PSR-15 HTTP Handlers
- PSR-16 Simple Cache
- PSR-17 HTTP Factories
- PER-CS 3.0 Coding Style
Quality is ensured through:
- Unit, integration, and acceptance testing with Codeception
- Static analysis with PHPStan
- Automated code style enforcement with PHP-CS-Fixer and Twig-CS-Fixer
- Static architecture analysis with Deptrac
8.3 / 8.4 / 8.5 / 8.6
Create your own Herbie website with Docker (recommended):
docker run --rm -v "$PWD":/app composer create-project --ignore-platform-reqs getherbie/start-website mywebsite
cd mywebsite
docker compose up website
Open http://localhost:8888.
Want to see it first? The Herbie Website Starter demo ships with 7 themes.
Without Docker (PHP & Composer required)
composer create-project getherbie/start-website mywebsite
cd mywebsite/web
php -S localhost:8888 index.php
Work on this repository with Docker (recommended):
git clone https://github.com/getherbie/herbie.git
cd herbie
docker compose up website
Open http://localhost:8888.
Common tasks:
docker compose run --rm install # install Composer dependencies
docker compose run --rm qa # run all checks and tests
docker compose run --rm bash # open a shell
docker compose up test-website # test fixture site on http://localhost:8889
Use a different PHP version (default: 8.3):
PHP_VERSION=8.3 docker compose up website
PHP_VERSION=8.4 docker compose up website
PHP_VERSION=8.5 docker compose up website
PHP_VERSION=8.6 docker compose up website
Checks and tests (inside the container via docker compose run --rm bash, or with local PHP/Composer):
composer qa # all checks and all test suites
Static checks only:
composer qa:check # lint, cs, cs-twig, phpstan, deptrac
composer qa:check:phpstan # or a single check
composer qa:check:deptrac
composer qa:check:lint
composer qa:check:cs
composer qa:check:cs-twig
Tests only:
composer qa:test # all suites
composer qa:test:unit # or a single suite
composer qa:test:integration
composer qa:test:acceptance
composer qa:test:website
composer qa:test:coverage
The integration suite renders every twig code fence from the documentation and checks that its string literals use single quotes (tests/integration/Docs/TwigExamplesTest.php). It also checks the syntax of php, yaml, json and bash fences (tests/integration/Docs/DocSyntaxTest.php). Mark examples that cannot run or be parsed in the test site with no-test, e.g. ~~~twig no-test or ~~~php no-test.
The integration suite also checks the Twig reference data in website/site/data/twig_{functions,filters,tests}.yml against the functions, filters and tests registered in the test site (tests/integration/Docs/TwigReferenceTest.php).
Auto-fix code style:
composer qa:fix # PHP and Twig
composer qa:fix:cs # PHP only
composer qa:fix:cs-twig # Twig only
Coverage requires Xdebug or PCOV. The Docker image includes Xdebug, so composer qa:test:coverage works inside the container; for a local PHP installation you need to install a coverage driver first.
Without Docker (PHP & Composer required)
git clone https://github.com/getherbie/herbie.git
cd herbie
composer install
cd website/web
php -S localhost:8888 index.php
Optional: HERBIE_DEBUG=1 php -S localhost:8888 index.php for debug output, or XDEBUG_MODE=debug php -S localhost:8888 index.php for Xdebug.
For more information, see https://herbie.tebe.ch.