# Run n8n docker hub image on AWS ECS Fargate with EFS

**URL:** <https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530>\
**Category:** Questions\
**Created:** [April 3, 2025, 5:38pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530 "2025-04-03T17:38:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 3, 2025, 5:38pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/1 "2025-04-03T17:38:00Z")

</div>

## Describe the problem/error/question

I created an AWS ECS Service on Fargate using n8n docker hub image ‘n8nio/n8n:latest’. The service uses EFS with access point that mounts to ‘/home/node/.n8n’. The EFS access point’s uid and gid is set to 1000:1000 and permission 0755. The VPC security groups allow the EFS traffic. The EFS system policy is set to allow “elasticfilesystem:ClientRootAccess”, “elasticfilesystem:ClientWrite”, “elasticfilesystem:ClientMount”. But I couldn’t start up the service successfully on ECS Fargate due to some directory access issue. Any help is appreciated.

## What is the error message (if any)?

…  
root: /usr/local/lib/node\_modules/n8n  
code: EACCES  
message: EACCES: permission denied, open ‘/home/node/.n8n/config’  
See more details with DEBUG=\*  
(Use `node --trace-warnings ...` to show where the warning was created)  
…

## Please share your workflow

n/a

```auto
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

```

n/a

## Share the output returned by the last node

## Information on your n8n setup

- \*\*n8n version:\*\*n8nio/n8n:latest
- \*\*Database (default: SQLite):\*\*SQLite
- \*\*n8n EXECUTIONS\_PROCESS setting (default: own, main):\*\*unknown
- \*\*Running n8n via (Docker, npm, n8n cloud, desktop app):\*\*as container on AWS ECS Fargate
- \*\*Operating system:\*\*Linux/ARM64

---

<div class="post-metadata">

**Author:** ![mdmiko](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mdmiko/32/69694_2.png) [@mdmiko](https://community.n8n.io/u/mdmiko)\
**Post date:** [April 3, 2025, 6:09pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/2 "2025-04-03T18:09:19Z")

</div>

can you access on cointainer shell?  
[https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/](https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/)

Maybe you can check files and folders owner and permission

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 4, 2025, 2:55am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/3 "2025-04-04T02:55:05Z")

</div>

I can’t access the container as the ECS service cannot start up properly. The task was deprovisioned before it reached the running state. Here’s the volume details of the task definition and EFS access point config. Do you see any problems?

 ![Screenshot 2025-04-04 at 10.52.52 AM](https://europe1.discourse-cdn.com/n8n/original/3X/f/1/f177214986013984f086fca81d40ae91d94c0536.png)

 ![Screenshot 2025-04-04 at 10.48.09 AM](https://europe1.discourse-cdn.com/n8n/original/3X/1/e/1e9fe610aa91b2a035c219c8b3f5843c9f398998.png)

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 4, 2025, 6:42am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/4 "2025-04-04T06:42:56Z")

</div>

Hi,

As a test did you try to set 0777 to see if the error disappears?

If i remember from the past, there is something with recursive rights and ownership.

Also this might be relevant : [ubuntu - EFS mount failing with mount.nfs4: access denied by server - Stack Overflow](https://stackoverflow.com/a/78695945)

regards  
Jiri.

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 4, 2025, 9:05am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/5 "2025-04-04T09:05:30Z")

</div>

Hi,

Before I tried 0777, I noticed a config file was created under ‘/home/node/.n8n’. And the config file has ‘-rw-r–r–. 1 1000 1000 56 Apr 4 05:55 config’. Then I created a new access point with 1000:1000 and 0777 and tried to redeploy and launch the service on Fargate, the container exit with code 1. And there’s no CloudWatch log any more. What else can I try?

Regards,  
PH

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 4, 2025, 11:01am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/6 "2025-04-04T11:01:34Z")

</div>

Hi, while I was working with the k8 examples for n8n i came across something interesting

> **[n8n-hosting/kubernetes at main · n8n-io/n8n-hosting](https://github.com/n8n-io/n8n-hosting/tree/main/kubernetes)**
>
> main/kubernetes

```
  initContainers:
    - name: volume-permissions
      image: busybox:1.36
      command: ["sh", "-c", "chown 1000:1000 /data"]
      volumeMounts:
        - name: n8n-claim0
          mountPath: /data

```

This confirms with my ideas that some changes where needed after mounting with EFS as well.

I don’t have further ideas unfortunately.

Reg,  
J.

---

<div class="post-metadata">

**Author:** ![mdmiko](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mdmiko/32/69694_2.png) [@mdmiko](https://community.n8n.io/u/mdmiko)\
**Post date:** [April 4, 2025, 1:18pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/7 "2025-04-04T13:18:32Z")

</div>

Dont know ECS service, i try to brainstorm with you.

n8n image run under a non-root user called node  
If you have the UID and GID of the ‘node’ user from the n8n container, (maybe) you could update values on your EFS access point

This becouse maybe 1000:1000 be a root user

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 4, 2025, 1:28pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/8 "2025-04-04T13:28:18Z")

</div>

1000:1000 is correct based on the N8N image. There is a node user eXactly with this created. This is why he tried to set it explicitly.

Reg,  
J.

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 7, 2025, 10:17am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/9 "2025-04-07T10:17:12Z")

</div>

Hi, seems it’s not the EFS problem. I removed EFS from Task Definition and redeployed the service, it still crashed with container exit code: 1. No log items in the CloudWatch log file. What else shall I try?

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 7, 2025, 10:25am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/10 "2025-04-07T10:25:05Z")

