Help me to find workaround on stateless environment (AWS AppRunner)

Hi, I have deployed n8n to AWS AppRunner. Everything works fine unless the service restarts (which happens often, as the app runner stops the service on idle to save money).

Unfortunately, App Runner does not support any persistent storage, like EFS.

That means the ./n8n is empty on every start, and the n8n deployment ID is changing.

And my free licence is not working as my fingerprint is changing.

Is it possible to move those data to the database? That will allow n8n to run with no persistent storage available, which is a good thing regarding 12-factor app.

Or use some other storage for secrets, like parameter store or s3.

Information on your n8n setup

  • n8n version: 1.70.2
  • Database (default: SQLite): postgress
  • n8n EXECUTIONS_PROCESS setting (default: own, main): docker
  • Running n8n via (Docker, npm, n8n cloud, desktop app): AWS AppRunner
  • Operating system: amazon linux 2

hello @Jack_Rudenko

you can set the envs in the AppRuner for n8n to use the external database plus set the encryption key with N8N_ENCRYPTION_KEY env to be able to encrypt and decrypt the data within the database.

yep, I have found that.

Unfortunately, it did not help.

App Runner does not support websocket connection as it works on top of API Gateway.

WebSocket is also required for the workflow editor.

Another issue is that services in Apprunner are suspended when no API requirements are coming. This means that my workflows will not be executed by n8n, and service will be suspended.

So, the easy and cheap solution AppRunner is not suitable for n8n.

The other options are:

  • ECS + ALB (as API gateway options do not work), but it is hard for people who are not experts in AWS
  • AWS Lightsails - which few people know about.

The simplest way is to deploy an EC2 instance and run docker inside it :slight_smile:

You don’t need ALB for it, or complex solutions like ECS + ECR + Code Build.

The bare minimum is: docker, certbot, any free DNS service, elastic IP.

optional: EBS Volume (for persistent storage), free DNS services like noip.com instead of elastic IP

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