# userDir configuration

**URL:** <https://discourse.nodered.org/t/userdir-configuration/79491>\
**Category:** General\
**Created:** [29 June 2023 18:26 UTC](https://discourse.nodered.org/t/userdir-configuration/79491 "2023-06-29T18:26:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ax2382](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ax2382/32/81010_2.png) [@ax2382](https://discourse.nodered.org/u/ax2382)\
**Post date:** [29 June 2023 18:26 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/1 "2023-06-29T18:26:07Z")

</div>

Hello, I'm a newbie to node-red and am unable to figure out the proper configuration value for **userDir**.

I looked at the User Guide but still, where am I supposed to create the directory for the user **nol**?

I see a new folder was created at the root of my project **$HOME** with the directory **.nodered** in it.

Should my **userDir** value be **/home/.nodered/** or should I create a new directory **myUser** in **$HOME** and the **userDir** value be **/home/myUser/.nodered/**?

Thank you

```auto
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { json } from 'express';

async function bootstrap() {
	const app = await NestFactory.create(AppModule);
	app.enableCors();
	app.use(json({ limit: '50mb' }));

	const config = new DocumentBuilder()
		.setTitle('OAST')
		.setDescription('The OAST API description')
		.setVersion('0.1')
		.build();

	const document = SwaggerModule.createDocument(app, config);
	SwaggerModule.setup('api', app, document);

	/**
	 * Configure node-red
	 */
	const httpAdapter = app.getHttpAdapter();
	const RED = require('node-red');

	// Settings object for node-red
	const nodeRedSettings = {
		httpAdminRoot: '/red',
		httpNodeRoot: '/api',
		userDir: '/home/nol/.nodered/',
		functionGlobalContext: {}, // enables global context
	};

	RED.init(httpAdapter, nodeRedSettings);
	// Serve the editor UI from /red
	app.use(nodeRedSettings.httpAdminRoot, RED.httpAdmin);
	// Serve the http nodes UI from /api
	app.use(nodeRedSettings.httpNodeRoot, RED.httpNode);

	await app.listen(3001);

	// Start the runtime
	RED.start();
}
bootstrap();

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [29 June 2023 18:35 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/2 "2023-06-29T18:35:53Z")

</div>

Hi @ax2382.

I guess you are using Linux?  
What variety of Linux?  
If it's Debian based use the Raspberry Pi installation script and it will automatically do everything you need. No need to create directories.  
Ps. Unless you are using Docker or something like that

Do you actually have a user "nol"? I know that's used as an example in some places but you don't need to use it.  
For example, on my raspberry pi I installed Node-red as the user "pi". The NR base directory is /home/pi/.node-red

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 June 2023 18:52 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/3 "2023-06-29T18:52:40Z")

</div>

'nol' stands for Nick O'Leary one of the developers of Node-RED. So you would use the user id you are installing Node-RED with.

As @jbudd said, if you are doing this on a raspberry, the current install script will generate the settings.js file. If you are using the current script, you will see this:

```auto
/** By default, all user data is stored in a directory called `.node-red` under
     * the user's home directory. To use a different location, the following
     * property can be used
     */
    //userDir: '/home/nol/.node-red/',

```

as you can see, that option is commented out as a default.

That option is useful if you want to change the default location of your user data.

---

<div class="post-metadata">

**Author:** ![ax2382](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ax2382/32/81010_2.png) [@ax2382](https://discourse.nodered.org/u/ax2382)\
**Post date:** [29 June 2023 21:23 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/4 "2023-06-29T21:23:17Z")

</div>

@jbudd @zenofmud interesting responses... I'm installing in a Nest.js web app which is an MVC wrapper of Express.js web app, which is a library of Node.js so, in essence, I'm installing it in a Node.js web app in a Windows environment... I did not have to provide a user when installing...

Thank you!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 June 2023 21:34 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/5 "2023-06-29T21:34:17Z")

</div>

It just needs to be an absolute path to the directory you want to store Node-RED data in. It can be absolutely anywhere you want.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [29 June 2023 21:37 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/6 "2023-06-29T21:37:13Z")

</div>

> [@ax2382](#):
>
> @jbudd @zenofmud interesting responses... I'm installing in a Nest.js web app which is an MVC wrapper of Express.js web app, which is a library of Node.js so, in essence, I'm installing it in a Node.js web app in a Windows environment.

I don't know what any of that means but it definitely suggests that my response above has no relevance to your question.

---

<div class="post-metadata">

**Author:** ![ax2382](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ax2382/32/81010_2.png) [@ax2382](https://discourse.nodered.org/u/ax2382)\
**Post date:** [29 June 2023 21:38 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/7 "2023-06-29T21:38:08Z")

</div>

@knolleary Ok. Taking the default path value as a reference... and being that node-red created a new folder named **$HOME** in my project root: is **/home/** pointing to **$HOME**?

Currently, node-red installed itself under **$HOME**... therefore I assume my value should be:  
`userDir: '/home/.nodered/'`

---

<div class="post-metadata">

**Author:** ![ax2382](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ax2382/32/81010_2.png) [@ax2382](https://discourse.nodered.org/u/ax2382)\
**Post date:** [29 June 2023 21:39 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/8 "2023-06-29T21:39:02Z")

</div>

😅 thank you anyways!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 August 2023 21:40 UTC](https://discourse.nodered.org/t/userdir-configuration/79491/9 "2023-08-28T21:40:01Z")

</div>

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