n8n-install.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. msg_ok "Installed Dependencies"
  18. msg_info "Setting up Node.js Repository"
  19. $STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
  20. msg_ok "Set up Node.js Repository"
  21. msg_info "Installing Node.js"
  22. $STD apt-get install -y nodejs
  23. msg_ok "Installed Node.js"
  24. msg_info "Installing n8n (Patience)"
  25. $STD npm install --global n8n
  26. msg_ok "Installed n8n"
  27. msg_info "Creating Service"
  28. cat <<EOF >/etc/systemd/system/n8n.service
  29. [Unit]
  30. Description=n8n
  31. [Service]
  32. Type=simple
  33. ExecStart=n8n start
  34. [Install]
  35. WantedBy=multi-user.target
  36. EOF
  37. $STD systemctl enable --now n8n
  38. msg_ok "Created Service"
  39. motd_ssh
  40. root
  41. msg_info "Cleaning up"
  42. $STD apt-get autoremove
  43. $STD apt-get autoclean
  44. msg_ok "Cleaned"