#How can I add curl to my n8n deployment on Railway using the official Docker image?

35 messages · Page 1 of 1 (latest)

golden lark
#

I’m running n8n on Railway using the official Docker image (n8nio/n8n).
In my workflow, I use the Shell Command node to run a command that depends on curl (to download a video and extract frames using ffmpeg).

However, I keep getting:

bash
Copy
Edit
/bin/sh: curl: not found
I tried adding NIXPACKS_PKGS=curl, but I now realize that doesn’t work with Docker images — only Nixpacks builds.

I understand I can create a new project with a custom Dockerfile that installs curl, but I’d love to know:

Is there a way to add curl to my existing n8n Railway deployment?

If not, is forking the Docker image and deploying it as a new service the only clean solution?(also how to do it)

Any tips to avoid disconnecting it from my existing workflows?

I don’t mind starting from a new database, just want to avoid unnecessary complexity if there's a better path.

Thanks a lot in advance! 🙏

radiant zodiacBOT
#

Project ID: N/A

golden lark
#

0ee304c2-dee3-4a0c-af80-6b5224c62649

#

i talked with n8n and they said this is a Railway issue!

regal shell
#

run apk add curl if you are ssh'ing into the container

golden lark
#

Dockerfile must install curl (and other tools) at build time, not dynamically during workflow execution.

regal shell
#

Create a Dockerfile with the following content:

FROM n8nio/n8n:latest

RUN apk --no-cache add curl

CMD ["n8n"]```

Try deploying it and tell me how this goes
golden lark
#

okay so first i need to add this file to github
then i add it to the workflow right?

regal shell
#

You create a Dockerfile in your github repo, then you deploy this repo in your project

#

You should also copy all env vars from your original service to this new service

golden lark
#

like that?

regal shell
#

yes.

#

let's see if it deploys fine

golden lark
#

i got:
✕ [2/2] RUN apk --no-cache add curl
process "/bin/sh -c apk --no-cache add curl" did not complete successfully: exit code: 99

Dockerfile:3


1 | FROM n8nio/n8n:latest

2 |

3 | >>> RUN apk --no-cache add curl

4 |

5 | CMD ["n8n"]


ERROR: failed to solve: process "/bin/sh -c apk --no-cache add curl" did not complete successfully: exit code: 99

regal shell
#
FROM n8nio/n8n:latest

RUN apk update && \
    apk add --no-cache curl

CMD ["n8n"]```
#

try running update before

golden lark
#

i got same error

#

i used:
FROM node:18-alpine

Set working directory

WORKDIR /app

Install dependencies

RUN apk update && apk add --no-cache
curl
python3
make
g++
git
bash

Install n8n globally

RUN npm install -g n8n

Create config dir

RUN mkdir -p /home/node/.n8n && chown -R node:node /home/node

Run as non-root

USER node

EXPOSE 5678

CMD ["n8n"]

regal shell
#

and did it work?

golden lark
#

the nodes are connected with arrows now

#

but same problem Problem in node ‘Execute Command‘
Command failed: curl --version /bin/sh: curl: not found

regal shell
regal shell
#

I think the issue is that this command is being run on the worker

#

And the worker isn't using this custom Dockerfile

golden lark
#

yes if i wont to re deploy the worker, i see the new dockerfile active and not synced together

#

finally, i fixed it!!

#

i changed all the sources from n8n image to my repo

regal shell
#

oh, amazing

#

glad you could do it!

#

gonna mark this as solved

golden lark
#

thank you a lot!!!

regal shell
#

np, sorry I couldn't be of much help! if you find another issue please open a new thread!

#

!s