Back to n8n Management Hub

AWS S3 Integration – Complete Setup Guide

Complete guide to set up AWS S3 credentials in n8n for file storage and automation workflows
คู่มือการตั้งค่า AWS S3 สำหรับ n8n เพื่อจัดเก็บไฟล์และระบบอัตโนมัติ

Overview: This guide covers the complete process: Create AWS account → Secure it → Create IAM user + keys → Create S3 bucket → Add least-privilege policy → Wire keys into n8n → Test upload.
ภาพรวม: คู่มือนี้ครอบคลุมกระบวนการทั้งหมด: สร้างบัญชี AWS → รักษาความปลอดภัย → สร้าง IAM user + keys → สร้าง S3 bucket → เพิ่ม policy ขั้นต่ำ → เชื่อมต่อกับ n8n → ทดสอบการอัปโหลด
1

Create and Secure the AWS Account สร้างและรักษาความปลอดภัยบัญชี AWS

  1. Go to aws.amazon.com and Create an AWS account
    ไปที่ aws.amazon.com และสร้างบัญชี AWS
  2. Verify email, add credit card, choose Basic support
    ยืนยันอีเมล เพิ่มบัตรเครดิต เลือก Basic support
  3. Sign in as Root user once
    เข้าสู่ระบบในฐานะ Root user หนึ่งครั้ง
  4. Turn on MFA for root: IAM → Users → Security recommendations → "Enable MFA for root"
    เปิด MFA สำหรับ root: IAM → Users → Security recommendations → "Enable MFA for root"
2

