Install P4 DAM using Docker
P4 DAM can be installed using the Docker image.
On this page:
Before you begin
-
You must have a P4 Server server running (P4 Server 2024.1 or later). P4 DAM must be connected to the central server or the commit server in a commit-edge environment. One P4 license seat to give P4 DAM super level access to the P4 Server with an optional unlimited timeout ticket when ticket-based authentication is used. To learn more, see Ticket-based authentication in the P4 Admin Documentation.
-
P4 DAM must expose port 443 for https access, and be accessible through the configured HTH_URL from the P4 Server for extensions to work. In addition, port 1601 must be exposed for P4 Server and P4 DAM to communicate with P4 Search. If you do not have a valid DNS record for HTH_URL, you can use /etc/hosts to map the domain and uncomment and update extra_hosts also under backend container in docker-compose.yml.
-
The Docker Compose setup already includes P4 Search, P4 Render, and Elasticsearch with the helix-plugin-filter installed for demonstration purposes.
-
For demonstration deployments using Docker Compose, your system must include a minimum of four CPU cores and 16 GB of memory.
-
Your host system must support Docker, and the user deploying the Docker container must have permissions to access Docker. To learn more:
Advanced setup
-
For P4 DAM production system requirements, see Hardware requirements.
- For P4 Search, P4 Render, and Elasticsearch production system requirements, see System requirements in the P4 Search Documentation.
-
Connect to an external Elasticsearch instance (Elasticsearch 8.12.1 to 8.19.13 are supported). You must have the matching helix-plugin-filter version installed. Ensure you update HTH_P4SEARCH_ES_HOSTS in the .env file as part of step 8 in Install P4 DAM with Docker.
-
Connect to an external P4 Search and P4 Render (version 2026.1 or later is supported). To learn more, see Install P4 Search using Docker in the P4 Search Documentation . When using an external P4 Search, skip P4 Search steps 6 and 9 from Install P4 DAM with Docker below
-
Remove the elasticsearch, p4search, and p4render components from the docker-compose.yml file.
Install P4 DAM with Docker
This Compose file is just an example to illustrate how all the components are connected.
To start P4 DAM with Docker, run the following Docker commands on your local host:
-
Clone the GitHub repository including the Docker-Compose file and the other required files:
git clone https://github.com/perforce/p4dam
cd p4dam
-
Fetch the P4 DAM Docker containers:
docker compose pull
-
Copy the .env.template file as .env.
cp .env.template .env
-
Upload a valid certificate and key under nginx/ssl/server.crt and nginx/ssl/server.key. Alternatively, for demonstration purposes, you can generate a self-signed certificate by running the following command:
openssl req -newkey rsa:2048 -new -x509 -days 730 -nodes -out nginx/ssl/server.crt -keyout nginx/ssl/server.key -subj "/CN=localhost"
-
Generate unique secrets for HTH_SECRET_KEY_BASE and
HTH_SITE_PEPPERenvironment variables by running the following command twice and copying printed hex values.openssl rand -hex 64
-
Generate a token for P4 Search for the HTH_P4SEARCH_TOKEN in the .env file. For example, by using uuidgen.
-
Create a long-lived all-hosts ticket to authorize the P4 DAM integration user and set it as HTH_HELIX_PASSWORD in the .env file. Use the following command to create the long-lived all-hosts ticket:
p4 -p <p4port> -u <p4user> login -a -p
-
Configure the following initial setup variables for your instance in the .env file. To learn more, see Update configuration settings.
CopyHTH_DB_PASSWORD
HTH_DEFAULT_COMPANY
HTH_HELIX_CHARSET
HTH_HELIX_FINGERPRINT
HTH_HELIX_P4PORT
HTH_HELIX_PASSWORD
HTH_HELIX_USER
HTH_INIT_BOTNAME
HTH_INIT_COMPANY_NAME
HTH_INIT_PASSWORD
HTH_INIT_USERNAME
HTH_P4SEARCH_ES_PASSWORD
HTH_REDIS_PASSWORD
HTH_SECRET_KEY_BASE
HTH_SITE_PEPPER
HTH_URL
MONGO_INITDB_ROOT_PASSWORD -
Configure P4 Search with the following command:
docker compose run --rm --entrypoint "bash" -T p4search < p4search/dam_configure.sh
-
Run Docker.
docker compose up -d
-
Run the initial backend setup for P4 DAM with the following command:
docker compose exec backend bin/rails hth:first_time_dam_setup
-
Verify the P4 DAM container is running using the following url. Replace <dam.example.com> with your P4 DAM hostname if modified:
https://<dam.example.com>.com
Update configuration settings
You can configure P4 DAM by updating the .env file. For a full list of P4 DAM configurables, see P4 DAM Docker configuration reference. You can test some of your configuration settings, such as checking the status of your P4 Search instance, in the TeamHub admin UI.
Enable backup settings
-
Revise the gobackup/gobackup.yml file.
-
Set HTH_BACKUPS=1 in the .env file.
-
Recreate the scheduler and workers containers by running the following command:
docker compose up -d --force-recreate scheduler workers.
Configure user and group synchronization settings
HTH_HELIX_SYNC_ENABLED
HTH_HELIX_USERS_INCLUDE_REGEX
HTH_HELIX_USERS_FROM_GROUPS_INCLUDE_REGEX
HTH_HELIX_USERS_EXCLUDE_REGEX
HTH_HELIX_USERS_FROM_GROUPS_EXCLUDE_REGEX
HTH_HELIX_GROUPS_INCLUDE_REGEX
HTH_HELIX_GROUPS_EXCLUDE_REGEX
Configure mail settings
HTH_SMTP_ADDRESS
HTH_SMTP_PORT
HTH_SMTP_TLS
HTH_SMTP_AUTHENTICATION
HTH_SMTP_USERNAME
HTH_SMTP_PASSWORD
HTH_EMAIL
HTH_SUPPORT_EMAIL
HTH_REGISTRATIONS_EMAIL
HTH_NOTIFICATIONS_EMAIL
HTH_BACKUPS_EMAIL
Upgrade P4 DAM with Docker
P4 DAM can be upgraded using the Docker image.
To upgrade P4 DAM, start P4 DAM with Docker, and run the following Docker commands on your local host:
-
Fetch the P4 DAM Docker container:
docker compose pull
-
Run Docker.
docker compose up -d --force-recreate