> For the complete documentation index, see [llms.txt](https://avbravo-2.gitbook.io/jmoordb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avbravo-2.gitbook.io/jmoordb/capitulo-1/introduccion/mongodb/crear-archivo-mongodb.conf.md).

# Crear archivo mongodb.conf

{% embed url="<http://www.chankok.com/start-mongodb-with-configuration-file/>" %}

En Mongodb crear los directorios

cd /mongodb

mdkdir conf

mdkdir log

![](https://1490144122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6bBVlJX-GjApa1%2F-LclVObcM3QVkGnz__0j%2F-LclX0RXRAvpZ01d62MA%2Fmongod1.png?alt=media\&token=4bf894b0-8a6d-4d47-b605-4f07f17b4008)

Ingresar en el directorio conf y crear el archivo   mongodb.conf

![](https://1490144122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6bBVlJX-GjApa1%2F-LclVObcM3QVkGnz__0j%2F-LclXO2rFeBTRiBrG5w9%2Fconf.png?alt=media\&token=cdf04e2f-4480-4823-999d-4ac72e8697b4)

```java

net:
    # MongoDB server listening port
    port: 27017
storage:
    # Data store directory
    dbPath: "/data/db"
    mmapv1:
        # Reduce data files size and journal files size
        smallFiles: true
systemLog:
    # Write logs to log file
    destination: file
    path: "/home/avbravo/mongodb/log/mongodb.log"
    
security:
    authorization: enabled


```

Ingresar al directorio log y crear el archivo vació mongodb.log

![](https://1490144122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6bBVlJX-GjApa1%2F-LclVObcM3QVkGnz__0j%2F-LclXGTlPPc9GzPq7tUJ%2Flog.png?alt=media\&token=ef02a1f7-7a3f-49d6-8a29-610b8828de4a)

Iniciar mongodb con el archivo de configuracion

```

mongod --config /home/avbravo/mongodb/conf/mongodb.conf
```
