Install Winter Boot
Set up your machine for Winter Boot development. Pick one path — you only need one:
- Option A — Docker (recommended). PHP, Swoole, the
winter_bootnative extension, and the commonly needed extensions come pre-installed in the Winter Boot base image. No PECL, nophp.iniediting, no manual extension builds. - Option B — Manual install. Install PHP yourself, require the packages with Composer, and build the extensions.
Option A — Docker (recommended)
Section titled “Option A — Docker (recommended)”The suvera/winter-boot image is built on php:8.5-cli-alpine and already contains swoole, winter_boot, redis, rdkafka, pcntl, curl, zip, and pdo_pgsql. It does not include Composer, so install your dependencies in a separate build stage using the official composer image:
# Stage 1: install Composer dependenciesFROM composer:2 AS vendorWORKDIR /appCOPY composer.json composer.lock ./RUN composer install --no-dev --optimize-autoloader --ignore-platform-reqs
# Stage 2: runtime imageFROM suvera/winter-boot:latestWORKDIR /appCOPY --from=vendor /app/vendor/ vendor/COPY Application.php ./COPY src/ src/COPY config/ config/
EXPOSE 8080CMD ["php", "Application.php"]docker build -t my-winter-service:latest .docker run -p 8080:8080 my-winter-service:latestOnce the container is serving traffic, continue with the Quickstart — the code is the same inside or outside Docker. For a complete project layout (Phar build, datasource configuration, and more), see suvera/winter-example-service.
Option B — Manual install
Section titled “Option B — Manual install”-
Install PHP 8.5 or later
Confirm your version, and make sure the PHP development tools (
phpize,php-config) are installed — you need them to build the native extension:Terminal window php -vphpize --version -
Install the Composer packages
Install the framework, plus only the libraries you use:
Framework only composer require suvera/winter-bootAdding libraries (install winter-boot alongside each one) composer require suvera/winter-boot suvera/winter-modulescomposer require suvera/winter-boot suvera/winter-doctrinecomposer require suvera/winter-boot suvera/winter-eurekacomposer require suvera/winter-boot suvera/winter-memdbPackage What it gives you suvera/winter-bootFramework core: DI, AOP, REST, PDBC, transactions, migrations, async, scheduling, actuator, telemetry — always install this suvera/winter-modulesIntegration modules: Kafka, SQS, S3, OpenSearch, Redis, Memcache, DTCE suvera/winter-doctrineDoctrine ORM and DBAL plus multi-tenant datasources suvera/winter-eurekaService discovery via Consul or Netflix Eureka suvera/winter-memdbEmbedded in-memory servers (Redis, Ignite, Memcached, Hazelcast) managed by the app (experimental) -
Install the required PHP extensions
Two extensions are required. Everything else is optional — see the table below.
-
swoole— the built-in HTTP server (WinterWebSwooleApplication),#[Async],#[Scheduled], daemon threads, and several libraries.Terminal window pecl install swoole -
winter_boot— the framework’s native extension, required since Winter Boot 2.1.0; the application refuses to start without it. See Native Extension for what it provides.Build it from the
php-ext/directory that ships inside the Composer package you installed in the previous step:Terminal window cd vendor/suvera/winter-boot/php-ext/phpize./configure --enable-winter_bootmakesudo make install
Enable both extensions in your
php.ini:php.ini extension=swoole.soextension=winter_boot.soOptional extensions — install only for the integrations you use. Extensions you never use only add build time and attack surface.
You need Extension Install Redis module, DTCE with Redis backend redis(phpredis)pecl install redisKafka module, DTCE with Kafka backend rdkafka(needs thelibrdkafka-devsystem library)pecl install rdkafkaMemcache module, Memdb Hazelcast client memcachedormemcachepecl install memcachedOpenTelemetry tracing opentelemetrypecl install opentelemetryA relational database one of pdo_sqlite,pdo_mysql,pdo_pgsql,pdo_sqlsrv,pdo_ocivia your OS PHP packages Image processing (how-to guide) imagickpecl install imagick -
-
Verify the setup
Terminal window php -vphp --ri swoolephp --ri winter_bootAll three commands should succeed without errors before you move on.