Perforce Public Knowledge Base - Running a Perforce Proxy in the Cloud
Reset Search



Running a Perforce Proxy in the Cloud

« Go Back



How do I start an instance of one of the Perforce Proxy Amazon Machine Images (AMIs) on Amazon's EC2 Cloud?


Starting with the 2010.2 release, Perforce provides pre-built Amazon Machine Images (AMIs) containing the Perforce Proxy Server; these AMIs are publicly accessible and may be used by anyone who wishes to proxy a Perforce Server. The Perforce Proxy AMIs are designed to be run inside Amazon's EC2 service, and in order to use them you will need an EC2 account. You can find more information about Amazon's EC2 service here:

This guide assumes that you are already familiar with the Amazon Web Services (AWS) Management Console, and understand the EC2 concepts. An introduction to Amazon's EC2 service can be found here:

Preparing the firewall

In order to access the services provided by our AMIs, you will need to define some firewall rules to allow access to the ports those services are running on. In the EC2 environment, this is done with Security Groups. Follow these steps to set up an appropriate Security Group:

  1. From the EC2 Console, click on the "Security Groups" link in the left pane.
  2. Click on the "Create Security Group" button at the top and give the Security Group a name and a description. Click "Create".
  3. Select the newly created Security Group and fill in the "Allowed Connections" table to match the one below.

Connection Method
From Port
To Port

Note: If you want to restrict connections to the server to those that originate from within your network, you can enter your public IP address in the 'Source' column. Your system administrator should be able to provide that address if you don't know it.


When you're done, the Security Group should look similar to the one below.

Launching the instance

32-bit and 64-bit instances are available in each of Amazon's EC2 regions, so the AMI you should launch will depend on where you are and which platform you want to use. A full list of our AMIs can be found here:

Follow these steps to launch the AMI you have chosen:

  1. From the EC2 Console, click on the "Instances" link in the left pane.
  2. Click on the "Launch Instance" button at the top.
  3. On the first screen of the "Request Instances Wizard", which should now be visible, select the "Community AMIs" tab and enter the AMI name into the search box.
  4. When the search returns the AMI, click on the "Select" button next to it to continue to the next screen.
  5. Choose the size of the machine you want to run the AMI on. The example below uses the default instance type 'Small', which is the default for 32-bit instances.

Click "Continue" when you're done.
  1. To configure which Perforce Server the Perforce Proxy will point to, you can set the P4TARGET in the user data, as shown below:

    In this example we're pointing the Perforce Proxy at the Perforce Public depot, running at "".  You should replace "" with the hostname or IP address of your Perforce Server. If your Perforce Server is also running on EC2, you can use the server's public- or private DNS name available from the EC2 Console's "Instances" panel. Change the port number too if your Perforce Server is not using port 1666.
    Click "Continue" when you're done.
  1. Set the "Name" tag to something meaningful; this will help you identify the instance in the Instances View

    Click "Continue" when you're done.
  1. If you have already created an SSH Key Pair, select it from the "Choose from your existing Key Pairs" section, as seen in the screen-shot below.
    If you have not created a Key Pair yet, do so by following the instructions in the "Create new Key Pair" section.

    Click "Continue" when you're done.
  1. To apply the "Security Group" that you created earlier, select it as shown below and, click "Continue".

  1. Click "Launch" to start the instance.

Accessing the instance

Once the instance is running and has a Public DNS address, you can make use of it. Go to the Instances View in the EC2 Console and check the state of the instance. As soon as the instance's status has changed to running select the instance and scroll to the bottom of the lower tab. The "Public DNS" field should now contain an address to the running instance. For example:

We will refer to this address as Hostname.

The instance will initially have three active services:

  • HTTP
    This provides online documentation about the instance and can be accessed from your browser by going to: "http//Hostname/".
  • Perforce via the Proxy
    The instance's Perforce Proxy can be accessed by setting P4PORT to "Hostname:1666". The Perforce Server that the Perforce Proxy is pointing at should appear no different, except for some additional information returned by the command "p4 info".
  • SSH
    To get direct access to the instance, use SSH to connect to "Hostname" as the user "perforce". You will need to use the SSH Key that you specified when you started the instance. For example:
    ssh -i /path/to/MyPrivateKey perforce@Hostname
    The "perforce" user can gain super-user access to the machine with the "sudo" command.
Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255