{"id":29785500,"url":"https://github.com/ilhamghaza/deploy-laravel","last_synced_at":"2026-04-18T17:03:03.734Z","repository":{"id":305697889,"uuid":"1023657277","full_name":"IlhamGhaza/deploy-laravel","owner":"IlhamGhaza","description":"One-Command Laravel Deployment Script","archived":false,"fork":false,"pushed_at":"2025-07-21T14:19:54.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-01T22:43:08.756Z","etag":null,"topics":["deploy-script-sh","deploy-scripts","deployment-automation","deployments","laravel-deployment","laravel-deployments","laravel-framework","nginx","postgresql","server-setup","vps"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IlhamGhaza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-21T13:46:19.000Z","updated_at":"2025-07-21T14:24:03.000Z","dependencies_parsed_at":"2025-07-21T15:41:37.590Z","dependency_job_id":"d380f2bb-d32c-4fce-9e82-d8dc245e605a","html_url":"https://github.com/IlhamGhaza/deploy-laravel","commit_stats":null,"previous_names":["ilhamghaza/deploy-laravel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IlhamGhaza/deploy-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlhamGhaza%2Fdeploy-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlhamGhaza%2Fdeploy-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlhamGhaza%2Fdeploy-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlhamGhaza%2Fdeploy-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlhamGhaza","download_url":"https://codeload.github.com/IlhamGhaza/deploy-laravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlhamGhaza%2Fdeploy-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31976805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T16:27:12.723Z","status":"ssl_error","status_checked_at":"2026-04-18T16:27:11.140Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy-script-sh","deploy-scripts","deployment-automation","deployments","laravel-deployment","laravel-deployments","laravel-framework","nginx","postgresql","server-setup","vps"],"created_at":"2025-07-27T17:12:07.084Z","updated_at":"2026-04-18T17:03:03.682Z","avatar_url":"https://github.com/IlhamGhaza.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# One-Command Laravel Deployment Script\n\n[](https://laravel.com)\n[](https://php.net)\n[](https://www.google.com/search?q=LICENSE)\n\nDeploy any Laravel application to a fresh Ubuntu/Debian VPS in minutes with a single command. This script automates the entire process, from server setup and software installation to application configuration and security hardening, letting you focus on your code.\n\n## 📚 Documentation\n\n  - [Quick Setup Guide (English)](https://www.google.com/search?q=QUICK-SETUP-EN.md)\n  - [Quick Setup Guide (Bahasa Indonesia)](https://www.google.com/search?q=QUICK-SETUP.md)\n\n-----\n\n## ✨ Why Use This Script?\n\nDeploying a Laravel application involves repetitive and error-prone tasks: installing the correct software, configuring Nginx, setting up a database, managing permissions, and securing the server. This script automates all of it, providing a production-ready environment out of the box.\n\n  - 🚀 **One-Command Deployment:** Run a single command and let the script handle everything else.\n  - 🔒 **Secure by Default:** Implements best practices for security, including SSL, secure permissions, and Nginx rate limiting.\n  - ⚡ **Optimized for Performance:** Automatically enables caching for routes, config, and views for a faster application.\n  - 🤖 **Smart \u0026 Flexible:** Auto-detects the default branch (`main`, `master`, `pupuk`) or lets you specify one.\n  - 🔧 **Zero Manual Configuration:** No need to edit Nginx configs or create database users manually. The script handles it all.\n\n-----\n\n## 🛠️ What The Script Automates\n\n### 1\\. Software Installation\n\n  - **PHP:** Installs the latest version and necessary extensions (`pgsql`, `zip`, `gd`, `curl`, etc.).\n  - **PostgreSQL:** Sets up the database server.\n  - **Nginx:** Installs and configures the web server.\n  - **Composer:** Installs the latest version for dependency management.\n  - **Certbot:** Installs Certbot and the Nginx plugin for easy SSL setup.\n\n### 2\\. Application \u0026 Environment Setup\n\n  - **Clone Repository:** Clones your Laravel project into `/var/www/\u003crepo_name\u003e`.\n  - **Database Creation:** Creates a PostgreSQL database (`laravel_pos`) and a user (`laravel_pos_app`) with a securely generated password.\n  - **.env Configuration:** Copies `.env.example` and automatically configures `APP_URL`, database credentials, and sets the environment to `production`.\n  - **Dependency Installation:** Runs `composer install --optimize-autoloader`.\n  - **Laravel Setup:**\n      - Generates an application key (`php artisan key:generate`).\n      - Runs database migrations and seeders (`php artisan migrate:fresh --seed`).\n      - Creates the storage link (`php artisan storage:link`).\n\n### 3\\. Security Hardening\n\n  - **SSL Certificate:** Obtains and installs a free SSL certificate from Let's Encrypt for your domain and `www` subdomain.\n  - **Secure Permissions:** Sets correct ownership (`www-data:www-data`) and permissions for project files, while keeping storage directories writable.\n  - **Nginx Security:**\n      - Adds security headers (`X-Frame-Options`, `X-Content-Type-Options`).\n      - Denies access to hidden files (like `.env`) and the `bootstrap/cache` directory.\n      - Implements API rate limiting (100 requests/second).\n\n### 4\\. Performance Optimization\n\n  - **Caching:** Automatically runs `php artisan optimize`, `config:cache`, `route:cache`, and `view:cache`.\n  - **Optimized Autoloader:** Installs Composer dependencies with `--optimize-autoloader` for faster class loading.\n  - **Production Mode:** Sets `APP_ENV=production` and `APP_DEBUG=false`.\n\n-----\n\n## 🚀 Quick Start\n\n**Prerequisites:**\n\n  - A fresh Ubuntu/Debian VPS.\n  - A domain name pointed to your VPS IP address.\n  - Root or `sudo` access.\n  - A valid Laravel repository URL.\n\n**1. Download the script:**\n\n```bash\nwget https://raw.githubusercontent.com/IlhamGhaza/deploy-laravel/master/deploy-laravel.sh\n```\n\n**2. Make it executable:**\n\n```bash\nchmod +x deploy-laravel.sh\n```\n\n**3. Run the deployment:**\n\n```bash\nsudo ./deploy-laravel.sh \u003crepo_url\u003e [branch] \u003cdomain\u003e \u003cemail\u003e\n```\n\n### Usage Examples\n\n**Deploying with a specific branch:**\n\n```bash\nsudo ./deploy-laravel.sh https://github.com/laravel/laravel.git main example.com admin@example.com\n```\n\n**Deploying without a branch (auto-detects `main`/`master`/`pupuk`):**\n\n```bash\nsudo ./deploy-laravel.sh https://github.com/laravel/laravel.git example.com admin@example.com\n```\n\n-----\n\n## 🔧 Post-Deployment \u0026 Maintenance\n\nYour application will be deployed to `/var/www/\u003crepo_name\u003e`.\n\n**Common Commands:**\n\n```bash\n# Check service status\nsudo systemctl status nginx php-fpm postgresql\n\n# View Nginx logs\nsudo tail -f /var/log/nginx/error.log\n\n# View Laravel logs\nsudo tail -f /var/www/\u003crepo_name\u003e/storage/logs/laravel.log\n```\n\nFor more commands and troubleshooting, see the [**Quick Setup Guide**](https://www.google.com/search?q=QUICK-SETUP-EN.md%23troubleshooting--useful-commands).\n\n## 🆘 Troubleshooting\n\nIf you encounter issues, please consult the detailed troubleshooting guides:\n\n  - [English Documentation](https://www.google.com/search?q=QUICK-SETUP-EN.md%23troubleshooting--useful-commands)\n  - [Indonesian Documentation](https://www.google.com/search?q=QUICK-SETUP.md%23troubleshooting--perintah-penting)\n\n## 🤝 Contributing\n\nContributions are welcome\\! If you have suggestions or improvements, please feel free to submit a Pull Request.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filhamghaza%2Fdeploy-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filhamghaza%2Fdeploy-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filhamghaza%2Fdeploy-laravel/lists"}