Configuration in snaps

Certain snaps, such as those providing a background service, expose configuration options that can be examined and altered.

The commands for viewing and changing these configuration options are snap get and snap set.

For example, to see the configuration options exposed by an installed snap, enter snap get <snap name>:

$ sudo snap get nextcloud
Key        Value
nextcloud  {...}
php        {...}
ports      {...}
private    {...}

The {...} in the above output indicates further options beneath the current key name level.

To explore configuration options, append the key name to the get command:

$ sudo snap get nextcloud ports
Key          Value
ports.http   80
ports.https  443

Use the set command to change a configuration option:

$ sudo snap set nextcloud ports.http=81

The update process will test the validity of the configuration options. If any errors are detected, the overall change is cancelled and the previous configuration reinstated.

Similarly, if the configuration update process takes longer than a reasonable amount of time, currently 5 minutes, the update is forcefully aborted and the once again the configuration is rolled back.

Last updated a month ago. Help improve this document in the forum.