{"id":30815120,"url":"https://github.com/leipnar/n8n-deploy-script","last_synced_at":"2026-04-09T02:02:06.400Z","repository":{"id":308963339,"uuid":"1034730254","full_name":"leipnar/n8n-deploy-script","owner":"leipnar","description":"Automated production deployment script for n8n with PostgreSQL, Nginx, and SSL on Debian based distributions. ","archived":false,"fork":false,"pushed_at":"2025-08-08T22:49:52.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T08:20:06.705Z","etag":null,"topics":["automation","bash-script","debian","deployment","docker","n8n","nginx","ssl","ubuntu"],"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/leipnar.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-08-08T22:11:10.000Z","updated_at":"2025-08-08T22:49:55.000Z","dependencies_parsed_at":"2025-08-09T00:19:13.762Z","dependency_job_id":"aaf0f952-7175-45d2-a0c0-750b7d5357a9","html_url":"https://github.com/leipnar/n8n-deploy-script","commit_stats":null,"previous_names":["leipnar/n8n"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leipnar/n8n-deploy-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leipnar%2Fn8n-deploy-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leipnar%2Fn8n-deploy-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leipnar%2Fn8n-deploy-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leipnar%2Fn8n-deploy-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leipnar","download_url":"https://codeload.github.com/leipnar/n8n-deploy-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leipnar%2Fn8n-deploy-script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","bash-script","debian","deployment","docker","n8n","nginx","ssl","ubuntu"],"created_at":"2025-09-06T08:05:06.301Z","updated_at":"2026-04-09T02:02:06.365Z","avatar_url":"https://github.com/leipnar.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# n8n Production Deployment Script\n\nA fully automated bash script to deploy a production-ready n8n instance on Ubuntu 24.04 with PostgreSQL database, Nginx reverse proxy, and SSL encryption.\n\n## 🚀 Features\n\n- **Single Command Deployment**: Copy, paste, and run - no manual configuration required\n- **Production Ready**: PostgreSQL database, SSL/HTTPS, firewall configuration\n- **Security Focused**: UFW firewall, basic auth, secure password generation\n- **Docker Based**: Uses Docker Compose for easy management and updates\n- **Low Resource Optimized**: Designed for VPS instances with limited resources\n- **Auto SSL**: Let's Encrypt certificate with automatic renewal\n\n## 📋 Prerequisites\n\n- **VPS/Server**: Ubuntu 24.04 (fresh installation recommended)\n- **Domain**: A domain name pointing to your server's IP address\n- **Resources**: Minimum 1GB RAM, 1 CPU core (4GB+ recommended)\n- **Access**: Root or sudo access to the server\n\n## ⚡ Quick Start\n\n1. **Configure the script**: Edit the configuration variables at the top of `n8n-deploy.sh`:\n   ```bash\n   DOMAIN=\"your-domain.com\"  # Replace with your actual domain\n   N8N_USER=\"admin\"          # Replace with your desired admin username\n   ```\n\n2. **Make the script executable**:\n   ```bash\n   chmod +x n8n-deploy.sh\n   ```\n\n3. **Run the deployment**:\n   ```bash\n   sudo ./n8n-deploy.sh\n   ```\n\n4. **Access your n8n instance**: Once completed, visit `https://your-domain.com` and log in with the credentials displayed at the end of the installation.\n\n## 🔧 What the Script Does\n\n### System Setup\n- Updates Ubuntu packages to latest versions\n- Installs prerequisites: curl, wget, nginx, certbot, etc.\n\n### Security Configuration\n- Configures UFW firewall (allows only SSH, HTTP, HTTPS)\n- Generates secure random passwords for database and n8n admin\n\n### Docker Installation\n- Installs latest Docker Engine and Docker Compose plugin\n- Configures Docker to start on boot\n\n### Application Deployment\n- Creates Docker Compose configuration with PostgreSQL and n8n\n- Sets up persistent volumes for data storage\n- Configures n8n with basic authentication (email registration disabled)\n\n### Reverse Proxy \u0026 SSL\n- Configures Nginx as reverse proxy on the host system\n- Obtains Let's Encrypt SSL certificate automatically\n- Sets up HTTPS redirect and proper security headers\n\n## 📁 Directory Structure\n\nAfter deployment, the following structure is created:\n\n```\n/root/n8n-docker/\n├── docker-compose.yml    # Docker services configuration\n├── .env                  # Environment variables and secrets\n└── (Docker volumes for data persistence)\n```\n\n## 🛠️ Management Commands\n\nAfter deployment, you can manage your n8n instance with these commands:\n\n```bash\n# Navigate to project directory\ncd /root/n8n-docker\n\n# View logs\ndocker compose logs -f\n\n# Restart services\ndocker compose restart\n\n# Stop services\ndocker compose down\n\n# Start services\ndocker compose up -d\n\n# Update n8n to latest version\ndocker compose pull\ndocker compose up -d\n```\n\n## 🔐 Security Features\n\n- **Firewall**: UFW configured to allow only necessary ports\n- **Basic Authentication**: Username/password protection\n- **SSL/TLS**: HTTPS encryption with Let's Encrypt certificates\n- **User Management**: Email-based registration disabled\n- **Database**: PostgreSQL with secure password generation\n- **Network Isolation**: Docker containers on isolated network\n\n## 🔄 Updating n8n\n\nTo update n8n to the latest version:\n\n```bash\ncd /root/n8n-docker\ndocker compose pull n8n\ndocker compose up -d\n```\n\n## 🗄️ Data Backup\n\nYour n8n data is stored in Docker volumes. To backup:\n\n```bash\n# Backup n8n data\ndocker run --rm -v n8n-docker_n8n_data:/data -v $(pwd):/backup ubuntu tar czf /backup/n8n-backup.tar.gz -C /data .\n\n# Backup PostgreSQL data\ndocker run --rm -v n8n-docker_postgres_data:/data -v $(pwd):/backup ubuntu tar czf /backup/postgres-backup.tar.gz -C /data .\n```\n\n## 🆘 Troubleshooting\n\n### SSL Certificate Issues\nIf SSL certificate generation fails:\n```bash\n# Manually obtain certificate\nsudo certbot --nginx -d your-domain.com\n\n# Check certificate status\nsudo certbot certificates\n```\n\n### Container Issues\n```bash\n# Check container status\ncd /root/n8n-docker\ndocker compose ps\n\n# View detailed logs\ndocker compose logs n8n\ndocker compose logs postgres\n```\n\n### Firewall Issues\n```bash\n# Check firewall status\nsudo ufw status\n\n# Allow additional ports if needed\nsudo ufw allow [port]\n```\n\n## 🔧 Customization\n\n### Changing Configuration\nEdit the `.env` file in `/root/n8n-docker/` to modify:\n- Admin credentials\n- Database settings\n- n8n configuration options\n\nAfter changes, restart services:\n```bash\ndocker compose restart\n```\n\n### Resource Limits\nTo add resource limits, edit `docker-compose.yml`:\n```yaml\nservices:\n  n8n:\n    deploy:\n      resources:\n        limits:\n          memory: 512M\n        reservations:\n          memory: 256M\n```\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## ⚠️ Disclaimer\n\nThis script is provided as-is. Always review and test scripts before running them on production systems. Make sure to backup any existing data before deployment.\n\n## 🆘 Support\n\nIf you encounter issues:\n\n1. Check the troubleshooting section above\n2. Review the Docker and Nginx logs\n3. Open an issue in this repository with detailed error information\n\n## 📚 Additional Resources\n\n- [n8n Documentation](https://docs.n8n.io/)\n- [Docker Compose Documentation](https://docs.docker.com/compose/)\n- [Let's Encrypt Documentation](https://letsencrypt.org/docs/)\n- [Nginx Documentation](https://nginx.org/en/docs/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleipnar%2Fn8n-deploy-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleipnar%2Fn8n-deploy-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleipnar%2Fn8n-deploy-script/lists"}