Create a configuration
On this page
Creates a new configuration for a specified app. A configuration defines the settings for a deployment, such as the image to use, environment variables, persistent folders and the ports to expose.
Configs are quite complex objects, so we recommend using the dashboard to create and manage them. However, you can also create and manage them using the CLI.
This command can be used in two ways:
- Interactive mode: Run the command without any flags to be prompted for the required information. Use the
--dry-run
flag to see the JSON payload that would be sent to the API without actually creating the configuration. - Non-interactive mode: Use the
--payload
flag to specify a JSON payload to create the configuration.
Usage
odin fleet configs create
[--payload
=JSON_PAYLOAD
] [--dry-run
]
Examples
Create a new configuration interactively and see the JSON payload that would be sent to the API:
odin fleet configs create --dry-run
This will output the JSON payload that would be sent to the API. You can use this payload to create the configuration
with the --payload
flag:
odin fleet configs create --payload='{"name":"My Config...."}' --force
This is useful for automation of server configuration creation. You can interactively create a configuration or
create a configuration in the dashboard and use the Get command to get the JSON payload using the
--format=json
flag. Then use a tool like jq
to modify the payload and create a new configuration using the
--payload
flag.
Flags
If you want to create a configuration interactively, you can run the command without any flags. The CLI will prompt you for the required information.
--dry-run
:
An optional flag that shows the JSON payload that would be sent to the API without actually creating the configuration. You can use that payload to create the configuration with the--payload
flag.--payload=<string>
:
An optional flag that allows you to specify a JSON payload to create the configuration. This is useful for non-interactive mode and if you want to create a configuration with a specific configuration.
Global Flags
The following flags can be used with any ODIN CLI command:
--api-key=<string>
The API key to use for authentication. If omitted, the CLI will use the api-key stored in the configuration file on your system. Use odin login to store the API key for subsequent commands.--app-id=<string>
The ID of the app to use for the command. If omitted, the CLI will use the currently selected app. Use odin apps select to select an app interactively.--format=<string>
The output format to use for the command. Supported formats arejson
,value
,flattened
andtable
. If omitted, the CLI will use the default format specified in the configuration file. Learn more about output formatting.--force
Forces the command to execute without prompting for confirmation. Use with caution.--quiet
Suppresses all informational output except for errors. Useful for scripting and automation.