0784.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install n8n - Open Source Workflow Automation - on Linux</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,FOSS,Free Open Source Software,Free Open-Source Software,Free Software,Linux,Open Source,Open Source Software,Open-Source,Debian,N8n,Integomat Alternative,Make Alternative,Nodemation,Graphical Software Integration,Workflow Automation,Application Integration Platform,Application Automation Platform,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install n8n - Open Source Workflow Automation - on Linux">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="12/11/2022 01:23:35 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install n8n - Open Source Workflow Automation - on Linux</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is n8n?</h2>
  26. <blockquote><em>n8n is an extendable workflow automation tool. With a fair-code distribution model, n8n will always have visible source code, be available to self-host, and allow you to add your own custom functions, logic and apps. n8n&#39;s node-based approach makes it highly versatile, enabling you to connect anything to everything. -<a href="https://github.com/n8n-io/n8n" target="_blank">https://github.com/n8n-io/n8n</a></em></blockquote>
  27. <h2>Installing n8n</h2>
  28. <ol>
  29. <li>Log into the Linux device</li>
  30. <li>Run the following commands in a terminal window
  31. <div class="codeBlock"># update software repositories<br />
  32. sudo apt update<br />
  33. # install available software updates<br />
  34. sudo apt upgrade -y<br />
  35. # add nodejs software repository<br />
  36. curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -<br />
  37. # install nodejs<br />
  38. sudo apt install nodejs -y<br />
  39. # install mariadb<br />
  40. sudo apt install mariadb-server mariadb-client -y<br />
  41. # configure the MySQL database<br />
  42. sudo su<br />
  43. mysql_secure_installation</div>
  44. </li>
  45. <li>Press Enter to login as root</li>
  46. <li>Type N and press Enter to not switch to unix socket authentication</li>
  47. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  48. <li>Type Y and press Enter to remove anonymous users</li>
  49. <li>Type Y and press Enter to disallow root login remotely</li>
  50. <li>Type Y and press Enter to remove the test database</li>
  51. <li>Type Y and press Enter to reload privilege tables</li>
  52. <li>Run the following command to login into MySQL:
  53. <div class="codeBlock">mysql -u root -p</div>
  54. </li>
  55. <li>Authenticate with the root password set earlier</li>
  56. <li>Run the following commands to create the n8n database and database user
  57. <div class="codeBlock">CREATE DATABASE n8n;<br />
  58. GRANT ALL ON n8n.* to &#39;n8n_rw&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;n8n_N8N!&#39;;<br />
  59. FLUSH PRIVILEGES;<br />
  60. EXIT;<br />
  61. exit</div>
  62. </li>
  63. <li>Continue with the following commands:
  64. <div class="codeBlock"># set environmental variables<br />
  65. export DB_TYPE=&quot;mysqldb&quot;<br />
  66. export DB_MYSQLDB_DATABASE=&quot;n8n&quot;<br />
  67. export DB_MYSQLDB_HOST=&quot;localhost&quot;<br />
  68. export DB_MYSQLDB_USER=&quot;n8n_rw&quot;<br />
  69. export DB_MYSQLDB_PASSWORD=&quot;n8n_N8N!&quot;<br />
  70. export GENERIC_TIMEZONE=&quot;America/New_York&quot;<br />
  71. # install n8n<br />
  72. sudo npm install n8n --location=global<br />
  73. # audit and fix vulnerabilities<br />
  74. sudo npm audit fix<br />
  75. # run n8n<br />
  76. n8n</div>
  77. </li>
  78. <li>Open a web browser and navigate to http://DNSorIP:5678</li>
  79. <li>Complete the form with an email, first name, last name and password &gt; Click next</li>
  80. <li>Complete the questionnaire &gt; Click continue</li>
  81. <li>Click Get started</li>
  82. <li>Welcome to n8n</li>
  83. </ol>
  84. <h2>Running n8n as a Service</h2>
  85. <ol>
  86. <li>Press CTRL+C to end the running n8n process</li>
  87. <li>Continue with the following commands
  88. <div class="codeBlock"># create n8n service file<br />
  89. sudo nano /etc/systemd/system/n8n.service</div>
  90. </li>
  91. <li>Paste the following configuration into n8n.service
  92. <p>[Unit]<br />
  93. Description=n8n<br />
  94. After=mariadb.service</p>
  95. <p>[Service]<br />
  96. User=root<br />
  97. Group=root<br />
  98. Environment=DB_TYPE=mysqldb<br />
  99. Environment=DB_MYSQLDB_DATABASE=n8n<br />
  100. Environment=DB_MYSQLDB_HOST=localhost<br />
  101. Environment=DB_MYSQLDB_USER=n8n_rw<br />
  102. Environment=DB_MYSQLDB_PASSWORD=n8n_N8N!<br />
  103. Environment=GENERIC_TIMEZONE=America/New_York<br />
  104. ExecStart=n8n<br />
  105. WorkingDirectory=/usr/bin</p>
  106. <p>[Install]<br />
  107. WantedBy=multi-user.target</p>
  108. </li>
  109. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  110. <li>Continue with the following commands
  111. <div class="codeBlock"># reload systemd services<br />
  112. sudo systemctl daemon-reload<br />
  113. # start n8n service on boot and now<br />
  114. sudo systemctl enable n8n --now</div>
  115. </li>
  116. <li>Back in the web browser, refresh n8n to verify it is now running a service</li>
  117. <li>Log in using the email address and password setup earlier</li>
  118. </ol>
  119. <p>Source: <a href="https://docs.n8n.io/hosting/installation/npm/" target="_blank">https://docs.n8n.io/hosting/installation/npm/</a></p> </div>
  120. </div>
  121. </body>
  122. </html>