Skip to content

forkpress server

forkpress server manages background ForkPress preview servers for the current user.

Use it to start a site in the background, list registered servers, or stop servers without relying on the shorthand top-level commands.

Usage

Terminal window
forkpress server <command> [options]

Subcommands

SubcommandPurpose
startStart this site’s server in the background.
listList running ForkPress site servers started by the current user.
stopStop a server by site, PID, or all known live records.

start

forkpress server start starts the site in the background. It accepts the same startup options as forkpress start, but forces background mode.

Terminal window
forkpress server start [options]
OptionDefaultDescription
--work-dir <path>.forkpressSite state directory to serve.
--php-bin <path>Embedded PHPPHP binary used to run WordPress and ForkPress runtime scripts.
--host <address>127.0.0.1TCP address the PHP server binds to.
--port <port>18080TCP port for previews and the Git smart-HTTP remote.
--root-host <host>wp.localhostRoot host for the main preview and branch subdomains.
--site-title <title>ForkPressSite title used when bootstrapping a site that needs runtime preparation.
--workers <n>min(8, CPUs * 2)Number of PHP CLI server workers on Linux and macOS.
--backgroundEnabled by server startStart in the background. Passing it is allowed but redundant.
--foregroundDisabledAccepted by the parser, but server start still forces background mode.

Example:

Terminal window
forkpress server start --port 18081

list

forkpress server list prints live registry records.

Terminal window
forkpress server list

Output columns:

ColumnDescription
PIDForkPress wrapper process ID.
PHP PIDChild PHP server process ID when known.
PORTPreview server port.
ROOT HOSTRoot host used for previews.
WORK DIRSite state directory.
LOGForkPress wrapper log path.

If no live records exist, ForkPress prints forkpress: no running site servers found.

stop

forkpress server stop stops matching registered servers and detaches mount-backed storage. It accepts the same options as forkpress stop.

Terminal window
forkpress server stop [options]
OptionDefaultDescription
--work-dir <path>.forkpressStop the server registered for this site state directory.
--allDisabledStop every running ForkPress site server for the current user. Cannot be combined with --pid.
--pid <pid>NoneStop a specific ForkPress server process. Cannot be combined with --all.
--timeout <seconds>10Seconds to wait for graceful shutdown before forcing the process down.
--forceDisabledForce detach of mount-backed storage after stopping.

Example:

Terminal window
forkpress server stop --work-dir .forkpress

Shorthand Commands

ShorthandEquivalent
forkpress serveforkpress server start
forkpress stopforkpress server stop