p4 webserver
Start or stop the P4 Web Server, or show information about it.
The P4 Web Server is a Technology Preview feature introduced with the 2025.2 release of the P4 Server. Features offered in Technology Preview are experimental and not guaranteed to always work as expected. If you have feedback and functionality suggestions, email techpreview@perforce.com.
The P4 Web Server hosts the REST API and the built-in single sign-on (SSO) service. Start the web server before you use either service.
The web server doesn't provide a browser-based user interface for P4 Server. A request for the root URL (/) returns a 404 response.
To learn more about using the REST API, see the P4 REST API documentation.
Syntax
p4 webserver start -p [ip:]port [--services=service[,service]] p4 webserver start tcp:[ip:]port [--services=service[,service]] p4 webserver stop -p [ip:]port p4 webserver show
Description
Starts or stops the P4 Web Server.
Use the --services option to specify which web server services to start. If the option is omitted, all available services are started.
Supported services:
-
restapi- Starts the REST API service. -
idp- Starts the built-in single sign-on (SSO) service. The service requires the web server to use HTTPS. To learn more, see Built-in single sign-on in the P4 Server Administration Documentation.
Specify multiple services as a comma-separated list.
Supported services examples
Start only the REST API service: p4 webserver start --services=restapi
Start only the built-in SSO service: p4 webserver start --services=idp
Start multiple services: p4 webserver start --services=restapi,idp
If the --services option is omitted, all available services are started: p4 webserver start
Web server protocol and status
If the P4 Server is configured with an SSL certificate, the web server automatically starts in HTTPS mode using the same certificate. This means HTTPS can be enabled even if it is not explicitly configured for the web server.
To force the web server to use HTTP instead of HTTPS, specify the tcp: prefix when configuring the web server port. For example:
p4 webserver start tcp:0.0.0.0:8080
The idp service doesn't work over HTTP, because browsers don't return its secure session cookies over HTTP.
p4 webserver show displays the current configuration and runtime information for the P4 Web Server, including its listen address, protocol (HTTP/HTTPS), status, and any active settings that were applied at startup.
For example, p4 webserver show outputs:
Web server status: running Listen address: tcp:0.0.0.0:8080 Protocol: HTTP Document root: /p4root/htdocs
Options
| Option | Description |
|---|---|
|
|
Enter the port of the web server to start or stop. The inclusion of the IP address is optional. |
tcp:[ip:]port
|
Use this option to force the server to start in HTTP mode, even when the P4 Server is configured to use SSL Enter the port of the web server to start or stop. The inclusion of the IP address is optional. |
show
|
Outputs the current configuration and runtime information for the P4 Web Server. |
|
|
Specifies which web server services to start when using
Specify multiple services as a comma-separated list. If omitted, all available services are started. |
Usage notes
| Can file arguments use revision specifier? | Can file arguments use revision range? | Minimal access level required |
|---|---|---|
|
N/A |
N/A |
available to an operator user |
This command can be run at the command line or used as a startup command in a server specification. To learn more, see Server startup commands in the P4 Server Administration Documentation.