n8n-auto-installer
# π n8n Automated Installation Script [](https://opensource.org/licenses/MIT) [](https://www.docker.com/) [](https://n8n.io/) [](https://www.linux.org/) > **One-click automated installation and configuration of n8n workflow automation platform on Linux servers** ## π Overview This bash script provides a fully automated installation of [n8n](https://n8n.io/) - a powerful workflow automation tool that helps you connect apps and automate tasks. The script handles everything from OS detection to Docker installation, firewall configuration, and n8n deployment. ## β¨ Features - π **Automatic OS Detection** - Supports Ubuntu, Debian, CentOS, RHEL, AlmaLinux, Rocky Linux, Oracle Linux, SUSE, and Amazon Linux - π³ **Docker Auto-Installation** - Installs Docker and Docker Compose if not present - π₯ **Firewall Configuration** - Automatically configures UFW and firewalld - π **Secure Setup** - Generates random admin password and enables basic authentication - π **Comprehensive Logging** - All actions logged to `/n8ninstall.log` - π **Network Optimization** - Configures proper port mapping and webhook URLs - π οΈ **Troubleshooting** - Built-in error handling and alternative installation methods ## π₯οΈ Recommended Server Provider For optimal performance and global accessibility, we recommend **[MyHBD.net](https://myhbd.net)** as your server provider: ### Why MyHBD.net? - π **Multiple Global Locations** - Choose from data centers worldwide - β‘ **High Performance SSD Storage** - Fast disk I/O for better n8n performance - π **Enterprise-Grade Security** - Advanced DDoS protection and security features - π° **Competitive Pricing** - Cost-effective solutions for all budgets - ποΈ **One-Click Deployments** - Easy server provisioning with just one click - π **24/7 Expert Support** - Round-the-clock technical assistance **[π Get Your Server at MyHBD.net](https://myhbd.net)** ## π Prerequisites - Linux server (Ubuntu, Debian, CentOS, RHEL, AlmaLinux, Rocky Linux, Oracle Linux, SUSE, or Amazon Linux) - Root access or sudo privileges - Internet connection - Minimum 1GB RAM (2GB+ recommended) - At least 10GB free disk space ## π Quick Installation ### Method 1: Direct Download & Execute ```bash # Download and execute the script curl -fsSL https://raw.githubusercontent.com/itsredbull/n8n-auto-installer/main/install-n8n.sh | sudo bash ``` ### Method 2: Manual Download ```bash # Download the script wget https://raw.githubusercontent.com/itsredbull/n8n-auto-installer/main/install-n8n.sh # Make it executable chmod +x install-n8n.sh # Run the script sudo ./install-n8n.sh ``` ### Method 3: Git Clone ```bash # Clone the repository git clone https://github.com/itsredbull/n8n-auto-installer.git cd n8n-auto-installer # Make script executable chmod +x install-n8n.sh # Run the installation sudo ./install-n8n.sh ``` ## π What Happens During Installation 1. **System Analysis** - Detects your Linux distribution and version 2. **Docker Installation** - Installs Docker and Docker Compose if needed 3. **Service Configuration** - Starts and enables Docker service 4. **Security Setup** - Configures firewall rules for port 5678 5. **n8n Deployment** - Creates Docker Compose configuration and starts n8n 6. **Credential Generation** - Creates secure admin credentials 7. **Health Checks** - Verifies installation and connectivity 8. **Logging** - Saves all details to `/n8ninstall.log` ## π Accessing Your n8n Instance After successful installation, you can access n8n using: ### π Web Interface ``` http://YOUR-SERVER-IP:5678 ``` **Replace `YOUR-SERVER-IP` with your actual server's IP address** ### π€ Initial Setup 1. Open your browser and navigate to `http://YOUR-SERVER-IP:5678` 2. You'll be prompted to create your first account 3. Fill in your details: - **Email**: Your email address - **First Name**: Your first name - **Last Name**: Your last name - **Password**: Choose a strong password > π‘ **Note**: The script creates basic authentication, but you'll need to set up your personal account on first access. ## π Installation Logs & Credentials All installation details are saved to `/n8ninstall.log`, including: - Generated admin credentials - Installation steps and timestamps - Any errors or warnings encountered - Server configuration details To view the log: ```bash sudo cat /n8ninstall.log ``` ## π οΈ Supported Operating Systems | OS | Version | Status | |---|---|---| | Ubuntu | 18.04+ | β Fully Supported | | Debian | 9+ | β Fully Supported | | CentOS | 7+ | β Fully Supported | | RHEL | 7+ | β Fully Supported | | AlmaLinux | 8+ | β Fully Supported | | Rocky Linux | 8+ | β Fully Supported | | Oracle Linux | 7+ | β Fully Supported | | SUSE | 15+ | β Fully Supported | | Amazon Linux | 2+ | β Fully Supported | ## π§ Post-Installation Management ### Check n8n Status ```bash docker ps | grep n8n ``` ### View n8n Logs ```bash cd /n8n-data && docker compose logs -f ``` ### Restart n8n ```bash cd /n8n-data && docker compose restart ``` ### Stop n8n ```bash cd /n8n-data && docker compose down ``` ### Start n8n ```bash cd /n8n-data && docker compose up -d ``` ## π₯ Firewall Configuration The script automatically configures your firewall to allow connections on port 5678: - **UFW** (Ubuntu/Debian): `ufw allow 5678/tcp` - **firewalld** (CentOS/RHEL): `firewall-cmd --permanent --add-port=5678/tcp` ## π File Locations - **Docker Compose Config**: `/n8n-data/docker-compose.yml` - **n8n Data Directory**: `/n8n-data/n8n_data/` - **Installation Log**: `/n8ninstall.log` ## π Troubleshooting ### Common Issues **1. Port 5678 not accessible** ```bash # Check if n8n container is running docker ps | grep n8n # Check firewall status sudo ufw status # Ubuntu/Debian sudo firewall-cmd --list-ports # CentOS/RHEL ``` **2. Docker not starting** ```bash # Check Docker service sudo systemctl status docker sudo systemctl start docker ``` **3. Permission issues** ```bash # Fix n8n data directory permissions sudo chmod -R 777 /n8n-data/n8n_data/ ``` ### Getting Help - Check the installation log: `sudo cat /n8ninstall.log` - View n8n container logs: `cd /n8n-data && docker compose logs` - Restart the installation script if needed ## π€ Contributing We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change. ## π License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## β Support If this script helped you, please consider: - β Starring this repository - π Reporting issues - π§ Contributing improvements - π¬ Sharing with others ## π Useful Links - [n8n Official Documentation](https://docs.n8n.io/) - [n8n Community Forum](https://community.n8n.io/) - [Docker Documentation](https://docs.docker.com/) - [MyHBD.net - Recommended Hosting](https://myhbd.net) --- **Made with β€οΈ for the n8n community** > π **Ready to automate your workflows?** [Get started with MyHBD.net hosting](https://myhbd.net) and deploy n8n in minutes!