Create an IAM User for n8n and Its Access Key สร้าง IAM User สำหรับ n8n และ Access Key

  1. Open IAM → Users → Create user
    เปิด IAM → Users → Create user
  2. Name: n8n-s3-uploader. No console access needed. Create user
    ชื่อ: n8n-s3-uploader ไม่ต้องการ console access สร้าง user
  3. Open the new user → Permissions → Add permissions → Attach policies directly → click Create policy (we'll add a tight policy in step 4)
    เปิด user ใหม่ → Permissions → Add permissions → Attach policies directly → คลิก Create policy (เราจะเพิ่ม policy ในขั้นตอนที่ 4)
  4. Open the user → Security credentials → Create access key → use "Application running outside AWS"
    เปิด user → Security credentials → Create access key → ใช้ "Application running outside AWS"
  5. Copy Access key ID and Secret access key. Store securely. You will need both in n8n
    คัดลอก Access key ID และ Secret access key เก็บไว้อย่างปลอดภัย จะต้องใช้ทั้งคู่ใน n8n
Important: Save your Access Key ID and Secret Access Key immediately. AWS will not show the secret key again after this step.
สำคัญ: บันทึก Access Key ID และ Secret Access Key ทันที AWS จะไม่แสดง secret key อีกครั้งหลังจากขั้นตอนนี้
3

Create the S3 Bucket สร้าง S3 Bucket

Bucket Name Generator / เครื่องมือสร้างชื่อ Bucket

Enter project name to generate
  1. S3 → Create bucket
    S3 → Create bucket
  2. Bucket name: global unique, e.g. yourproject-assets-prod (use generator above)
    ชื่อ Bucket: ต้องไม่ซ้ำทั่วโลก เช่น yourproject-assets-prod (ใช้เครื่องมือสร้างข้างบน)
  3. Region: pick yours (e.g. ap-southeast-1)
    Region: เลือกของคุณ (เช่น ap-southeast-1)
  4. Keep Block all public access ON for private buckets
    เก็บ Block all public access เปิดไว้ สำหรับ bucket ส่วนตัว
  5. Create bucket
    สร้าง bucket
4

Grant Least-Privilege Permissions to That User กำหนดสิทธิ์ขั้นต่ำให้กับ User

Create a policy that allows only this bucket. Replace the bucket name everywhere.
สร้าง policy ที่อนุญาตเฉพาะ bucket นี้เท่านั้น แทนที่ชื่อ bucket ทุกที่

IAM → Policies → Create policy → JSON
IAM → Policies → Create policy → JSON

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": "arn:aws:s3:::yourproject-assets-prod" }, { "Effect": "Allow", "Action": ["s3:GetObject","s3:PutObject","s3:DeleteObject"], "Resource": "arn:aws:s3:::yourproject-assets-prod/*" } ] }
If you plan to set ACL: public-read from n8n, also add:
หากคุณวางแผนที่จะตั้ง ACL: public-read จาก n8n ให้เพิ่ม:
{ "Effect": "Allow", "Action": ["s3:PutObjectAcl"], "Resource": "arn:aws:s3:::yourproject-assets-prod/*" }

Save as n8n-s3-uploader-policy, then Attach it to the n8n-s3-uploader user.
บันทึกเป็น n8n-s3-uploader-policy แล้วแนบกับ n8n-s3-uploader user

5

Create AWS Credentials in n8n สร้าง AWS Credentials ใน n8n

  1. In n8n: Credentials → New
    ใน n8n: Credentials → New
  2. Search AWS → choose AWS credential
    ค้นหา AWS → เลือก AWS credential
  3. Fill: / กรอก:
    • Access Key ID: from step 2 / จากขั้นตอนที่ 2
    • Secret Access Key: from step 2 / จากขั้นตอนที่ 2
    • Region: ap-southeast-1 (or your region) / หรือ region ของคุณ
  4. Save. Test if the credential allows listing S3.
    บันทึก ทดสอบว่า credential สามารถแสดงรายการ S3 ได้หรือไม่
6

Test an Upload with the AWS S3 Node in n8n ทดสอบการอัปโหลดด้วย AWS S3 Node ใน n8n

  1. Add HTTP Request (or Read Binary File) to produce a binary item (data)
  2. Add AWS S3 node
  3. Configure:
    • Credentials to connect with: your AWS credential
    • Resource: File
    • Operation: Upload
    • Bucket Name: yourproject-assets-prod
    • File Name: e.g. test.jpg
    • Binary File: ON
    • Input Binary Field: data
    • Additional Fields → Content Type: image/jpeg
    • Optional: ACL public-read (only if you enabled ACLs and want a public object)
  4. Run node. You should see ETag and Location in the output
7

How to View the File วิธีการดูไฟล์

Private Bucket (Recommended) / Bucket ส่วนตัว (แนะนำ):

Add another AWS S3 node with Operation: Get Presigned URL. Set an expiry (e.g. 3600 seconds). Use that URL to view the file.
เพิ่ม AWS S3 node อีกตัวด้วย Operation: Get Presigned URL ตั้งเวลาหมดอายุ (เช่น 3600 วินาที) ใช้ URL นั้นเพื่อดูไฟล์

Public Access (Not Recommended for Most Cases) / การเข้าถึงสาธารณะ (ไม่แนะนำในกรณีส่วนใหญ่):

Turn off Block public access at the bucket, add a bucket policy to allow reads, and/or upload with ACL: public-read. Example bucket policy:
ปิด Block public access ที่ bucket เพิ่ม bucket policy เพื่ออนุญาตการอ่าน และ/หรือ อัปโหลดด้วย ACL: public-read ตัวอย่าง bucket policy:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "AllowPublicRead",
    "Effect": "Allow",
    "Principal": "*",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::yourproject-assets-prod/*"
  }]
}

Then your URL will be: / แล้ว URL ของคุณจะเป็น:
https://yourproject-assets-prod.s3.ap-southeast-1.amazonaws.com/test.jpg

8

Quick Diagnostics การแก้ไขปัญหาเบื้องต้น

Common Issues and Solutions / ปัญหาที่พบบ่อยและวิธีแก้ไข

AccessDenied when opening the object URL = object is private or bucket blocks public. Use a presigned URL or fix policy/ACL.
SignatureDoesNotMatch = wrong keys or region mismatch.
403 on upload = IAM policy missing s3:PutObject (and s3:PutObjectAcl if you set an ACL).
Wrong MIME in browser = set Content Type on upload.

🎉 Setup Complete! / การตั้งค่าเสร็จสมบูรณ์!

Your AWS S3 integration with n8n is now ready. You can: / การรวม AWS S3 กับ n8n ของคุณพร้อมแล้ว คุณสามารถ: