{"id":33150,"date":"2025-04-16T12:09:00","date_gmt":"2025-04-16T04:09:00","guid":{"rendered":"https:\/\/www.1ai.net\/?p=33150"},"modified":"2025-04-16T12:36:51","modified_gmt":"2025-04-16T04:36:51","slug":"n8n%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b%ef%bc%8c-%e4%b8%80%e9%94%ae%e6%89%93%e9%80%a0ai%e8%87%aa%e5%8a%a8%e5%8c%96%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/33150.html","title":{"rendered":"n8n installation tutorial for a free and open source AI automation tool in one click"},"content":{"rendered":"<p>How to quickly get started with a powerful<a href=\"https:\/\/www.1ai.net\/en\/tag\/ai%e8%87%aa%e5%8a%a8%e5%8c%96%e5%b7%a5%e5%85%b7\" title=\"_OTHER ORGANISER\" target=\"_blank\" >AI automation tools<\/a>, is a must-have for everyone in the future. Whether it's an individual in the workplace, or a business owner AI automation<a href=\"https:\/\/www.1ai.net\/en\/tag\/%e5%b7%a5%e4%bd%9c%e6%b5%81\" title=\"_Other Organiser\" target=\"_blank\" >Workflow<\/a>Must become a common need for all. Today, Crazy continues to introduce<a href=\"https:\/\/www.1ai.net\/en\/tag\/n8n\" title=\"[see articles containing [n8n] labels]\" target=\"_blank\" >n8n<\/a>, and explains its installation and basic setup steps in detail. Whether you are a technical novice or a user with some basic knowledge, this guide will help you take the first step easily and make n8n your right hand to work efficiently!<\/p>\n<p><strong>Why n8n?<\/strong><\/p>\n<p>Among many automation tools, n8n stands out with its open source, self-hostable and highly customizable features. Compared to commercialized tools such as Zapier, n8n is not only free, but also allows users to build their own automated workflows based on their needs. This makes n8n not only suitable for individual users, but also ideal for enterprise users.<\/p>\n<p><strong>Prerequisites for installing n8n<\/strong><\/p>\n<p>Before we start installing n8n, we need to make sure that the following conditions have been met:<\/p>\n<p>Step 1, Node.js: n8n is based on Node.js development, so you need to install Node.js first. recommended to use LTS (long-term support) version.<\/p>\n<p>(Official website: https:\/\/nodejs.org\/en)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33151\" title=\"e3b1692dj00susly20016d000u000c6m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/e3b1692dj00susly20016d000u000c6m.jpg\" alt=\"e3b1692dj00susly20016d000u000c6m\" width=\"1080\" height=\"438\" \/><\/p>\n<p>Step 2: npm (Node Package Manager): usually installed with Node.js.<\/p>\n<p>Step 3: Database (optional): n8n uses SQLite by default, but for production environments, it is recommended to use a stable database like PostgreSQL.<\/p>\n<p>(Official website: https:\/\/www.postgresql.org)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33152\" title=\"c22a9284j00susly20026d000u000ekm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/c22a9284j00susly20026d000u000ekm.jpg\" alt=\"c22a9284j00susly20026d000u000ekm\" width=\"1080\" height=\"524\" \/><\/p>\n<p><strong>I. Install n8n via npm<\/strong><\/p>\n<p>This is the simplest and most commonly used installation, and is particularly suitable for developers and technology enthusiasts.<\/p>\n<p>Step 1: Install Node.js and npm<\/p>\n<p>If you haven't installed Node.js and npm, you can visit the Node.js official website to download the latest LTS version (usually use mac for local use or linux system server) and follow the prompts to complete the installation. After the installation is complete, you can confirm the installation is successful with the following command:<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"\"><code><span class=\"code-snippet__plaintext\">node -v<\/span><\/code><code><span class=\"code-snippet__plaintext\">npm -v<\/span><\/code><\/pre>\n<p>Step 2: Install n8n globally<\/p>\n<p>Open a terminal or command prompt and enter the following command to install n8n globally:<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"\"><code><span class=\"code-snippet__plaintext\">npm install n8n -g<\/span><\/code><\/pre>\n<p>After the installation is complete, you can start n8n with the following command:<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"\"><code><span class=\"code-snippet__plaintext\">n8n<\/span><\/code><\/pre>\n<p>By default, n8n will start up at http:\/\/localhost:5678, and you can visit that address in your browser to see the n8n working interface.<\/p>\n<p><strong>Second, use Docker to install n8n<\/strong><\/p>\n<p>Docker is also ideal for installing n8n for those who are accustomed to deploying their environments using Docker.<\/p>\n<p>Step 1: Install Docker<\/p>\n<p>If your system doesn't have Docker installed, go to the Docker website to download and install the appropriate version of Docker for your operating system.<\/p>\n<p>(Official website: https:\/\/www.docker.com)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33153\" title=\"bdba7815j00susly20014d000u000bsm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/bdba7815j00susly20014d000u000bsm.jpg\" alt=\"bdba7815j00susly20014d000u000bsm\" width=\"1080\" height=\"424\" \/><\/p>\n<p>On the download page, select the version that suits your system, run or drag-and-drop (MacOS) the downloaded file, and follow the prompts to install Docker on your computer.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33154\" title=\"4d2963c5j00susly2004cd000u000gcm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/4d2963c5j00susly2004cd000u000gcm.jpg\" alt=\"4d2963c5j00susly2004cd000u000gcm\" width=\"1080\" height=\"588\" \/><\/p>\n<p>Crazy is on a mac so download the mac version, download it and install it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33155\" title=\"ba3b2297j00susly2000nd000u000e7m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/ba3b2297j00susly2000nd000u000e7m.jpg\" alt=\"ba3b2297j00susly2000nd000u000e7m\" width=\"1080\" height=\"511\" \/><\/p>\n<p>After the installation is complete start Docker, in Docker Desktop click on the search box and type n8n. Select the official image n8nio\/n8n and click Pull on the right to download the image.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33156\" title=\"22e5692aj00susly2001md000u000h1m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/22e5692aj00susly2001md000u000h1m.jpg\" alt=\"22e5692aj00susly2001md000u000h1m\" width=\"1080\" height=\"613\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33157\" title=\"f4eb53e5j00susly20046d000u000gzm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/f4eb53e5j00susly20046d000u000gzm.jpg\" alt=\"f4eb53e5j00susly20046d000u000gzm\" width=\"1080\" height=\"611\" \/><\/p>\n<p>After the download is complete, go back to Docker, select Images, you can see the n8nio\/n8n image you just downloaded in the list, click the Run triangle icon.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33158\" title=\"66568f35j00susly20019d000u000h0m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/66568f35j00susly20019d000u000h0m.jpg\" alt=\"66568f35j00susly20019d000u000h0m\" width=\"1080\" height=\"612\" \/><\/p>\n<p>The first time you run it, a pop-up window fills in the information.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33159\" title=\"c8956b48j00susly2001jd000u000udm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/c8956b48j00susly2001jd000u000udm.jpg\" alt=\"c8956b48j00susly2001jd000u000udm\" width=\"1080\" height=\"1093\" \/><\/p>\n<p>Host Port Fill in port 5678<\/p>\n<p>Volumes fills in the storage directory and Host path fills in a directory created with the name n8n. In Container Path fill in \/home\/node\/.n8n\/.<\/p>\n<p>The purpose of this step is to map the directories in your n8n that you use to store files, data, credentials, etc., outside of Docker. Because Docker is a data-program separation deployment scheme, if you don't do this, the data in your n8n will be emptied the next time you do a quick upgrade.<\/p>\n<p>Fill it out and click Run.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33160\" title=\"732dfd66j00susly2002ld000u000h2m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/732dfd66j00susly2002ld000u000h2m.jpg\" alt=\"732dfd66j00susly2002ld000u000h2m\" width=\"1080\" height=\"614\" \/><\/p>\n<p>Wait a while for the startup to complete, we can click on the link http:\/\/localhost:5678 in the picture below, the default open browser to enter the working interface of n8n, beforehand to set up the firewall in advance to allow the passage of 5678.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33161\" title=\"46899432j00susly20025d000u000h0m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/46899432j00susly20025d000u000h0m.jpg\" alt=\"46899432j00susly20025d000u000h0m\" width=\"1080\" height=\"612\" \/><\/p>\n<p>The default computer browser opens n8n.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33162\" title=\"4e071f27j00susly20009d000mw003ym\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/4e071f27j00susly20009d000mw003ym.jpg\" alt=\"4e071f27j00susly20009d000mw003ym\" width=\"824\" height=\"142\" \/><\/p>\n<p>For the first visit, you need to set up your email address, username, and password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33163\" title=\"3ea40e04j00susly2000id000u000igm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/3ea40e04j00susly2000id000u000igm.jpg\" alt=\"3ea40e04j00susly2000id000u000igm\" width=\"1080\" height=\"664\" \/><\/p>\n<p><strong>III. Basic configuration and settings<\/strong><\/p>\n<p>Once the installation is complete, we need to do some basic configuration to ensure that n8n runs smoothly and meets your needs.<\/p>\n<p>1. Modify default port (optional)<\/p>\n<p>By default, n8n runs on port 5678. if this port is occupied by another application, or if you wish to use a different port, you can modify it by setting an environment variable.<\/p>\n<p>For example, modify n8n to run on port 4000:<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code><span class=\"code-snippet__plaintext\">n8n\u00a0<\/span><span class=\"code-snippet__keyword\">start<\/span><span class=\"code-snippet__plaintext\">\u00a0<\/span><span class=\"code-snippet__comment\">--port=4000<\/span><\/code><\/pre>\n<p>Or run it in Docker:<\/p>\n<p>bash<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"css\"><code><span class=\"code-snippet__plaintext\">docker run -it\u00a0<\/span><span class=\"code-snippet__attr\">--rm<\/span><span class=\"code-snippet__plaintext\">\\<\/span><\/code><code><span class=\"code-snippet__plaintext\">\u00a0\u00a0<\/span><span class=\"code-snippet__attr\">--name<\/span><span class=\"code-snippet__plaintext\">\u00a0n8n\\<\/span><\/code><code><span class=\"code-snippet__plaintext\">\u00a0 -<\/span><span class=\"code-snippet__selector-tag\">p<\/span><span class=\"code-snippet__plaintext\">\u00a0<\/span><span class=\"code-snippet__number\">4000<\/span><span class=\"code-snippet__plaintext\">:<\/span><span class=\"code-snippet__number\">4000<\/span><span class=\"code-snippet__plaintext\">\\<\/span><\/code><code><span class=\"code-snippet__plaintext\">\u00a0 -e N8N_PORT=<\/span><span class=\"code-snippet__number\">4000<\/span><span class=\"code-snippet__plaintext\">\\<\/span><\/code><code><span class=\"code-snippet__plaintext\">\u00a0 n8nio\/n8n<\/span><\/code><\/pre>\n<p>2. Setting up the database (recommended)<\/p>\n<p>Although n8n uses SQLite by default, it is recommended to configure a database such as PostgreSQL for data persistence and stability.<\/p>\n<p>Using PostgreSQL Configuration<\/p>\n<ul>\n<li>Starting the PostgreSQL Service : Make sure that the PostgreSQL service is installed and started on your system.<\/li>\n<li>Create n8n database<\/li>\n<li>Execute SQL<\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code><span class=\"code-snippet__keyword\">CREATE<\/span><span class=\"code-snippet__plaintext\">\u00a0DATABASE n8n.<\/span><\/code><code><span class=\"code-snippet__keyword\">CREATE<\/span><span class=\"code-snippet__plaintext\">\u00a0<\/span><span class=\"code-snippet__keyword\">USER<\/span><span class=\"code-snippet__plaintext\">\u00a0n8nuser\u00a0<\/span><span class=\"code-snippet__keyword\">WITH<\/span><span class=\"code-snippet__plaintext\">\u00a0ENCRYPTED PASSWORD<\/span><span class=\"code-snippet__string\">'yourpassword'<\/span><span class=\"code-snippet__plaintext\">;<\/span><\/code><code><span class=\"code-snippet__keyword\">GRANT<\/span><span class=\"code-snippet__plaintext\">\u00a0<\/span><span class=\"code-snippet__keyword\">ALL<\/span><span class=\"code-snippet__plaintext\">\u00a0PRIVILEGES\u00a0<\/span><span class=\"code-snippet__keyword\">ON<\/span><span class=\"code-snippet__plaintext\">\u00a0DATABASE n8n\u00a0<\/span><span class=\"code-snippet__keyword\">TO<\/span><span class=\"code-snippet__plaintext\">\u00a0n8nuser.<\/span><\/code><\/pre>\n<ul>\n<li>Configure n8n to connect to PostgreSQL:<\/li>\n<\/ul>\n<p>Set the following environment variables when starting n8n:<\/p>\n<pre class=\"code-snippet__js\" data-lang=\"sql\"><code><span class=\"code-snippet__plaintext\">exportDB_TYPE<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__plaintext\">postgresdb<\/span><\/code><code><span class=\"code-snippet__plaintext\">exportDB_POSTGRESDB_HOST<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__plaintext\">localhost<\/span><\/code><code><span class=\"code-snippet__plaintext\">exportDB_POSTGRESDB_PORT<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__number\">5432<\/span><\/code><code><span class=\"code-snippet__plaintext\">exportDB_POSTGRESDB_DATABASE<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__plaintext\">n8n<\/span><\/code><code><span class=\"code-snippet__plaintext\">exportDB_POSTGRESDB_USER<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__plaintext\">n8nuser<\/span><\/code><code><span class=\"code-snippet__plaintext\">exportDB_POSTGRESDB_PASSWORD<\/span><span class=\"code-snippet__operator\">=<\/span><span class=\"code-snippet__plaintext\">yourpassword<\/span><\/code><code><span class=\"code-snippet__plaintext\">n8n\u00a0<\/span><span class=\"code-snippet__keyword\">start<\/span><\/code><\/pre>\n<p>3. HTTPS enabled (optional)<\/p>\n<p>To ensure secure data transmission, especially in production environments, it is recommended to configure HTTPS.<\/p>\n<p>You can use a reverse proxy (such as Nginx) to implement HTTPS and proxy it to the n8n service.<\/p>\n<p><strong>IV. First-time login and initial setup<\/strong><\/p>\n<p>After launching the n8n, open your browser and visit http:\/\/localhost:5678 (or any other port you have set up) and you will see the welcome screen for the n8n.<\/p>\n<p>The first time you access n8n you need to set a user name and login password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33165\" title=\"fee96369j00susly2001jd000ns010sm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/fee96369j00susly2001jd000ns010sm.jpg\" alt=\"fee96369j00susly2001jd000ns010sm\" width=\"856\" height=\"1324\" \/><\/p>\n<p>The first time you enter the n8n operator interface will ask to fill in the basic information, you can not fill in the direct skip.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33164\" title=\"ac8436e9j00susly2001wd000r800z4m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/ac8436e9j00susly2001wd000r800z4m.jpg\" alt=\"ac8436e9j00susly2001wd000r800z4m\" width=\"980\" height=\"1264\" \/><\/p>\n<p>When you use it for the first time, you can make the initial settings by following the steps below:<\/p>\n<ul>\n<li>Create your first workflow: Click the \"Create your first workflow\" button to enter the workflow editing interface.<\/li>\n<li>Add Nodes : Start building your automated process by dragging and dropping nodes (e.g. Openai macromodel, Google Gemini macromodel, HTTP Request, Function, etc.) to the workspace.<\/li>\n<li>Save and Activate : After finishing the workflow design, click \"Save\" to save it, and click \"Test Workflow\" to execute the workflow.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33166\" title=\"cbf7e709j00susly2000ld000u000hmm\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/cbf7e709j00susly2000ld000u000hmm.jpg\" alt=\"cbf7e709j00susly2000ld000u000hmm\" width=\"1080\" height=\"634\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33167\" title=\"fb40b856j00susly20014d000u000f3m\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2025\/04\/fb40b856j00susly20014d000u000f3m.jpg\" alt=\"fb40b856j00susly20014d000u000f3m\" width=\"1080\" height=\"543\" \/><\/p>\n<p><strong>V. Common problems and solutions<\/strong><\/p>\n<p>1. n8n does not start<\/p>\n<ul>\n<li>Check Node.js version : Make sure you have the latest LTS version installed.<\/li>\n<li>Port occupied : Make sure that the port configured by n8n is not occupied by other applications, or try changing the port.<\/li>\n<\/ul>\n<p>2. Unable to connect to the database<\/p>\n<ul>\n<li>Check the database service : Make sure that the PostgreSQL service is started and that the configured database username and password are correct.<\/li>\n<li>Network Configuration : If the database is on a remote server, ensure that the network is accessible and that the firewall allows communication on the appropriate ports.<\/li>\n<\/ul>\n<p>3. Workflow could not be implemented<\/p>\n<ul>\n<li>Node Configuration : Check that each node is configured correctly, especially the API key and connection information.<\/li>\n<li>Log Check : Check the running log of n8n to find error messages and fix them accordingly.<\/li>\n<\/ul>\n<p>Conclusion: Take the first step towards automation and explore the infinite possibilities of n8n<\/p>\n<p>With this guide, I believe you have successfully installed and completed the basic setup of n8n. n8n's powerful customizability and extensive integration support make it ideal for building AI automated workflows. Whether you're looking to streamline personal tasks or optimize enterprise processes, n8n provides you with powerful support.<\/p>","protected":false},"excerpt":{"rendered":"<p>How to quickly get started with a powerful AI automation tool is a must-have for everyone in the future. Whether it is a workplace individual, or a business owner AI automation workflow is bound to become a common demand for all. Today, Crazy continues to introduce you to n8n and explains in detail its installation and basic setup steps. Whether you are a technical novice or a user with a certain foundation, this guide will help you easily take the first step, so that n8n become your efficient work of the right hand! Why choose n8n? Among many automation tools, n8n stands out for being open source, self-hostable and highly customizable. Compared to commercialized tools such as Zapier, n8n is not only free, but also allows users to create their own automated workflows based on their needs. This makes n8n not only suitable for individual<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[6296,6244,6297,1138,5145],"collection":[],"class_list":{"0":"post-33150","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-jiaocheng","7":"category-baike","8":"tag-ai","9":"tag-n8n","11":"tag-1138","12":"tag-5145"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/33150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=33150"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/33150\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=33150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=33150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=33150"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=33150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}