PHPackages                             silverstripe/serve - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. silverstripe/serve

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

silverstripe/serve
==================

Connects the PHP development server to SilverStripe

3.0.0(2y ago)22421.3k↓27%12[3 issues](https://github.com/silverstripe/silverstripe-serve/issues)[1 PRs](https://github.com/silverstripe/silverstripe-serve/pulls)2MITPHPPHP ^8.1CI passing

Since May 19Pushed 2y ago8 watchersCompare

[ Source](https://github.com/silverstripe/silverstripe-serve)[ Packagist](https://packagist.org/packages/silverstripe/serve)[ RSS](/packages/silverstripe-serve/feed)WikiDiscussions 3 Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (20)Used By (2)

Silverstripe Serve
==================

[](#silverstripe-serve)

[![CI](https://github.com/silverstripe/silverstripe-serve/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-serve/actions/workflows/ci.yml)

A simple dev task, to start a development server for your Silverstripe app.

Getting started
---------------

[](#getting-started)

```
$ composer require silverstripe/serve
$ framework/sake dev/build flush=1
$ vendor/bin/serve
```

This will start the server at `http://localhost:8080`.

You can override the host/port:

```
$ vendor/bin/serve --host 127.0.0.1 --port 8000
```

[![](serve.gif)](serve.gif)

Opening a browser
-----------------

[](#opening-a-browser)

You can add the `--open` argument to open a new browser window with the new server.

```
$ vendor/bin/serve --open
```

Including a bootstrap file
--------------------------

[](#including-a-bootstrap-file)

The bootstrap-file argument lets you include a custom PHP file after composer has been loaded (which includes Silverstripe’s Constants.php) but before main.php has been loaded.

This can be used for any number of things, but the primary use-case is to pull in any stub code &amp; config that wouldn’t normally be included by Silverstripe in the current execution session, such as test stubs.

```
$ vendor/bin/serve --bootstrap-file tests/serve-bootstrap.php
```

Using as a library
------------------

[](#using-as-a-library)

You can also use serve as a library, to start a Silverstripe server from some other tool such as a test suite:

Assuming that `BASE_PATH` is defined, you can use it like this:

```
use SilverStripe\Serve\ServerFactory;

$factory = new ServerFactory();

$server = $factory->launchServer([
    'host' => 'localhost',
    'preferredPort' => 3000,
]);

// Print the contents of the homepage
echo file_get_contents($server->getURL());

// Stop the server when you're done with it
$server->stop();
```

If `BASE_PATH` is not defined, e.g. if you are not running a SapphireTest, you can provide an alternative path to the factory constructor:

```
$factory = new ServerFactory(realpath(__DIR__ . '/../'));
```

launchServer allows the following options to be passed to it:

- **host:** The host to listen on, defaulting to 0.0.0.0
- **preferredPort:** The preferred port. If this port isn't available, the next highest one will be used
- **bootstrapFile:** The bootstrap file, as described above

Using as global
---------------

[](#using-as-global)

```
composer global require silverstripe/serve

```

Then you can run `serve` with the `--path` argument

```
serve --path=.

```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~147 days

Recently: every ~40 days

Total

19

Last Release

993d ago

Major Versions

1.x-dev → 2.0.02017-10-09

2.x-dev → 3.0.02023-08-30

3.x-dev → 4.x-dev2023-08-30

PHP version history (5 changes)1.0.0PHP ^5.4

1.0.1PHP ^5.4||^7.0

2.0.0PHP ^5.6||^7.0

2.3.0PHP ^7.3 || ^8.0

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0cba8b534e20e6ab4fff555a97b237a18436ebca1446fc0b29c8a8b504038b9?d=identicon)[GuySartorelli](/maintainers/GuySartorelli)

![](https://avatars.githubusercontent.com/u/111025?v=4)[Ingo Schommer](/maintainers/chillu)[@chillu](https://github.com/chillu)

![](https://www.gravatar.com/avatar/a25bc04c5720a36869d5a39c6449dde7eb43e19b7c8e666d5f632d6a9ab440b1?d=identicon)[emteknetnz](/maintainers/emteknetnz)

![](https://www.gravatar.com/avatar/afbb3dcc9ef29c1a6eedd6addcae5fce9ab1271915a85a4c349301b71237368d?d=identicon)[silverstripe-machine01](/maintainers/silverstripe-machine01)

![](https://www.gravatar.com/avatar/be6648e60fbab6f70bfc34dd8c14259562d28a47510a934ea9c01fe98633f3c2?d=identicon)[sminnee](/maintainers/sminnee)

![](https://avatars.githubusercontent.com/u/1168676?v=4)[Maxime Rainville](/maintainers/maxime-rainville)[@maxime-rainville](https://github.com/maxime-rainville)

---

Top Contributors

[![emteknetnz](https://avatars.githubusercontent.com/u/4809037?v=4)](https://github.com/emteknetnz "emteknetnz (13 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (10 commits)")[![GuySartorelli](https://avatars.githubusercontent.com/u/36352093?v=4)](https://github.com/GuySartorelli "GuySartorelli (6 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (5 commits)")[![flamerohr](https://avatars.githubusercontent.com/u/1064889?v=4)](https://github.com/flamerohr "flamerohr (2 commits)")[![maxime-rainville](https://avatars.githubusercontent.com/u/1168676?v=4)](https://github.com/maxime-rainville "maxime-rainville (2 commits)")[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (1 commits)")[![dhensby](https://avatars.githubusercontent.com/u/563596?v=4)](https://github.com/dhensby "dhensby (1 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/silverstripe-serve/health.svg)

```
[![Health](https://phpackages.com/badges/silverstripe-serve/health.svg)](https://phpackages.com/packages/silverstripe-serve)
```

###  Alternatives

[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)[shopware/deployment-helper

Shopware deployment tools

19305.3k5](/packages/shopware-deployment-helper)[drevops/git-artifact

Package artifact from your codebase in CI and push it to a separate git repo.

2133.2k](/packages/drevops-git-artifact)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