</div>

Sorry I am out of ideas tbh, maybe you can check the following terraform template to see what is actually required to get it working

> **[GitHub - elasticscale/terraform-aws-n8n: Run N8n on AWS ECS Fargate](https://github.com/elasticscale/terraform-aws-n8n)**
>
> Run N8n on AWS ECS Fargate

You can take/understand the parts you need

Reg,  
J.

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 15, 2025, 10:59am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/11 "2025-04-15T10:59:11Z")

</div>

Hi, this has not been resolved. Any help is appreciated.

PH

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 15, 2025, 2:50pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/12 "2025-04-15T14:50:14Z")

</div>

Hi, did you try with the template?  
Even a simple test actually using the exact template should give you a definite answer on what is going on. You could use terraform and API keys and it can be tested in 30min.

Reg  
J.

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [April 17, 2025, 2:49am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/13 "2025-04-17T02:49:49Z")

</div>

Hi, we use CloudFormation and AWS CDK instead of terraform. Since this is not really urgent for us, will look into the template later. Thanks for the response.

PH

---

<div class="post-metadata">

**Author:** ![jcuypers](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcuypers/32/54965_2.png) [@jcuypers](https://community.n8n.io/u/jcuypers)\
**Post date:** [April 17, 2025, 4:04am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/14 "2025-04-17T04:04:26Z")

</div>

Hi, the point of the template is to start from a known working setup and not to waste any unnecessary time. Urgent or not.

Reg  
J

---

<div class="post-metadata">

**Author:** ![Akif](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/akif/32/73771_2.png) [@Akif](https://community.n8n.io/u/Akif)\
**Post date:** [April 17, 2025, 4:52am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/15 "2025-04-17T04:52:28Z")

</div>

> [@blacktulip71](#):
>
> ## Describe the problem/error/question
> 
> I created an AWS ECS Service on Fargate using n8n docker hub image ‘n8nio/n8n:latest’. The service uses EFS with access point that mounts to ‘/home/node/.n8n’. The EFS access point’s uid and gid is set to 1000:1000 and permission 0755. The VPC security groups allow the EFS traffic. The EFS system policy is set to allow “elasticfilesystem:ClientRootAccess”, “elasticfilesystem:ClientWrite”, “elasticfilesystem:ClientMount”. But I couldn’t start up the service successfully on ECS Fargate due to some directory access issue. Any help is appreciated.
> 
> ## What is the error message (if any)?
> 
> …  
> root: /usr/local/lib/node\_modules/n8n  
> code: EACCES  
> message: EACCES: permission denied, open ‘/home/node/.n8n/config’  
> See more details with DEBUG=\*  
> (Use `node --trace-warnings ...` to show where the warning was created)  
> …
> 
> ## Please share your workflow
> 
> n/a
> 
> ```auto
> (Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
> 
> ```
> 
> n/a
> 
> ## Share the output returned by the last node
> 
> ## Information on your n8n setup
> 
> - \*\*n8n version:\*\*n8nio/n8n:latest
> - \*\*Database (default: SQLite):\*\*SQLite
> - \*\*n8n EXECUTIONS\_PROCESS setting (default: own, main):\*\*unknown
> - \*\*Running n8n via (Docker, npm, n8n cloud, desktop app):\*\*as container on AWS ECS Fargate
> - \*\*Operating system:\*\*Linux/ARM64

you’re running into a **permissions error (EACCES)** because the **n8n Docker container running in AWS Fargate** cannot write to the mounted **EFS directory `/home/node/.n8n`** — even though you’ve seemingly set UID/GID and permissions correctly.

---

<div class="post-metadata">

**Author:** ![Phill\_Pafford](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/phill_pafford/32/79324_2.png) [@Phill\_Pafford](https://community.n8n.io/u/Phill_Pafford)\
**Post date:** [May 8, 2025, 8:12pm UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/16 "2025-05-08T20:12:07Z")

</div>

Trying to do something similar, following for any updates

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [May 29, 2025, 7:54am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/17 "2025-05-29T07:54:30Z")

</div>

We managed to get it up and running with efs finally. Here’s the AWS Copilot manifest.yml file FYR.

# The manifest for the “n8n” service.

# Read the n8n environment variables documentation at:

# [Environment Variables Overview | n8n Docs](https://docs.n8n.io/hosting/configuration/environment-variables/)

# Read the full specification for the “Load Balanced Web Service” type at:

# [Load Balanced Web Service - AWS Copilot CLI](https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/)

# Your service name will be used in naming your resources like log groups, ECS services, etc.

name: n8n  
type: Load Balanced Web Service

# Distribute traffic to your service.

http:

# Requests to this path will be forwarded to your service.

# To match all requests you can use the “/” path.

path: ‘/’

# You can specify a custom health check path. The default is “/”.

healthcheck:  
path: ‘/healthz’  
healthy\_threshold: 2 # number of consecutive health check successes required before considering an unhealthy target healthy  
unhealthy\_threshold: 4 # number of consecutive health check failures required before considering a target unhealthy  
interval: 30s # amount of time, in seconds, between health checks  
timeout: 10s # amount of time, in seconds, during which no response from a target means a failed health check  
grace\_period: 360s # grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries  
deregistration\_delay: 30s # amount of time to wait for targets to drain connections during deregistration. align with n8n graceful shutdown timeout

# Configuration for your containers and service.

image:  
location: n8nio/n8n:latest # The location of n8n image in the Docker Hub.

## location: n8nio/n8n:stable

# Port exposed through your container to route traffic to it.

port: 5678

cpu: 1024 # Number of CPU units for the task.  
memory: 2048 # Amount of memory in MiB used by the task.  
count: 1 # Number of tasks that should be running in your service.

# platform: linux/x86\_64

platform: linux/arm64  
exec: true # Enable running commands in your container.

# Storage configuration for n8n

storage:  
volumes:  
n8n-data:  
path: ‘/home/node/.n8n’ # Mount path inside the container where n8n stores data.  
read\_only: false  
efs:  
id:   
auth:  
iam: true  
access\_point\_id:

mount\_points:

- source\_volume: n8n-data # Must match the name under storage.volumes  
container\_path: /home/node/.n8n # The required path inside the n8n container  
read\_only: false

network:  
vpc:  
placement: ‘private’

variables:  
N8N\_LOG\_LEVEL: ‘error’  
GENERIC\_TIMEZONE: ‘’  
N8N\_TEMPLATES\_ENABLED: ‘true’  
N8N\_METRICS: ‘true’  
N8N\_USER\_FOLDER: ‘/home/node’

# Optional: Basic Auth for n8n UI

N8N\_BASIC\_AUTH\_ACTIVE: “true”  
N8N\_BASIC\_AUTH\_USER: “”  
N8N\_BASIC\_AUTH\_PASSWORD: “”

# You can override any of the values defined above by environment.

environments:  
test:  
count: 1 # Number of tasks to run for the “test” environment.  
cpu: 512  
memory: 1024  
variables:  
N8N\_HOST: ‘n8n.test.’  
N8N\_EDITOR\_BASE\_URL: ‘[https://n8n.test](https://n8n.test).’  
production:  
count: 1  
variables:  
N8N\_HOST: ‘n8n.production.’  
N8N\_EDITOR\_BASE\_URL: ‘[https://n8n.production](https://n8n.production).’

---

<div class="post-metadata">

**Author:** ![blacktulip71](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@blacktulip71](https://community.n8n.io/u/blacktulip71)\
**Post date:** [May 29, 2025, 7:56am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/18 "2025-05-29T07:56:53Z")

</div>

The format and the URLs were messed up after I posted. But you should be able to figure out based on the above.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [August 27, 2025, 7:57am UTC](https://community.n8n.io/t/run-n8n-docker-hub-image-on-aws-ecs-fargate-with-efs/96530/19 "2025-08-27T07:57:07Z")

</div>

Closed on August 27, 2025, 7:57am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
