Install P4 Search using Docker

P4 Search can be installed using the Docker image.

Do not expose P4 Search to the public internet.

Before you begin

  • Ensure that you are using a supported platform:

    • Linux: Ubuntu 20.04, 22.04, 24.04, or RHEL 8, 9
    • Windows: Windows Server 2019, or Windows Server 2022
  • You must have a P4 Server server running (P4 Server2024.1 or later).

  • You must have installed Elasticsearch (Elasticsearch 8.12.1 to 8.19.13 are supported) and have a server running.

  • Ensure that you meet the system requirements for your deployment. See System requirements.

  • Ensure that you have a list of host addresses for the nodes used by Elasticsearch.

  • (Optional:) If you need to secure your P4 Search communications, you must create a Java keystore. To learn more, see Secure P4 Search communications.
  • Your host system must support Docker, and the user deploying the Docker container must have permissions to access Docker. To learn more, see:

Install P4 Search with Docker

P4 Search is provided as a P4 Search Docker image.

To launch P4 Search with Docker, run the following Docker commands on your local host:

  1. Fetch the P4 Search Docker container:

    docker pull perforce/p4search:latest

  2. Create a mount point for mounting the volume for the default.config.properties and service properties configuration files.

    mkdir -p volumes/p4search/etc_in

  3. Create the default.config.properties and service properties configuration files and populate them with your P4 Search configuration. To learn more, see Sample configuration files.

  4. Save the default.config.properties and service properties configuration files in the etc_in folder.

  5. Run P4 Search

    docker run  -d \
        --name p4search.helix \
        -p 1601:1601 \
        -v ./volumes/p4search/etc_in:/opt/perforce/helix-p4search/etc_in \
    perforce/p4search:latest
  6. Access the P4 Search Docker container.

    docker exec -it p4search.helix bash

  7. Verify the installation is running using the following command. Replace <your-host> with your P4 Search instance hostname:

    http://<your-host>:1601/p4search/settings/status

  8. After making changes to the default.config.properties or service configuration files, restart the container for the changes to take effect.

    1. Stop the P4 Search container using the following commands:

      docker stop p4search.helix

      docker rm p4search.helix

    2. Start the P4 Search container using the following commands:

      docker run  -d \
          --name p4search.helix \
          -p 1601:1601 \
          -v ./volumes/p4search/etc_in:/opt/perforce/helix-p4search/etc_in \
      perforce/p4search:latest
    3. Verify the P4 Search container is running using the following command. Replace <your-host> with your P4 Search instance hostname:

      http://<your-host>:1601/p4search/settings/status

Sample configuration files

The sample configuration files are supplied for information only. The content of these files is only a sample and you must change the content to suit you P4 Search system.

If you change the default.config.properties or service properties configuration files while P4 Search is running, you must restart P4 Search for your changes to take effect. To learn more, see Restart the P4 Search Docker container.

To learn more about the configurables in these files and how to modify them, see P4 Search configuration reference and Update the P4 Search configuration

Sample "default.config.properties" configuration file

Copy
com.perforce.p4search.service.tenant-id=default
# Perforce configuration
com.perforce.p4search.core.p4port=ssl:p4dssl.mydomain:1666
com.perforce.p4search.core.p4trust=***************************
com.perforce.p4search.core.allowed=
com.perforce.p4search.core.service.p4user=super
com.perforce.p4search.core.service.p4ticket=***************************
com.perforce.p4search.core.index.p4user=super
com.perforce.p4search.core.index.p4ticket=***************************
# Indexer configuration
com.perforce.p4search.index.name=**********
# ElasticSearch configuration
com.perforce.p4search.elastic.user=elastic
com.perforce.p4search.elastic.pass=*************

Sample "service.properties" configuration file

Copy
# P4Search configuration
com.perforce.p4search.service.version=******
com.perforce.p4search.service.log=log4j2.xml
com.perforce.p4search.service.host=0.0.0.0
com.perforce.p4search.service.port=1601
com.perforce.p4search.service.protocol=http
com.perforce.p4search.service.keystore=
com.perforce.p4search.service.keypass=
com.perforce.p4search.service.truststore=
com.perforce.p4search.service.trustpass=
com.perforce.p4search.service.access-control-allow-origin=http://localhost:1601
com.perforce.p4search.service.token=00000000-0000-0000-0000-000000000000
com.perforce.p4search.service.help-url=https://help.perforce.com/helix-core/integrations-plugins/p4search/current/Content/P4Search/Home-p4search.html
com.perforce.p4search.service.external-url=http://host.docker.internal:1601
com.perforce.p4search.index.threads=8
com.perforce.p4search.service.startup-retry=30000
com.perforce.p4search.service.global-rate-limit=600
com.perforce.p4search.service.login-rate-limit=5
com.perforce.p4search.service.access-token-ttl=600
com.perforce.p4search.service.refresh-token-ttl=900
com.perforce.p4search.service.live-log-limit=300
com.perforce.p4search.elastic.hosts=https://ess:9200
com.perforce.p4search.elastic.insecure=true
com.perforce.p4search.elastic.filter=true
com.perforce.p4search.index.journal-path=./jnl
com.perforce.p4search.index.journal-threshold=1000

Restart the P4 Search Docker container

If you change the default.config.properties or service properties configuration files while P4 Search is running, you must restart P4 Search for your changes to take effect.

  1. Stop the P4 Search container using the following commands:

    docker stop p4search.helix

    docker rm p4search.helix

  2. Start the P4 Search container using the following commands:

    docker run  -d \
        --name p4search.helix \
        -p 1601:1601 \
        -v ./volumes/p4search/etc_in:/opt/perforce/helix-p4search/etc_in \
    perforce/p4search:latest
  3. Verify the P4 Search container is running using the following command. Replace <your-host> with your P4 Search instance hostname:

    http://<your-host>:1601/p4search/settings/status

Next steps