Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.

Lamp App with Git

  • Hello,

    I was wondering if git is available to the lamp app for deploying web projects? I use drupal and WP for various projects, and being able to deploy the code directly from a git hosting service and then run composer install to get any dependencies would be much more inline with the method I currently.



  • Staff

    @jdelon02 Currently, you can only upload via SFTP. We are working on git support for the next release. Please see my comment at

  • @girish I coulda sworn I was able to git clone blahblah in LAMP, is that not possible anymore...?

    Edit: Yeah, it works for me?


    What I did in my lamp was:

    cd /app/data/public
    rm -rf ./.
    cd ..
    git clone <URL> public

    Will put a git repo right in the apache web root folder.

  • Staff

    @murgero You are right. I think what some users are looking for is a "git push" based workflow (like in heroku). So, your code is hosted on gitlab/gogs and they just want to do "git push lamp" and expect it to deploy to the lamp server. I guess the main advantage is that they don't need to open Cloudron terminal + also can integrate with CI/CD.

  • @girish & @jdelon02

    I believe LAMP app supports cron, in that case use the following script to auto-pull from a git repo whenever an update is pushed to that repo:

    Put in /app/data/updateGit

    ## CD to the path where the app is installed.
    cd /app/data/public
    LOCAL=$(git rev-parse @)
    REMOTE=$(git rev-parse "$UPSTREAM")
    BASE=$(git merge-base @ "$UPSTREAM")
    if [ $LOCAL = $REMOTE ]; then
        echo "Up-to-date"
    elif [ $LOCAL = $BASE ]; then
        echo "Need to pull"
        git pull
    elif [ $REMOTE = $BASE ]; then
        echo "Need to push? Some files changed / commited here, this should not have happened."
        echo "Diverged?? Help!"

    Then in /app/data/crontab:

    */5 * * * * bash /app/data/updateGit 2>&1
    ## Or if you wanna avoid filling logs:
    */5 * * * * bash /app/data/updateGit  2>&1 > /dev/null

    This will check if a pull is needed from a repo every 5 minutes. (Re:

    You can also modify the bash script to rebuild, npm install, composer install, etc when needed too.

Log in to reply