n8n-install.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y ca-certificates
  18. $STD apt-get install -y gnupg
  19. msg_ok "Installed Dependencies"
  20. msg_info "Setting up Node.js Repository"
  21. mkdir -p /etc/apt/keyrings
  22. curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  23. echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
  24. msg_ok "Set up Node.js Repository"
  25. msg_info "Installing Node.js"
  26. $STD apt-get update
  27. $STD apt-get install -y nodejs
  28. msg_ok "Installed Node.js"
  29. msg_info "Installing n8n (Patience)"
  30. $STD npm install --global n8n
  31. msg_ok "Installed n8n"
  32. msg_info "Creating Service"
  33. cat <<EOF >/etc/systemd/system/n8n.service
  34. [Unit]
  35. Description=n8n
  36. [Service]
  37. Type=simple
  38. ExecStart=n8n start
  39. [Install]
  40. WantedBy=multi-user.target
  41. EOF
  42. $STD systemctl enable --now n8n
  43. msg_ok "Created Service"
  44. motd_ssh
  45. customize
  46. msg_info "Cleaning up"
  47. $STD apt-get autoremove
  48. $STD apt-get autoclean
  49. msg_ok "Cleaned"