🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP

Deploying Laravel projects to shared hosting manually — via tools like FileZilla — can be time-consuming, error-prone, and inefficient. I recently faced this challenge while managing multiple Laravel projects (including a school management system) and …


This content originally appeared on DEV Community and was authored by Jonathan Lam Seck

Deploying Laravel projects to shared hosting manually — via tools like FileZilla — can be time-consuming, error-prone, and inefficient. I recently faced this challenge while managing multiple Laravel projects (including a school management system) and decided to finally automate the process.

In this post, I’ll share how I automated my deployment pipeline using GitHub Actions + FTP, even on a shared hosting environment (like cPanel or DirectAdmin) — no SSH access needed!

đź§± The Problem
Manually deploying files via FileZilla was:

Slow (uploading file-by-file)
Risky (easy to miss files or overwrite the wrong thing)
Time-consuming (especially during multiple updates per day)

âś… The Goal
I wanted a solution where:

Code is automatically deployed when I push to main
I can avoid uploading node_modules/, vendor/, or .env
No SSH is required
It's easy to set up and secure

đź”§ The Stack
Laravel (PHP framework)
GitHub for source control
GitHub Actions for automation
FTP access (via DirectAdmin or cPanel)

🚀 The Solution: GitHub Actions + ftp-deploy Action

Step 1: Set FTP Credentials as GitHub Secrets
In your GitHub repo:

Go to Settings > Secrets > Actions

Add:

FTP_HOST = ftp.yourdomain.com
FTP_USERNAME = your FTP username
FTP_PASSWORD = your FTP password
FTP_TARGET_DIR = /public_html/your-laravel-folder/ (dont't forget the / at the end of your path)

Step 2: Create Your GitHub Action Workflow

In .github/workflows/ftp-deploy.yml:

name: 🚀 FTP Deploy Laravel App

on:
  push:
    branches:
      - main

jobs:
  ftp-deploy:
    name: Deploy via FTP
    runs-on: ubuntu-latest

    steps:
      - name: 📥 Checkout code
        uses: actions/checkout@v3

      - name: đź”’ FTP Deploy
        uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: ${{ secrets.FTP_HOST }}
          username: ${{ secrets.FTP_USERNAME }}
          password: ${{ secrets.FTP_PASSWORD }}
          local-dir: ./
          server-dir: ${{ secrets.FTP_TARGET_DIR }}
          exclude: |
            **/.git*
            **/.env
            **/node_modules/**
            **/vendor/**
            **/tests/**
            storage/
          dry-run: false

đź’¬ Conclusion

This solution saved me hours of manual work. Now, I simply push to main, and the code is live. If you're stuck using shared hosting without SSH, GitHub Actions + FTP is a reliable and modern way to automate your Laravel deployments.

Let me know if you try it or need help setting it up!


This content originally appeared on DEV Community and was authored by Jonathan Lam Seck


Print Share Comment Cite Upload Translate Updates
APA

Jonathan Lam Seck | Sciencx (2025-07-24T16:09:31+00:00) 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP. Retrieved from https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/

MLA
" » 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP." Jonathan Lam Seck | Sciencx - Thursday July 24, 2025, https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/
HARVARD
Jonathan Lam Seck | Sciencx Thursday July 24, 2025 » 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP., viewed ,<https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/>
VANCOUVER
Jonathan Lam Seck | Sciencx - » 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/
CHICAGO
" » 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP." Jonathan Lam Seck | Sciencx - Accessed . https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/
IEEE
" » 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP." Jonathan Lam Seck | Sciencx [Online]. Available: https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/. [Accessed: ]
rf:citation
» 🚀 How I Automated Laravel Deployments to Shared Hosting Using GitHub Actions + FTP | Jonathan Lam Seck | Sciencx | https://www.scien.cx/2025/07/24/%f0%9f%9a%80-how-i-automated-laravel-deployments-to-shared-hosting-using-github-actions-ftp/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.