Deploy P4 on DigitalOcean | Admin
If you are the P4 administrator, you need to deploy P4 Server and configure it for your team. You can deploy P4 Server using a DigitalOcean droplet.
To learn more about DigitalOcean, see the What Is DigitalOcean? blog post.
On this page:
Prerequisites
Before you deploy P4 on DigitalOcean, you must have an DigitalOcean account with billing information completed.
P4 is free for up to five users and less than 20 workspaces. If you have a larger team, contact Perforce Sales to get additional licenses.
Step 1: Create a P4 droplet and deploy
-
Sign up for P4 on DigitalOcean. You will receive an email from Perforce with a link create a DigitalOcean droplet.
-
In the email, click the link to create a droplet.
-
On the Perforce P4 page in the DigitalOcean Marketplace, click Create Perforce P4 Droplet.
-
On the P4 deployment page, enter or select information for your deployment.
Field Description Choose a plan Select a plan. The storage amount is only for metadata and logs. You will add a separate drive for your depot. You can change the plan to scale up or down anytime. Choose a datacenter region Select the region closest to your team, or one that meets your compliance and security needs. Authentication Select an existing SSH key or upload a new SSH key. Do not use a password for the root user. Choose a hostname Enter a name for the droplet.
Suggested:p4-environment>
Example:p4-productionAdd backups Do not select this option. Instead, follow the instructions displayed when you log in to your instance to create a separate depot volume and then set up automatic snapshots.
The script for creating a separate depot value with automatic snapshots only exists in new versions of the DigitalOcean image. If you have an older deployment, you need to manually set up backups. -
Click Create Droplet.
Deployment is complete when the blue progress bar disappears. Click the droplet name to go to the droplet details page.
Step 2: Update firewall rules
Initial deployment of P4 on DigitalOcean does not include any firewall rules. Anyone with valid P4 credentials can connect to the P4 Server.
As a best practice, implement a layered security approach to limit access.
Username and password for each user
Provide each user with their own P4 username and password.
Create a firewall and rules
Create a DigitalOcean firewall and rules, which are available at no charge. For information about adding a firewall and rules to your droplet, see the DigitalOcean help.
Inbound rule for SSH connections
Create an inbound firewall rule to restrict IP addresses for SSH connections to the P4 Server. Typically, only admin users need to access the server using SSH. Use the following values for this rule:
| Field | Value |
|---|---|
| Type | Custom |
| Protocol | SSH |
| Port Range | 22 |
| Source | Admin's IP address. Find your IP address and use the IPv4 value. |
Inbound rule for TCP/IP connections
Create a firewall with an inbound rule for TCP port 1666 that is open to all traffic. If you need extra security, you can add specific IP addresses. Allowing access from specific IP addresses restricts access to your P4 Server to only users from those IP addresses, which increases security, but is difficult to maintain. You will have to update the rules any time a user needs to connect from a different public IP address, so this may not be the best option to support users who do not have a static IP address, such as users working remotely.
Use the following values for this rule:
| Field | Value |
|---|---|
| Type | Custom |
| Protocol | TCP |
| Port Range | 1666 |
| Source | All IPv4 or create individual rules for each specific IP address to allow. |
Step 3: Find and note your deployment outputs
When deployment is complete, find the password for the perforce user created during deployment.
-
Connect to the console for the DigitalOcean droplet.
-
Run the following command to get the password output:
cat /root/perforce.password -
Note the password output. You will need the password to connect to P4 Server from clients.
P4 credentials
Use the following details to connect to P4 Server from P4 clients, such as P4V. You need the deployment outputs you previously noted.
The first time you connect to the server, you may be prompted to trust the authenticity of the server using the fingerprint.
| Value | Format | Example |
|---|---|---|
| Server | ssl:IPv4Address:1666
Replace IP4Address with the the droplet's IPv4 public IP address |
ssl:52.186.76.48:1666
|
| User | perforce
|
perforce
|
| Password | Password you noted when accessing the /root/perforce.password file |
c6ec239f-876f-424d-b575-994986b37330
|
Access the P4 Server instance directory to perform administrative tasks
To connect to your P4 instance to perform administrative tasks, such as checking backups, expanding disk file systems, adding new volumes, checking logs, and more, use the DigitalOcean Web Console or SSH.
DigitalOcean Web console
-
Navigate to and click the PerforceP4 droplet.
-
Click Access in the left navigation bar.
-
In the Log in as box, enter root.
-
Click Launch Droplet Console.
-
To verify that the P4 Server is running, run the following command:
p4 info
-
Close the window when you finish.
SSH
Credentials
- Username: root
- Server:
DigitalOcean droplet IPv4 address
Example
The following command connects to the P4 Server as the root user:
ssh root@DigitalOcean droplet IPv4 address
Example: ssh root@35.271.43.98
To perform any P4 administration tasks, switch to the perforce user, and log in using the following commands:
sudo su - perforce
p4login -v 1
You now have the P4 CLI binaries in your $PATH and can run any p4 commands, such as p4 info.
Manage droplet settings
You can make changes to the droplet in DigitalOcean.
-
Click the droplet name.
The droplet details page opens.
-
Note the values in the following fields.
Field Description IPv4 Public IP address of your P4 Server (P4D) and will be used when connecting to P4 clients, such as P4V. On/Off Switch to turn your droplet on and off. Access If you are not familiar with using SSH, but need command-line access to the operating system, this is a good solution. Resize Scale up or down the size of your CPU, memory, etc. Backups Follow the instructions displayed when you log in to your instance to create a separate depot volume and then set up automatic snapshots.
The script for creating a separate depot value with automatic snapshots only exists in new versions of the DigitalOcean image. If you have an older deployment, you need to manually set up backups.
Future considerations
To scale your virtual machine (VM) to be globally replicated, secure, compliant, and scalable, see other P4 deployment options.
This DigitalOcean listing only includes a virtual machine image, in comparison to our offerings on Microsoft Azure and Amazon Web Services (AWS). These offerings include infrastructure as code and various VM images across our product suite.
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.