N8n deployed via Railway, update?

Hi All!

I have n8n deployed via docker on railway, what is the easiest way to upgrade without losing any of my flows or integrations?

Thanks in advance!

Hi @madhatter349 :wave: I just deployed via Railway to test - can you share your Dockerfile?

If you’re using this template, this will be the Dockerfile in the repo, which automatically is pulling latest:

FROM n8nio/n8n:latest

ARG PGPASSWORD
ARG PGHOST
ARG PGPORT
ARG PGDATABASE
ARG PGUSER

ENV DB_TYPE=postgresdb
ENV DB_POSTGRESDB_DATABASE=$PGDATABASE
ENV DB_POSTGRESDB_HOST=$PGHOST
ENV DB_POSTGRESDB_PORT=$PGPORT
ENV DB_POSTGRESDB_USER=$PGUSER
ENV DB_POSTGRESDB_PASSWORD=$PGPASSWORD

ARG ENCRYPTION_KEY

ENV N8N_ENCRYPTION_KEY=$ENCRYPTION_KEY

CMD ["n8n start"]

That means that you can always pull the latest version of n8n on redeployment without too much hassle or worry :+1:

1 Like

I did a simple redeploy, now I’m getting the following error “Error: command n8n not found”

I tried changing CMD [“n8n”, “start”] to CMD [“n8n start”] and it’s still not working.

I’m not too sure - but perhaps @Jon would have a better idea when he’s back on Monday?

tons of trial and error, tried every combo and tried searching github… FINALLY got it working.

“CMD [“start”]”

Thank you again for your help!

2 Likes

So glad to hear you got it working, and thank you for posting your solution! :tada:

I had this issue when I upgraded a long time ago. My credentials didnt transfer over, i get the folloing error:

“Problem loading credential Credentials could not be decrypted. The likely reason is that a different “encryptionKey” was used to encrypt the data.

Hey @madhatter349,

So on Railway you can normally just hit reeploy in the Railway interface, There is a GitHub issue open on the Railway template where users were wondering the same thing: n8n update · Issue #1 · railwayapp-templates/n8n · GitHub

Assuming you have the encryption key environment key set and Postgres in use everything should be all good, The error around not being able to decrypt credentials tends to mean that N8N_ENCRYPTION_KEY has not been set or the value for it has been changed.

1 Like

Thank you! I manually just reentered all my credentials!

1 Like