MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

Create another config.js file

  • Hi, so for a project that I’m working on, I want to create multiple config.js files and name them like config1.js, config2.js and etc. But in order to open on of them (so like the config2.js for example) while booting the MagicMirror, I need to change the path or the configuration that defaults it to config.js. Does anyone know how I can do that?

  • @BigMan I would create different scripts, and copy your specific config.js into the config folder as config.js.

  • @sdetweil can you please elaborate more on your response. If you can, with examples too. Thanks!

  • @BigMan create a folder called ~/MagicMirror/myConfigs
    place you config1, config2 … confign…js in there

    MM starts with a script installers/ (or u can create your own)


    lets create in installers

    # copy my config.js into the folder with the required name
    cp ~/MagicMirror/myConfigs/config1.js ~/MagicMirror/config/config.js
    # then call
    exec ~/MagicMirror/installers/

    then after saving, do

    chmod +x

    then whenever u want to run MM with config1

    just do


    u can shorten the commands if u are in the MagicMirror folder at the time…

    create as many run?.sh as u need

    I might save the original config.js in your folder too

  • Project Sponsor Module Developer

    @BigMan Since version 2.1.1 this is natively supported by MagicMirror²

    Enable ability to set configuration file by the environment variable called MM_CONFIG_FILE.

    To test it you can run MM_CONFIG_FILE=YOUR_PATH_TO_CONFIG_FILE npm start in the terminal.

  • @BigMan said in Create another config.js file:

    even easier!
    put all your configs into the config folder
    then just set which on to use

     # set my config 
     export MM_CONFIG_FILE=~/MagicMirror/config/config1.js
     # then call
     exec ~/MagicMirror/installers/

    thanks @strawberry-3-141

Log in to reply