Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

How to Deploy PHP Application From GitHub to Cloudways

April 10, 2018

4 Min Read
deploy php application
Reading Time: 4 minutes

If you are a developer of any level you must know about Git for source code management. Git is very popular when it comes to interacting with multiple team members and open source contributors for building coding solutions. I’ve written a short series on Git for beginners covering, commands cheat sheets, Branches, Conflicts etc.

The best thing about GIT is it allows to create custom workflows manually or by integrating 3rd party tools to automatically deploy PHP application and allow Continuous Integration in PHP.

Deploy PHP Application From GitHub
1. Signup & Launch Server
2. Generating SSH Keys
3. Upload SSH Key To GitHub Repository
4. Copy the SSH Address Of Repository
5. Deploy PHP Application Code from Your Repository
6. Repository Successfully Cloned
7. Automatic Deployment Tools Integration

The Cloudways PHP Hosting platform allows you to deploy PHP application from your git repositories. Your git repository must support git over SSH for this to work. PHP application deployment from git, you need to follow simple steps given below.

Deploy PHP Apps Without Worrying About Servers

Our Managed Cloud Hosting for PHP applications takes care of all hosting related hassles

Step 1: Signup & Launch Server

Firstly, Signup at Cloudways platform, Launch your first Server and application which you need. Next, Move to the Application by selecting any app from application page.

launch server

Step 2: Generating SSH Keys

In this Step you need to download SSH keys by moving to Deployment via Git tab,

We will use these keys to allow access from your Cloudways server to your git repository. Now click on the Generate SSH Keys button to generate the keys.

generate ssh key

Now, click on View SSH Keys to download the SSH Public Key that we will use in the next step.

view ssh key

Step 3: Upload SSH Key To GitHub Repository

On Github move to the repository which code you need to deployed. If you are using another git service, you will have to find the equivalent way of completing them. Go to Settings -> Deploy keys and Click on the Add Deploy Key button to add the SSH key we downloaded. You can give a name to this key too in the title field and copy the key to the box. Click on the Add Key button to save the SSH key.

deploy keys

Step 4: Copy the SSH Address Of Repository

Copy the repository address as shown in the image below. Make sure to copy the  SSH address as other formats (like HTTPS) are not supported.

ssh address

Step 5: Deploy PHP Application Code from Your Repository

  1. Back on Cloudways console, paste the SSH address you got in Step 4 into the Git Remote Address” field.
  2. Then choose the branch of your repository you want to deploy from. In this example, we use the master ” branch.
  3. Next, type the deployment path (i.e. the folder in your server where the code will be deployed). Make sure to end it with a /. If you leave this field empty, the code will be deployed to public_html/.
  4. Finally, click on the Start Deployment button to deploy your code to the selected path.

Read more: Enhanced Cloudways Staging Environment Is Now Available for All Users

Step 6: Repository Successfully Cloned

You will get a notification once the PHP application deployment process has been completed.

You have further options to delete the repository from the server (no files will be deleted, see FAQ below), pull the latest changes or change the branch you deploy from.

deployment via git

Automatic Deployment Tools Integration

Cloudways also supports Github automatic deployment tools. You can easily integrate them to deploy PHP application by just using the master credentials provided on your server page. The guides are also available for automatic PHP application deployment with Deploybot, Deployhq and Envoyer. You can easily follow the steps and setup the deployment with zero downtime on cloudways. Remember you need your server SSH key in most of the cases you can get from Deployment with git tab as shown in step 2.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Launch PHP websites without the worry of Server Management.

Pre-Installed Optimized Stack with Git, Composer & SSH

Shahroze Nawaz

Shahroze is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. Besides his work life, he loves movies and travelling. You can email him at

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

BFCM 2019