Configuring deploy hooks from github

I have configured a Digital Ocean droplet as per the following guides:

  • Initial Server Setup with Ubuntu 16.04
  • Install LAMP stack on Ubuntu 16.04
  • Secure apache with let’s encrypt

In summary: I have a LAMP server, I have a domain pointed at my LAMP server, it is https now, and I can ssh into it with an account I created (not root) and it has things like UFW enabled.


My webroot lay at: /var/www/

  • I can confirm that when I put an index.html file there, it works

What I’m trying to accomplish:

I want to use a webhook such that when a github repo receives changes to master branch, the hook pushes an update to my droplet. I want to be able to have multiple repos/sites, so think,, etc.

What I don’t want:

  • many tutorials talk about pushing from local to DO. I don’t want to do this. I want to go from github to DO.

I have tried a number of tutorials which I am linking to below

None of these works for my situation, number 3 because I don’t want to go straight from local to droplet. First two for different reasons.

Any help would be appreciated.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Why is the documentation for this so hard to find? I’m stuck as well and wondering if you ever found some good docs for this…

Did you manage to get set this up easily?

If so, would you mind sharing how you did it please,


Addendum: I should mention that I am not interested in solutions like deploybot and codeship, etc. I really just want to properly setup a github webhook direct into my droplet. I understand this means not just setting up the webhook but also the deploy key. I am comfortable enough to do this. I just need a guide. Thanks