{"id":1528,"date":"2020-12-22T14:54:46","date_gmt":"2020-12-22T06:54:46","guid":{"rendered":"https:\/\/eligiblestore.com\/blog\/?p=1528"},"modified":"2020-12-22T18:36:36","modified_gmt":"2020-12-22T10:36:36","slug":"workflow-automation-with-n8n-installation","status":"publish","type":"post","link":"https:\/\/eligiblestore.com\/blog\/2020\/12\/22\/workflow-automation-with-n8n-installation\/","title":{"rendered":"Workflow Automation with n8n | Installation"},"content":{"rendered":"<h3>What is n8n and how does it look?<\/h3>\n<p>Short answer IFTTT-<em><strong>like<\/strong><\/em> self-hosted alternative, details? Check <a href=\"https:\/\/n8n.io\/\" target=\"_blank\" rel=\"noopener\">https:\/\/n8n.io\/<\/a><\/p>\n<h3>How to install?<\/h3>\n<p>Please note that I am hosting with Raspberry Pi hence the easier to maintenance and configure for me is through docker which mean the image used is arm-based. This tutorial expects that you knew docker and docker-compose already. The database I am using is PostgreSQL 11 feel free to change if you prefer MySQL. Lastly, please <strong>FIX the path, CHANGE the username and use a STRONG password.<\/strong><\/p>\n<h4>Use docker-compose<\/h4>\n<p>First create file <em><strong>.env<\/strong><\/em> and paste below:<\/p>\n<pre>POSTGRES_USER=pgroot\r\nPOSTGRES_PASSWORD=pgroot-password\r\nPOSTGRES_DB=n8n\r\n\r\nPOSTGRES_NON_ROOT_USER=n8n\r\nPOSTGRES_NON_ROOT_PASSWORD=n8n-password\r\n\r\nN8N_BASIC_AUTH_USER=user\r\nN8N_BASIC_AUTH_PASSWORD=password\r\n\r\n# The top level domain to serve from\r\nDOMAIN_NAME=example.com\r\n\r\n# The subdomain to serve from\r\nSUBDOMAIN=workflow\r\n<\/pre>\n<p>Then create file <em><strong>docker-compose.yml<\/strong><\/em> and copy and paste below:<\/p>\n<pre>version: '3.1'\r\n\r\nservices:\r\n\r\n  postgres:\r\n    image: postgres:11\r\n    restart: always\r\n    environment:\r\n      - POSTGRES_USER\r\n      - POSTGRES_PASSWORD\r\n      - POSTGRES_DB\r\n      - POSTGRES_NON_ROOT_USER\r\n      - POSTGRES_NON_ROOT_PASSWORD\r\n    volumes:\r\n      - \/path\/to\/.config\/appdata\/n8n\/init-data.sh:\/docker-entrypoint-initdb.d\/init-data.sh\r\n      - \/path\/to\/.config\/appdata\/n8n\/postgresql:\/var\/lib\/postgresql\/data\r\n\r\n  n8n:\r\n    image: n8nio\/n8n:0.96.0-rpi\r\n    restart: always\r\n    environment:\r\n      - DB_TYPE=postgresdb\r\n      - DB_POSTGRESDB_HOST=postgres\r\n      - DB_POSTGRESDB_PORT=5432\r\n      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}\r\n      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}\r\n      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}\r\n      - N8N_BASIC_AUTH_ACTIVE=true\r\n      - N8N_BASIC_AUTH_USER\r\n      - N8N_BASIC_AUTH_PASSWORD\r\n      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}\r\n      - N8N_PORT=5678\r\n      - N8N_PROTOCOL=https\r\n      - NODE_ENV=production\r\n      - WEBHOOK_TUNNEL_URL=https:\/\/${SUBDOMAIN}.${DOMAIN_NAME}\/\r\n      - VUE_APP_URL_BASE_API=https:\/\/${SUBDOMAIN}.${DOMAIN_NAME}\/\r\n      - GENERIC_TIMEZONE=Asia\/Singapore\r\n      - TZ=Asia\/Singapore\r\n    ports:\r\n      - 5678:5678\r\n    links:\r\n      - postgres\r\n    volumes:\r\n      - \/path\/to\/.config\/appdata\/n8n\/.n8n:\/home\/node\/.n8n\r\n    # Wait 5 seconds to start n8n to make sure that PostgreSQL is ready\r\n    # when n8n tries to connect to it\r\n    command: \/bin\/sh -c \"sleep 5; n8n start\"\r\n<\/pre>\n<p>and as usual run docker-compose command <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">docker-compose up -d<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What is n8n and how does it look? Short answer IFTTT-like self-hosted alternative, details? Check https:\/\/n8n.io\/ How to install? Please note that I am hosting with Raspberry Pi hence the easier to maintenance and configure for me is through docker which mean the image used is arm-based. This tutorial expects that you knew docker and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1525,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[32],"tags":[71,49,48,72],"class_list":["post-1528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","tag-n8n","tag-pi","tag-raspberry-pi","tag-workflow"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8pg5H-oE","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/eligiblestore.com\/blog\/wp-content\/uploads\/2020\/12\/n8n.png?fit=960%2C575&ssl=1","_links":{"self":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/comments?post=1528"}],"version-history":[{"count":14,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1528\/revisions"}],"predecessor-version":[{"id":1546,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/posts\/1528\/revisions\/1546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/media\/1525"}],"wp:attachment":[{"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/media?parent=1528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/categories?post=1528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eligiblestore.com\/blog\/wp-json\/wp\/v2\/tags?post=1528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}