Set the Redis value in the custom node from env file

I am creating custom node and I want to put the Redis value from the ENV file

I want to remove the Credentials section from the UI and want to redis read the value for the host and port by the env file

Welcome to the community @gurpreet_singh!

In this case, you have to copy the Redis node, remove that it needs credentials (remove the “credentials” property), and hardcode the values to be read from the environment like for example process.env.REDIS_PASSWORD.

So @jan

I removed that and now it’s like this -

		const redisOptions: redis.ClientOpts = {
			host: 'localhost',
			port: Number(process.env.N8N_REDIS_PORT)

So is it fine ?

So .env file need to be at root ?

Looks correct.

The .env file has to be in the folder your run the docker-compose up -d command in.