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



Running a Perforce Server in the Cloud

« Go Back



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


The Perforce Server 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 Protocol From Port To Port Source
Custom TCP 1666 1666
SSH TCP 22 22
HTTP TCP 80 80

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. CloudWatch monitoring can be enabled for this instance now, or later once it is running. Leaving the Kernel and RAM Disk set to default is recommended, as shown below:

    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
    The instance's Perforce Server can be accessed by setting P4PORT to "Hostname:1666". Initially you should be able to login as the user "bruno" with no password.
  • 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