Deploy P4 on-premises - Linux | Admin
Complete the following steps to set up P4 Server on Linux.
After installation, the following components are available on the computer:
- P4: Command-line client for P4 Server
- P4 Server (p4d)
- P4 Server Control (p4dctl), a tool for managing the Perforce service.
- An operating system user,
perforce
, used to run the Perforce service.
As a best practice, install P4 Server on one computer and P4 clients on another networked computer. Installing the server on a separate computer ensures that everyone in your organization can access the files as needed.
These steps are for the Ubuntu package manager for Ubuntu 24.04 (Noble Numbat), a popular version of Linux. If you need steps for a different package manager, see the Install the server in the P4 Server Administration Documentation. Find links to P4 packages for APT and YUM repositories on the Perforce Packages page.
If you need steps for Windows, see Download and install P4 Server on Windows.
On this page:
Configure the Perforce repository
-
Make sure you have sudo access on the computer where you are installing P4 Server.
-
Download the Perforce public key:
$ wget https://package.perforce.com/perforce.pubkey
-
Get the fingerprint of the public key:
$ gpg -n --import --import-options import-show perforce.pubkey
-
Verify the downloaded key matches the authentic Perforce fingerprint:
$ gpg -n --import --import-options import-show perforce.pubkey | grep -q "E58131C0AEA7B082C6DC4C937123CB760FF18869" && echo "true"
If the output istrue
, the key is valid. -
Add the public key to your keyring:
wget -qO - https://package.perforce.com/perforce.pubkey | gpg --dearmor | sudo tee /usr/share/keyrings/perforce.gpg
-
Create a file for the Perforce repository:
$ sudo nano /etc/apt/sources.list.d/perforce.list
-
Add the Perforce repository to your APT configuration by updating
/etc/apt/sources.list.d/perforce.list
with the following line:deb [signed-by=/usr/share/keyrings/perforce.gpg] https://package.perforce.com/apt/ubuntu <distro> relea
Replace
<distro>
with your Ubuntu distribution:precise
,trusty
,xenial
,bionic
,focal
,jammy
or,noble
. -
Save the file.
-
Run
apt-get update
.
Update the computer for the new Perforce repository
-
Refresh local packages:
$ sudo apt-get update
-
Install P4 Server using the built-in Ubuntu package manager:
$ sudo apt-get install helix-p4d
-
Enter
Y
to confirm and wait for installation to complete.
Configure the Perforce service
To complete the P4 Server installation, configure the Perforce service.
-
Run the configuration in interactive mode:
$ sudo /opt/perforce/sbin/configure-helix-p4d.sh
The configuration script displays a summary of default settings and any settings optionally set with a command-line argument.
-
Provide information prompted by the configuration script:
-
Service Name: Used when starting and stopping the service.
-
Server Root:
P4ROOT
where versioned files and metadata are stored. -
Unicode Mode Off by default. If you are planning to install P4 Code Review after setting up P4, enable Unicode mode. P4 Code Review requires Unicode mode to ensure that all characters are displayed and handled correctly.
If you turn Unicode mode on, you will not be able to turn it off. Be sure you are familiar with Unicode functionality when selecting this mode. See Unicode mode in P4 Server Administration Documentation for information. -
Case Sensitivity: On by default. In most cases, setting up a case-sensitive server with a case-check trigger to avoid case collisions is the best option. If your organization is developing only with and for Windows, you might want to set up a case-insensitive server instead.
-
Server Address:
P4PORT
, the IP or URL specifying the host that you are installing P4 Server on, the port the server listens on (by default 1666), and whether plaintext or SSL encryption is used. For example,ssl:192.168.0.1:1666
orssl:p4d-1.example.com:1666
. -
Superuser Login:
userid
for a new user withsuper
level privileges. To learn more about super users, see Access levels in P4 Server Administration Documentation. -
Superuser Password: Password for the new super user. This user has unlimited privileges, so a strong password is required.
-
When configuration is complete, a summary displays details about what changed and where settings are stored.
You can now connect to the P4 Server service, or you can manage the service using the p4dctl
utility.
To learn more about the p4dctl
utility, see P4 Server Control (p4dctl) in P4 Server Administration Documentation.
To learn more about the configure-helix-p4d.sh script, see Post-installation configuration in P4 Server Administration Documentation .
What's next
Next, download and install P4 Visual Client (P4V), which allows you to work with versioned files. Installing P4V also installs the P4 Admin by default. You will use these tools to configure security and add users in later steps. You will also install other tools that you might use when working with P4.
Go to Step 3: Download and install P4V and other client applications.