Configuration Options

The functionality and features of CKAN can be modified using many differentconfiguration options. These are generally set in theCKAN configuration file,but some of them can also be set viaEnvironment variables or atruntime.

Note

Looking for the available configuration options? Jump toCKAN configuration file.

Environment variables

Some of the CKAN configuration options can be defined asEnvironment variableson the server operating system.

These are generally low-level critical settings needed when setting up the application, like the databaseconnection, the Solr server URL, etc. Sometimes it can be useful to define them as environment variables toautomate and orchestrate deployments without having to first modify theCKAN configuration file.

These options are only read at startup time to update theconfig object used by CKAN,but they won’t be accessed any more during the lifetime of the application.

CKAN environment variable names match the options in the configuration file, but they are always uppercaseand prefixed withCKAN_ (this prefix is added even ifthe corresponding option in the ini file does not have it), and replacing dots with underscores.

This is the list of currently supported environment variables, please refer to the entries in theCKAN configuration file section below for more details about each one:

CONFIG_FROM_ENV_VARS:dict[str,str]={'sqlalchemy.url':'CKAN_SQLALCHEMY_URL','ckan.datastore.write_url':'CKAN_DATASTORE_WRITE_URL','ckan.datastore.read_url':'CKAN_DATASTORE_READ_URL','ckan.redis.url':'CKAN_REDIS_URL','solr_url':'CKAN_SOLR_URL','solr_user':'CKAN_SOLR_USER','solr_password':'CKAN_SOLR_PASSWORD','ckan.site_id':'CKAN_SITE_ID','ckan.site_url':'CKAN_SITE_URL','ckan.storage_path':'CKAN_STORAGE_PATH','ckan.datapusher.url':'CKAN_DATAPUSHER_URL','smtp.server':'CKAN_SMTP_SERVER','smtp.starttls':'CKAN_SMTP_STARTTLS','smtp.user':'CKAN_SMTP_USER','smtp.password':'CKAN_SMTP_PASSWORD','smtp.mail_from':'CKAN_SMTP_MAIL_FROM','ckan.max_resource_size':'CKAN_MAX_UPLOAD_SIZE_MB'}

Updating configuration options during runtime

CKAN configuration options are generally defined before starting the web application (either in theCKAN configuration file or viaEnvironment variables).

A limited number of configuration options can also be edited during runtime. This can be done on theadministration interface or using theconfig_option_update()API action. Onlysysadmins can edit these runtime-editable configuration options. Changes made to these configuration options will be stored in the database and persisted when the server is restarted.

Extensions can add (or remove) configuration options to the ones that can be edited at runtime. For moredetails on how to do this checkMaking configuration options runtime-editable.

Config declaration

Tracking down all the possible config options in your CKAN site can be achallenging task. CKAN itself and its extensions change over time, deprecatingfeatures and providing new ones, which means that some new config options may beintroduced, while other options no longer have any effect. Inorder to keep track of all valid config options, CKAN uses config declarations.

CKAN itself declares all the config options that are used through thecode base (You can see the core config declarations intheckan/config/config_declaration.yaml file). This allows to validate thecurrent configuration against the declaration, or check which configoptions in the CKAN config file are not declared (and might have no effect).

Declaring config options

Note

Starting from CKAN 2.11, CKAN will log a warning every time a non-declaredconfiguration option is accessed. To prevent this, declare the configuration optionsoffered by your extension using the methods below

Using a text file (JSON, YAML or TOML)

The recommended way of declaring config options is using theconfig_declarationsblanket. It allows you towrite less code and define your config options using JSON, YAML, or TOML (if thetomlpackage is installed inside your virtual environment). That is how CKANdeclares config options for all its built-in plugins, likedatastore ordatatables_view.

To use it, decorate the plugin with theconfig_declarations blanket:

importckan.pluginsaspimportckan.plugins.toolkitastk@tk.blanket.config_declarationsclassMyExt(p.SingletonPlugin):pass

Next, create a fileconfig_declaration.yaml at the root directory of yourextension:ckanext/my_ext/config_declaration.yaml. You can use the.jsonor.toml extension instead of.yaml.

Here is an example of the config declaration file. All the comments are addedonly for explanation and you don’t need them in the real file:

# schema version of the config declaration. At the moment, the only valid value is `1`version:1# an array of configuration blocks. Each block has an "annotation", that# describes the block, and the list of options. These groups help to separate# config options visually, but they have no extra meaning.groups:# short text that describes the group. It can be shown in the config file# as following:#   ## MyExt settings ###################   some.option = some.value#   another.option = another.value-annotation:MyExtsettings# an array of actual declarationsoptions:# The only required item in the declaration is `key`. `key` defines the# name of the config option-key:my_ext.flag.do_something# default value, used when the option is missing from the config file.default:false# import path of the function that must be called in order to get the# default value. This can be used when the default value can be obtained from# an environment variable, database or any other external source.# IMPORTANT: use either `default` or `default_callable`, not both at the same timedefault_callable:ckanext.my_ext.utils:function_that_returns_default# Example of value that can be used for given option. If the config# option is missing from the config file, `placeholder` IS IGNORED. It# has only demonstration purpose. Good uses of `placeholder` are:# examples of secrets, examples of DB connection string.# IMPORTANT: do not use `default` and `placeholder` at the same# time. `placeholder` should be used INSTEAD OF the `default`# whenever you think it has a sense.placeholder:false# import path of the function that must be called in order to get the# placeholder value.  Basically, same as `default_callable`, but it# produces the value of `placeholder`.# IMPORTANT: use either `placeholder` or `placeholder_callable`, not both at the same timeplaceholder_callable:ckanext.my_ext.utils:function_that_returns_placeholder# A dictionary with keyword-arguments that will be passed to# `default_callable` or `placeholder_callable`.  As mentioned above,# only one of these options may be used at the same time, so# `callable_args` can be used by any of these options without a conflict.callable_args:arg_1:20arg_2:"hello"# an alternative example of a valid value for option. Used only in# CKAN documentation, thus has no value for extensions.example:some-valid-value# an explanation of the effect that option has. Don't hesitate to# put as much details here as possibledescription:|Nullameuantevelestconvallisdignissim.Fuscesuscipit,wisinecfacilisisfacilisis,estduifermentumleo,quistemporligulaeratquisodio.Nuncportavulputatetellus.Nuncrutrumturpissedpede.Sedbibendum.Aliquamposuere.Nuncaliquet,auguenecadipiscinginterdum,lacustellusmalesuadamassa,quisvariousmipurusnonodio.Pellentesquecondimentum,magnautsuscipithendrerit,ipsumaugueornarenulla,nonluctusdiamnequesitameturna.Curabiturvulputatevestibulumlorem.Fuscesagittis,liberononmolestiemollis,magnaorciultricesdolor,atvulputatenequenullalaciniaeros.Sedidligulaquisestconvallistempor.Curabiturlaciniapulvinarnibh.Namasapien.# a space-separated list of validators, applied to the value of option.validators:not_missingboolean_validator# shortcut for the most common option types. It adds type validators to the option.# If both, `type` and `validators` are set, validators from `type` are added first,# then validators from `validators` are appended.# Valid types are: bool, int, list, dynamic (see below for more information on dynamic# options)type:bool# boolean flag that marks config option as experimental. Such options are hidden from# examples of configuration or any other auto-generated output. But they are declared,# thus can be validated and do not produce undeclared-warning. Use it for options that# are not stable and may be removed from your extension before the public releaseexperimental:true# boolean flag that marks config option as ignored. Can be used for options that are set# programmatically. This flag means that there is no sense in setting this option, because# it will be overridden or won't be used at all.ignored:true# boolean flag that marks config option as hidden. Used for options that should not be set# inside config file or anyhow used by others. Often this flag is used for options# that are added by Flask core or its extensions.internal:true# boolean flag that marks config option as required. Doesn't have a special effect for now,# but may prevent application from startup in future, so use it only on options that# are essential for your plugin and that have no sensible default value.required:true# boolean flag that marks config option as editable. Doesn't have a special effect for now.# It's recommended to enable this flag for options that are editable via AdminUI.editable:true# boolean flag that marks option as commented. Such options are added# as comments to the config file generated from template.commented:true# Deprecated name of the option. Can be used for options that were renamed.# When `key` is missing from config and `legacy_key` is available, the value of# `legacy_key` is used, printing a deprecation warning in the logs.legacy_key:my_ext.legacy.flag.do_something

TheIConfigDeclaration interface

TheIConfigDeclaration interface isavailable to plugins that want more control on how their own config options are declared.

New config options can only be declared inside thedeclare_config_options() method. Thismethod accepts two arguments: aDeclarationobject that contains all the declarations, and aKeyhelper, which allows to declare more unusual config options.

A very basic config option may be declared in this way:

declaration.declare("ckanext.my_ext.option")

which just means that extensionmy_ext makes use of a config option namedckanext.my_ext.option. If we want to define thedefault value for this optionwe can write:

declaration.declare("ckanext.my_ext.option",True)

The second parameter todeclare() specifies the defaultvalue of the declared option if it is not provided in the configuration file.If a default value is not specified, it’s implicitly set toNone.

You can assign validators to a declared config option:

option=declaration.declare("ckanext.my_ext.option",True)option.set_validators("not_missing boolean_validator")

set_validators accepts a string with the names of validators that must be applied to the config option.These validators need to registered in CKAN core or in your own extension usingtheIValidators interface.

Note

Declared default values are also passed to validators. In addition,different validators can be applied to the same option multipletimes. This means that validators must be idempotent and that thedefault value itself must be valid for the given set of validators.

If you need to declare a lot of options, you can declare all of them at once loading a dict:

declaration.load_dict(DICT_WITH_DECLARATIONS)

This allows to keep the configuration declaration in a separate file to make it easier to maintain ifyour plugin supports several config options.

Note

declaration.load_dict() takes only python dictionary asargument. If you store the declaration in an external file like aJSON, YAML file, you have to parse it into a Python dictionaryyourself or use correspondingblanket. Readthe following section for additional information.

Dynamic config options

There is a special option type,dynamic. This option type is used for a setof options that have common name-pattern. Becausedynamic type definesmultiple options, it has no default, validators and serves mostly documentationpurposes. Let’s use CKAN’ssqlalchemy.* options as example. Every optionwhose name follows the patternsqlalchemy.SOMETHING is passed to theSQLAlchemy engine created by CKAN. CKAN doesn’t actually know which optionsare valid and it’s up to you to provide valid values. Basically, we have a setof options with prefixsqlalchemy.. If use these options without declararing,it will trigger warnings about using undeclared options, which are harmless but can beannoying. Declaring them helps to make explicit which configuration options are actually being used.In order to declare such set of options, put some label surrounded with anglebrackets instead of the dynamic part of option’s name. In our case it can besqlalchemy.<OPTION> orsqlalchemy.<anything>. Any word can be used aslabel, the only important part here are angle brackets:

-key:sqlalchemy.<OPTION>type:dynamicdescription:|Example::sqlalchemy.pool_pre_ping=Truesqlalchemy.pool_size=10sqlalchemy.max_overflow=20Customsqlalchemyconfigparametersusedtoestablishthemaindatabaseconnection.

Use this feature sparsely, only when you really want to declare literally ANYvalue following the pattern. If you have finite set of possible options,consider declaring all of them, because it allows you to provide validators,defaults, and prevents you from accidental shadowing unrelated options.

Accessing config options

Using validators ensures that config values are normalized. Up until now you have probably seencode like this one:

is_enabled=toolkit.asbool(toolkit.config.get("ckanext.my_ext.enable",False))

Declaring this configuration option and assigning validators (convert_int,boolean_validators) and a default value means that we can use theconfig.get(key) instead of the expression above:

is_enabled=toolkit.config.get("ckanext.my_ext.enable")

This will ensure that:

  1. If the value is not explicitly defined in the configuration file, the default one will be picked

  2. This value is passed to the validators, and a valid value is returned

Note

An attempt to useconfig.get() with an undeclared config optionwill print a warning to the logs and return the option value orNone as default.

Command line interface

The current configuration can be validated using theconfig declaration CLI:

ckanconfigvalidate

To get an example of the configuration for a given plugin, runckanconfigdeclaration<PLUGIN>, eg:

ckanconfigdeclarationdatastore## Datastore settings ##########################################################ckan.datastore.write_url=postgresql://ckan_default:pass@localhost/datastore_defaultckan.datastore.read_url=postgresql://datastore_default:pass@localhost/datastore_defaultckan.datastore.sqlsearch.enabled=falseckan.datastore.search.rows_default=100ckan.datastore.search.rows_max=32000# ckan.datastore.sqlalchemy.<OPTION> =## PostgreSQL' full-text search parameters #####################################ckan.datastore.default_fts_lang=englishckan.datastore.default_fts_index_method=gist

To get an example of the declaration code itself in order to use it as a starting point in your own plugin, you canrunckanconfigdescribe<PLUGIN>, eg:

ckanconfigdescribedatapusher# Output:declaration.annotate('Datapusher settings')declaration.declare(key.ckan.datapusher.formats,...)declaration.declare(key.ckan.datapusher.url)declaration.declare(key.ckan.datapusher.callback_url_base)declaration.declare(key.ckan.datapusher.assume_task_stale_after,3600).set_validators('convert_int')

You can output the config declaration in different formats, which is useful if you want to keepthem separately:

ckanconfigdescribedatapusher--format=dict# python dictckanconfigdescribedatapusher--format=json# JSON fileckanconfigdescribedatapusher--format=yaml# YAML fileckanconfigdescribedatapusher--format=toml# TOML file

CKAN configuration file

From CKAN 2.9, by default, the configuration file is located at/etc/ckan/default/ckan.ini. Previous releases the configuration file(s)were:/etc/ckan/default/development.ini or/etc/ckan/default/production.ini. This section documents all of the configfile settings, for reference.

Note

After editing your config file, you need to restart your webserverfor the changes to take effect.

Note

Unless otherwise noted, all configuration options should be set insidethe[app:main] section of the config file (i.e. after the[app:main]line):

[DEFAULT]# This setting will not work, because it's outside of [app:main].ckan.site_logo=/images/masaq.png[app:main]# This setting will work.ckan.plugins=statstext_viewdatatables_view

If the same option is set more than once in your config file, exception willbe raised and CKAN application will not start

Logging settings

The logging settings control how CKAN outputs the log messages to the application logs, e.g.:

ckanrun2025-06-2012:46:01,879INFO[ckan.cli]Usingconfigurationfile/home/adria/dev/projects/ckan-py310/ckan/ckan.ini2025-06-2012:46:01,880INFO[ckan.config.environment]Loadingstaticfilesfrompublic2025-06-2012:46:02,565INFO[ckan.config.environment]Loadingtemplatesfrom/home/adria/dev/projects/ckan-py310/ckan/ckan/templates2025-06-2012:46:02,874INFO[ckan.cli.server]RunningCKANonhttp://localhost:5310

CKAN uses Python’s standardConfiguration file format for the logging sections.You can refer to the Python documentation for all details but essentially there arethree mandatory sections (loggers,handlers andformatters) that contain the keys ofthe actual elements configured. Loggers allow you to define different debugging levels fordifferent modules and libraries. By default CKAN only configures a console handler thatoutputs log message tostderr but you can configure any of theonesincluded in Python.

If you are chaining configuration files usinguse you don’t need to include thelogging configuration in all the ini files contained in the chain. As with any regularconfiguration options base logging settings will take effect unless overridden by a higherlevel ini file.

Default settings

debug

Example:

debug=true

Default value:False

This enables theFlask-DebugToolbar in the web interface, makesWebassets serve unminified JS and CSS files, and enables CKAN templates’debugging features.

You will need to ensure theFlask-DebugToolbar python package is installed,by activating your ckan virtual environment and then running:

pipinstall-r/usr/lib/ckan/default/src/ckan/dev-requirements.txt

If you are running CKAN on Apache, you must change the WSGIconfiguration to run a single process of CKAN. Otherwisethe execution will fail with:AssertionError:TheEvalExceptionmiddlewareisnotusableinamulti-processenvironment. Eg. change:

WSGIDaemonProcessckan_defaultdisplay-name=ckan_defaultprocesses=2threads=15toWSGIDaemonProcessckan_defaultdisplay-name=ckan_defaultthreads=15

Warning

This option should be set toFalse for a public site.With debug mode enabled, a visitor to your site could execute maliciouscommands.

General settings

use

Default value: none

Allows to define chained configuration files. The base ini file should use theegg:ckanvalue. Files extending the base ini files must use theconfig:<pathtoparentinifile> form.For instance, if you need to tweak the test settings in atest-core-custom.ini file, youwould useuse=config:test-core.ini as value. Configuration options defined in the higher levelfiles (e.g.test-core-custom.ini) will override the existing ones defined in the base on(e.g.test-core.ini).

SECRET_KEY

Default value: none

This is the secret token that is used by security related tasks by CKAN and its extensions.ckangenerateconfig generates a uniquevalue for this each time it generates a config file. Alternatively you can generate one withthe following command:

python-c"import secrets; print(secrets.token_urlsafe(20))"

When used in a cluster environment, the value must be the same on every machine.

If not provided, for backwards compatibility with earlier configurations the value ofbeaker.session.secret will be used.

ckan.legacy_route_mappings

Example:

ckan.legacy_route_mappings={"home":"home.index","about":"home.about","search":"dataset.search"}

Default value:{}

This can be used when using an extension that is still using old(Pylons-based) route names to maintain compatibility.

Warning

This configuration will be removed when the migration toFlask is completed. Please update the extension code to use the newFlask-based route names.

config.mode

Example:

config.mode=strict

Default value:strict

Warning

This configuration option has no effect starting from CKAN 2.11. Thedefault behaviour going forward is the oldstrict mode, where CKAN will notstart unlessall config options are valid according to the validators defined in theconfiguration declaration. For every invalid config option, an error will beprinted to the output stream.

Development settings

testing

Default value:False

This flag is enabled during tests and can be used to conditionallyskip operations that are not desired during test execution,e.g. creating a DOI for dataset or notifying public registry aboutnew data available on the portal

ckan.devserver.host

Example:

ckan.devserver.host=0.0.0.0

Default value:localhost

Host name to use when running the development server.

ckan.devserver.port

Example:

ckan.devserver.port=5005

Default value:5000

Port to use when running the development server.

ckan.devserver.threaded

Example:

ckan.devserver.threaded=true

Default value:False

Controls whether the development server should handle each request in a separate thread.

ckan.devserver.multiprocess

Example:

ckan.devserver.multiprocess=8

Default value:1

If greater than 1 then the development server will handle each request in a new process, up to thismaximum number of concurrent processes.

ckan.devserver.watch_patterns

Example:

ckan.devserver.watch_patterns=mytheme/**/*.yamlmytheme/**/*.json

Default value: none

A list of files the reloader should watch to restart the development server, in addition to thePython modules (for example configuration files)

ckan.devserver.ssl_cert

Example:

ckan.devserver.ssl_cert=path/to/host.cert

Default value: none

Path to a certificate file that will be used to enable SSL (ie to serve thelocal development server onhttps://localhost:5000). You can generate aself-signed certificate and key (seeckan.devserver.ssl_key) runningthe following commands:

opensslgenrsa2048>host.keychmod400host.keyopensslreq-new-x509-nodes-sha256-days3650-keyhost.key>host.cert

After that you can run CKAN locally with SSL using this command:

ckan-c/path/to/ckan.inirun--ssl-cert=/path/to/host.cert--ssl-key=/path/to/host.key

Alternatively, setting this option toadhoc will automatically generate a newcertificate file (on each server reload, which means that you’ll get a browser warningabout the certificate on each reload).

ckan.devserver.ssl_key

Example:

ckan.devserver.ssl_key=path/to/host.key

Default value: none

Path to a certificate file that will be used to enable SSL (ie to serve thelocal development server onhttps://localhost:5000). Seeckan.devserver.ssl_certfor more details. This option also supports theadhoc value, with the same caveat.

Session settings

ckan.user.last_active_interval

Default value:600

The number of seconds between requests to record the last time a user was active on the site.

SESSION_TYPE

Default value:cookie

Specifies which type of session interface to use. The defaultcookie value stores the session data inside a JSON-serialized signedcookie. Alternatively, this can be set to any of the typessupported byFlask-Sessionlikeredis,filesystem, etc. Keep in mindthat certain session types require additional Python packages and configuration settings.Setting a not supported value will raise an exception on startup.

SESSION_COOKIE_NAME

Default value:ckan

The name of the session cookie. Can be changed in case you already have a cookie with the same name.

SESSION_KEY_PREFIX

Default value:session:

A prefix that is added before all session keys. This makes itpossible to use the same backend storage server for different apps.

Note

This option affects only server-side sessions. Cookie-based sessions ignore this option

SESSION_COOKIE_DOMAIN

Default value: none

The value of the Domain parameter on the session cookie. If not set,browsers will only send the cookie to the exact domain it was setfrom. Otherwise, they will send it to any subdomain of the givenvalue as well.

SESSION_COOKIE_PATH

Default value: none

The path that the session cookie will be valid for.

SESSION_COOKIE_HTTPONLY

Default value:True

Browsers will not allow JavaScript access to cookies marked as “HTTP only” for security.

SESSION_COOKIE_SECURE

Default value:False

Browsers will only send cookies with requests over HTTPS if thecookie is marked “secure”. The application must be served over HTTPSfor this to make sense.

SESSION_COOKIE_SAMESITE

Default value:Lax

Restrict how cookies are sent with requests from external sites. Canbe set to ‘Lax’ (recommended) or ‘Strict’

SESSION_REFRESH_EACH_REQUEST

Default value:False

Control whether the cookie is sent with every response whenSESSION_PERMANENT is true. Sending the cookie every time can morereliably keep the session from expiring, but uses morebandwidth. Non-permanent sessions are not affected.

SESSION_PERMANENT

Default value:True

When disabled, session expires with the browser session. Whenenabled, session’s expiration time set toPERMANENT_SESSION_LIFETIME seconds.

PERMANENT_SESSION_LIFETIME

Default value:31536000

IfSESSION_PERMANENT is enabled, the session’s expiration will beset this number of seconds in the future. Note that you can not set asession that never expires (only very far into the future).

SESSION_USE_SIGNER

Default value:False

Whether to sign the session cookie sid or not.

Note

This option affects only server-side sessions. Cookie-based sessions ignore this option

Database settings

sqlalchemy.url

Example:

sqlalchemy.url=postgres://tester:pass@localhost/ckantest3

Default value: none

This defines the database that CKAN is to use. The format is:

sqlalchemy.url=postgres://USERNAME:PASSWORD@HOST/DBNAME

sqlalchemy.<OPTION>

Default value: none

Example:

sqlalchemy.pool_pre_ping=Truesqlalchemy.pool_size=10sqlalchemy.max_overflow=20

Custom sqlalchemy config parameters used to establish the maindatabase connection.

To get the list of all the available properties check theSQLAlchemy documentation

Site Settings

ckan.site_url

Example:

ckan.site_url=http://scotdata.ckan.net

Default value: none

Set this to the URL of your CKAN site. Many CKAN features that need an absolute URL to yoursite use this setting.

This setting should only contain the protocol (e.g.http://), host (e.g.www.example.com) and (optionally) the port (e.g.:8080). In particular,if you have mounted CKAN at a path other than/ then the mount point mustnot be included inckan.site_url. Instead, you need to setckan.root_path.

Important

It is mandatory to complete this setting

Warning

This setting should not have a trailing / on the end.

apitoken_header_name

Example:

apitoken_header_name=X-CKAN-API-TOKEN

Default value:Authorization

This allows to customize the name of the HTTP header used to provide the CKAN APItoken. This is useful in some scenarios where using the defaultAuthorization onecauses problems.

ckan.cache_expires

Example:

ckan.cache_expires=2592000

Default value:0

This setsCache-Control header’s max-age value.

ckan.cache_enabled

Example:

ckan.cache_enabled=true

Default value:False

This enables cache control headers on all requests. If the user isnot logged in and there is no session data aCache-Control:public header will be added. For all other requests theCache-control:private header will be added.

ckan.mimetype_guess

Example:

ckan.mimetype_guess=file_contents

Default value:file_ext

There are three options for guessing the mimetype of uploaded or linked resources: file_ext, file_contents, None.

file_ext will guess the mimetype by the url first, then the file extension.

file_contents will guess the mimetype by the file itself, this tends to be inaccurate.

None will not store the mimetype for the resource.

ckan.valid_url_schemes

Example:

ckan.valid_url_schemes=httphttpsftpsftp

Default value:httphttpsftp

Controls what uri schemes are rendered as links.

ckan.requests.timeout

Example:

ckan.requests.timeout=10

Default value:5

Defines how long (in seconds) requests calls should last before they will timeout.

ckan.hide_version

Example:

ckan.hide_version=True

Default value:False

If set to True, CKAN will not publicly expose its version number.

Authorization Settings

ckan.auth.anon_create_dataset

Example:

ckan.auth.anon_create_dataset=false

Default value:False

Allow users to create datasets without registering and logging in.

ckan.auth.create_unowned_dataset

Example:

ckan.auth.create_unowned_dataset=false

Default value:False

Allow the creation of datasets not owned by any organization.

ckan.auth.create_dataset_if_not_in_organization

Example:

ckan.auth.create_dataset_if_not_in_organization=false

Default value:True

Allow users who are not members of any organization to create datasets,default: true.create_unowned_dataset must also be True, otherwisesettingcreate_dataset_if_not_in_organization to True is meaningless.

ckan.auth.user_create_groups

Example:

ckan.auth.user_create_groups=true

Default value:True

Allow users to create groups.

ckan.auth.user_create_organizations

Example:

ckan.auth.user_create_organizations=false

Default value:True

Allow users to create organizations.

ckan.auth.user_delete_groups

Example:

ckan.auth.user_delete_groups=false

Default value:True

Allow users to delete groups.

ckan.auth.user_delete_organizations

Example:

ckan.auth.user_delete_organizations=false

Default value:True

Allow users to delete organizations.

ckan.auth.create_user_via_api

Example:

ckan.auth.create_user_via_api=false

Default value:False

Allow new user accounts to be created via the API by anyone. WhenFalse only sysadmins are authorised.

ckan.auth.create_user_via_web

Example:

ckan.auth.create_user_via_web=true

Default value:False

Allow new user accounts to be created via the web UI. WhenFalse (default value), user accounts can only be created by:
  • Being invited by an organization admin,

  • Being created directly by a sysadmin in the/user/register endpoint, or

  • Being created in the CLI usingckanuseradd

ckan.auth.roles_that_cascade_to_sub_groups

Example:

ckan.auth.roles_that_cascade_to_sub_groups=admineditor

Default value:admin

Makes role permissions apply to all the groups or organizations downthe hierarchy from the groups or organizations that the role isapplied to.e.g. a particular user has the ‘admin’ role for group ‘Department ofHealth’. If you set the value of this option to ‘admin’ then the userwill automatically have the same admin permissions for the childgroups of ‘Department of Health’ such as ‘Cancer Research’ (and itschildren too and so on).

ckan.auth.public_user_details

Example:

ckan.auth.public_user_details=false

Default value:True

Restricts anonymous access to user information. If is set toFalse accessing users details when not logged in will raise aNotAuthorized exception.

Note

This setting should be used when user registration isdisabled (ckan.auth.create_user_via_web=False), otherwiseusers can just create an account to see other users details.

ckan.auth.public_activity_stream_detail

Example:

ckan.auth.public_activity_stream_detail=true

Default value:False

Restricts access to ‘view this version’ and ‘changes’ in the ActivityStream pages. These links provide users with the full edit history ofdatasets etc - what they showed in the past and the diffs betweenversions. If this option is set toFalse then only admins(e.g. whoever can edit the dataset) can see this detail. If set toTrue, anyone can see this detail (assuming they have permissionto view the dataset etc).

ckan.auth.allow_dataset_collaborators

Example:

ckan.auth.allow_dataset_collaborators=true

Default value:False

Enables or disable collaborators in individual datasets. IfTrue,in addition to the standard organization based permissions, users canbe added as collaborators to individual datasets with differentroles, regardless of the organization they belong to. For moreinformation, check the documentation onDataset collaborators.

Warning

If this setting is turned off in a site where therealready were collaborators created, you must reindex all datasetsto update the permission labels, in order to prevent access toprivate datasets to the previous collaborators.

ckan.auth.allow_admin_collaborators

Example:

ckan.auth.allow_admin_collaborators=true

Default value:False

Allows dataset collaborators to have the “Admin” role, allowing themto add more collaborators or remove existing ones. By default,collaborators can only be managed by administrators of theorganization the dataset belongs to. For more information, check thedocumentation onDataset collaborators.

Warning

If this setting is turned off in a site where admincollaborators have been already created, existing collaboratorswith role “admin” will no longer be able to add or removecollaborators, but they will still be able to edit and access thedatasets that they are assigned to.

ckan.auth.allow_collaborators_to_change_owner_org

Example:

ckan.auth.allow_collaborators_to_change_owner_org=true

Default value:False

Allows dataset collaborators to change the owner organization of thedatasets they are collaborators on. Defaults to False, meaning thatcollaborators with role admin or editor can edit the dataset metadatabut not the organization field.

ckan.auth.create_default_api_keys

Example:

ckan.auth.create_default_api_keys=true

Default value:False

Determines if an API key should be automatically created for everyuser when creating a user account. If set to False (the defaultvalue), users can manually create an API token from their profileinstead. SeeAuthentication and API tokens: for more details.

ckan.auth.login_view

Default value:user.login

The name of the view to redirect to when the user needs to log in

ckan.auth.reveal_private_datasets

Default value:False

Determines whether unauthorised requests for private datasets should havethe existence of the datasets revealed (True) or hidden (False).If True, then unauthenticated requests will be redirected to the login page,and redirected back to the dataset after logging in, while authenticatedbut unauthorised requests will receive HTTP 403 Forbidden.If False, all unauthorised requests will receive HTTP 404 Not Found.Default is False.

ckan.auth.enable_cookie_auth_in_api

Default value:True

When set to False, cookie-based authentication is entirely ignored in all API requests,and authentication must be always done usingAPI Tokens. Notethat this will break some existing JS modules from the frontend that perform API calls,so it should be used with caution.

ckan.auth.route_after_login

Default value:dashboard.datasets

Allows to customize the route that the user will get redirected to after a successful login.

CSRF Protection

WTF_CSRF_ENABLED

Default value:True

Set to False to disable all CSRF protection.

WTF_CSRF_CHECK_DEFAULT

Default value:True

When using the CSRF protection extension,this controls whether every view is protected by default.

WTF_CSRF_SECRET_KEY

Default value: none

Random data for generating secure tokens.If not provided, the value ofSECRET_KEY will be used.

WTF_CSRF_METHODS

Default value:POSTPUTPATCHDELETE

HTTP methods to protect from CSRF.

WTF_CSRF_FIELD_NAME

Default value:_csrf_token

Name of the form field and session key that holds the CSRF token.

WTF_CSRF_HEADERS

Default value:X-CSRFTokenX-CSRF-Token

HTTP headers to search for CSRF token when it is not provided in the form.

WTF_CSRF_TIME_LIMIT

Default value:31536000

Max age in seconds for CSRF tokens.This value is capped by the lifetime of the session.

WTF_CSRF_SSL_STRICT

Default value:True

Whether to enforce the same origin policy by checking that the referrer matches the host.Only applies to HTTPS requests. Default is True.

WTF_I18N_ENABLED

Default value:True

Set to False to disable Flask-Babel I18N support.Also set to False if you want to use WTForms’s built-in messages directly, see more info here.

Flask-Login Remember me cookie settings

REMEMBER_COOKIE_NAME

Default value:remember_token

The name of the cookie to store the “remember me” information in.

REMEMBER_COOKIE_DURATION

Default value:31536000

The amount of time before the cookie expires, as a datetime.timedelta object or integer seconds.

REMEMBER_COOKIE_DOMAIN

Default value: none

If the “Remember Me” cookie should cross domains, set the domain value here(i.e. .example.com would allow the cookie to be used on all subdomains of example.com).

REMEMBER_COOKIE_PATH

Default value:/

Limits the “Remember Me” cookie to a certain path.

REMEMBER_COOKIE_SECURE

Default value:False

Restricts the “Remember Me” cookie’s scope to secure channels (typically HTTPS).

REMEMBER_COOKIE_HTTPONLY

Default value:True

Prevents the “Remember Me” cookie from being accessed by client-side scripts.

REMEMBER_COOKIE_REFRESH_EACH_REQUEST

Default value:False

If set to True the cookie is refreshed on every request, which bumps the lifetime.Works like Flask’s SESSION_REFRESH_EACH_REQUEST.

REMEMBER_COOKIE_SAMESITE

Default value:None

Restricts the “Remember Me” cookie to first-party or same-site context.

API Token Settings

api_token.nbytes

Example:

api_token.nbytes=20

Default value:32

Number of bytes used to generate unique id for API Token.

api_token.jwt.encode.secret

Example:

api_token.jwt.encode.secret=file:/path/to/private/key

Default value: none

A key suitable for the chosen algorithm(api_token.jwt.algorithm):

  • for asymmetric algorithms(RS256): path to private key withfile: prefix. I.efile:/path/private/key

  • for symmetric algorithms(HS256): plain string, sufficiently long for security withstring: prefix. I.estring:123abc...

Note

For symmetric algorithms this value must be identical toapi_token.jwt.decode.secret. The algorithm used is controlledby theapi_token.jwt.algorithm option.

Value must have prefix, which defines its type. Supported prefixes are:

  • string: - Plain string, will be used as is.

  • file: - Path to file. Content of the file will be used as key.

If not provided,"string:"+SECRET_KEY is used.

api_token.jwt.decode.secret

Example:

api_token.jwt.decode.secret=file:/path/to/public/key.pub

Default value: none

A key suitable for the chosen algorithm(api_token.jwt.algorithm):

  • for asymmetric algorithms(RS256): path to public key withfile: prefix. I.efile:/path/public/key.pub

  • for symmetric algorithms(HS256): plain string, sufficiently long for security withstring: prefix. I.estring:123abc...

Note

For symmetric algorithms this value must be identical toapi_token.jwt.encode.secret. The algorithm used is definedby theapi_token.jwt.algorithm option.

Value must have prefix, which defines it’s type. Supported prefixes are:

  • string: - Plain string, will be used as is.

  • file: - Path to file. Content of the file will be used as key.

If not provided,"string:"+SECRET_KEY is used.

api_token.jwt.algorithm

Example:

api_token.jwt.algorithm=RS256

Default value:HS256

Algorithm to sign the token with, e.g. “ES256”, “RS256”

Depending on the algorithm, additional restrictions may apply toapi_token.jwt.decode.secret andapi_token.jwt.encode.secret. For example, RS256 implies thatapi_token.jwt.encode.secret contains RSA private key andapi_token.jwt.decode.secret contains public key. WhereasHS256(default value) requires bothapi_token.jwt.decode.secretandapi_token.jwt.encode.secret to have exactly the samevalue.

Search Settings

ckan.site_id

Example:

ckan.site_id=my_ckan_instance

Default value:default

CKAN uses Solr to index and search packages. The search index islinked to the value of theckan.site_id, so if you have more thanone CKAN instance using the samesolr_url, they will each have aseparate search index as long as theirckan.site_id values aredifferent. If you are only running a single CKAN instance then thiscan be ignored.

Note

If you change this value, you need to rebuild the search index.

solr_url

Example:

solr_url=http://solr.okfn.org:8983/solr/ckan-schema-2.0

Default value: none

This configures the Solr server used for search. The Solr schemafound at that URL must be one of the ones inckan/config/solr(generally the most recent one). A check of the schema version numberoccurs when CKAN starts.

Optionally,solr_user andsolr_password can also beconfigured to specify HTTP Basic authentication details for all Solrrequests.

Note

If you change this value, you need to rebuild the search index.

solr_user

Default value: none

User to use in HTTP Basic Authentication when connecting to Solr

solr_password

Default value: none

Password to use in HTTP Basic Authentication when connecting to Solr

ckan.search.remove_deleted_packages

Default value:True

By default, deleted datasets are removed from the search index so are nolonger available in searches. To keep them in the search index, set thissetting toFalse. This will enable theinclude_deletedparameter in theckan.logic.action.get.package_search()API action.

ckan.search.solr_commit

Default value:True

Make ckan commit changes solr after every dataset update change. Turnthis to false if on solr 4.0 and you have automatic (soft)commitsenabled to improve dataset update/create speed (however there may bea slight delay before dataset gets seen in results).

ckan.search.solr_allowed_query_parsers

Example:

ckan.search.solr_allowed_query_parsers=['bool','knn']

Default value: none

Local parameters are not allowed when passing queries to Solr. An exception to this is when passing local parameters for special query parsers, that need to be enabled explicitly using this config option. For instance, the example provided would allow sending queries like the following::

search_params[“q”] = “{!bool must=test}…”search_params[“q”] = “{!knn field=vector topK=10}…”

ckan.search.show_all_types

Example:

ckan.search.show_all_types=dataset

Default value:dataset

Controls whether a search page (e.g./dataset) should also showcustom dataset types. The default isfalse meaning that no searchpage for any type will show other types.true will show other typeson the/dataset search page. Any other value (e.g.dataset ordocument will be treated as a dataset type and that type’s searchpage will show datasets of all types.

ckan.search.default_include_private

Default value:True

Controls whether the default search page (/dataset) should includeprivate datasets visible to the current user or only public datasetsvisible to everyone.

ckan.search.default_package_sort

Example:

ckan.search.default_package_sort=nameasc

Default value:scoredesc,metadata_modifieddesc

Controls whether the default search page (/dataset) should different sorting parameter by default when the request does not specify sort.

search.facets.limit

Example:

search.facets.limit=100

Default value:50

Sets the default number of searched facets returned in a query.

search.facets.default

Example:

search.facets.default=10

Default value:10

Default number of facets shown in search results.

ckan.extra_resource_fields

Example:

ckan.extra_resource_fields=alt_url

Default value: none

List of the extra resource fields that would be used when searching.

ckan.search.rows_max

Example:

ckan.search.rows_max=1000

Default value:1000

Maximum allowed value for rows returned. Specifically this limits:

  • package_search’srows parameter

  • group_show andorganization_show’s number of datasets returned when specifyinginclude_datasets=true

ckan.group_and_organization_list_max

Example:

ckan.group_and_organization_list_max=1000

Default value:1000

Maximum number of groups/organizations returned when listing them. Specifically this limits:

  • group_list’slimit whenall_fields=false

  • organization_list’slimit whenall_fields=false

ckan.group_and_organization_list_all_fields_max

Example:

ckan.group_and_organization_list_all_fields_max=100

Default value:25

Maximum number of groups/organizations returned when listing them in detail. Specifically this limits:

  • group_list’slimit whenall_fields=true

  • organization_list’slimit whenall_fields=true

solr_timeout

Example:

solr_timeout=120

Default value:60

The option defines the timeout in seconds until giving up on arequest. Raising this value might help you if you encounter a timeoutexception.

Redis Settings

ckan.redis.url

Example:

ckan.redis.url=redis://localhost:7000/1

Default value:redis://localhost:6379/0

URL to your Redis instance, including the database to be used.

CORS Settings

ckan.cors.origin_allow_all

Example:

ckan.cors.origin_allow_all=true

Default value:False

This setting must be present to enable CORS. If True, all originswill be allowed (the response header Access-Control-Allow-Origin isset to ‘*’). If False, only origins from theckan.cors.origin_whitelist setting will be allowed.

ckan.cors.origin_whitelist

Example:

ckan.cors.origin_whitelist=http://www.myremotedomain1.comhttp://myremotedomain1.com

Default value: none

A space separated list of allowable origins. This setting is used whenckan.cors.origin_allow_all=False.

Plugins Settings

ckan.plugins

Example:

ckan.plugins=activityscheming_datasetsdatatables_viewdatastorexloader

Default value: none

Specify which CKAN plugins are to be enabled.

Warning

If you specify a plugin but have not installed the code, CKAN will not start.

Format as a space-separated list of the plugin names. The plugin nameis the key in the[ckan.plugins] section of the extension’ssetup.py. For more information on plugins and extensions, seeExtending guide.

Note

The order of the plugin names in the configuration file influences theorder that CKAN will load the plugins in. As long as each plugin class isimplemented in a separate Python module (i.e. in a separate Python sourcecode file), the plugins will be loaded in the order given in theconfiguration file.

When multiple plugins are implemented in the same Python module, CKAN willprocess the plugins in the order that they’re given in the config file, but assoon as it reaches one plugin from a given Python module, CKAN will load allplugins from that Python module, in the order that the plugin classes aredefined in the module.

For simplicity, we recommend implementing each plugin class in its own Pythonmodule.

Plugin loading order can be important, for example for plugins that add customtemplate files: templates found in template directories added earlier willoverride templates in template directories added later.

Todo

Fix CKAN’s plugin loading order to simply load all plugins in the orderthey’re given in the config file, regardless of which Python modulesthey’re implemented in.

ckan.download_proxy

Example:

ckan.download_proxy=http://proxy:3128

Default value: none

Specifies a HTTP proxy to be used by extensions such as Resource Proxy, XLoader or Archiverwhen downloading remote files. This may be useful for enabling access torestricted network locations, or restricting access to privileged ones, egpreventingServer Side Request Forgery.It will not be used by CKAN core.

Front-End Settings

ckan.site_title

Example:

ckan.site_title=OpenDataScotland

Default value:CKAN

This sets the name of the site, as displayed in the CKAN web interface.

ckan.site_description

Example:

ckan.site_description=Theeasywaytoget,useandsharedata

Default value: none

This is for a description, or tag line for the site, as displayed in the header of the CKAN web interface.

ckan.site_intro_text

Example:

ckan.site_intro_text=NiceintroductoryparagraphaboutCKANorthesiteingeneral.

Default value: none

This is for an introductory text used in the default template’s index page.

ckan.site_logo

Example:

ckan.site_logo=/images/ckan_logo_fullname_long.png

Default value:/base/images/ckan-logo.png

This sets the logo used in the title bar.

ckan.site_about

Example:

ckan.site_about=A_community-driven_catalogueof_opendata_fortheGreenfieldarea.

Default value: none

Format tips:

  • multiline strings can be used by indenting following lines

  • the format is Markdown

Note

Whilst the default text is translated into many languages(switchable in the page footer), the text in this configurationoption will not be translatable. For this reason, it’s better tooverload the snippet inhome/snippets/about_text.html. For moreinformation, seeTheming guide.

ckan.theme

Example:

ckan.theme=my-extension/theme-asset

Default value:css/main

With this option, instead of using the defaultcss/main asset with the theme, you can use your own.

ckan.favicon

Example:

ckan.favicon=http://okfn.org/wp-content/themes/okfn-master-wordpress-theme/images/favicon.ico

Default value:/base/images/ckan.ico

This sets the site’sfavicon. This icon is usually displayed by the browser in the tab heading and bookmark.

ckan.datasets_per_page

Example:

ckan.datasets_per_page=10

Default value:20

This controls the pagination of the dataset search results page. This is the maximum number of datasets viewed per page of results.

package_hide_extras

Example:

package_hide_extras=my_private_fieldother_field

Default value: none

This sets a space-separated list of extra field key values which will not be shown on the dataset read page.

Warning

While this is useful to e.g. create internal notes, itis not a security measure. The keys will still be available via theAPI and in revision diffs.

ckan.recaptcha.publickey

Default value: none

The public key for your reCAPTCHA account, for example:

ckan.recaptcha.publickey=6Lc...-KLc

To get a reCAPTCHA account, sign up at:http://www.google.com/recaptcha

ckan.recaptcha.privatekey

Default value: none

The private key for your reCAPTCHA account, for example:

ckan.recaptcha.privatekey=6Lc...-jP

Setting bothckan.recaptcha.publickey andckan.recaptcha.privatekey adds captcha to the user registration form.This has been effective at preventing bots registering users and creating spampackages.

ckan.featured_groups

Example:

ckan.featured_groups=group_one

Default value: none

Defines a list of group names or group ids. This setting is used to display agroup and datasets on the home page in the default templates (1 group and 2datasets are displayed).

ckan.featured_orgs

Example:

ckan.featured_orgs=org_one

Default value: none

Defines a list of organization names or ids. This setting is used to displayan organization and datasets on the home page in the default templates (1group and 2 datasets are displayed).

ckan.default_group_sort

Example:

ckan.default_group_sort=name

Default value:title

Defines if some other sorting is used in group_list and organization_listby default when the request does not specify sort.

ckan.gravatar_default

Example:

ckan.gravatar_default=disabled

Default value:identicon

This controls the default gravatar style. Gravatar is used by default when a user has not set a custom profile picture,but it can be turn completely off by setting this option to “disabled”. In that case, a placeholder image will be showninstead, which can be customized overriding thetemplates/user/snippets/placeholder.html template.

ckan.debug_supress_header

Example:

ckan.debug_supress_header=false

Default value:False

This configs if the debug information showing the controller and actionreceiving the request being is shown in the header.

Note

This info only shows if debug is set to True.

ckan.site_custom_css

Default value: none

Custom CSS directives to include on all CKAN pages.

ckan.default_collapse_facets

Default value:False

This controls the default view of the facet accordions, i.e. whether the accordions are expanded or collapsedby default.

Resource Views Settings

ckan.views.default_views

Example:

ckan.views.default_views=image_viewwebpage_viewdatatables_view

Default value:image_viewdatatables_view

Defines the resource views that should be created by default when creating orupdating a dataset. From this list only the views that are relevant to a particularresource format will be created. This is determined by each individual view.

If not present (or commented), the default value is used. If left empty, nodefault views are created.

Note

You must have the relevant view plugins loaded on theckan.plugins setting to be able to create the default views, eg::ckan.plugins = image_view webpage_view geo_view datatables_view …ckan.views.default_views = image_view webpage_view datatables_view

Theming Settings

ckan.template_title_delimiter

Example:

ckan.template_title_delimiter=|

Default value:-

This sets the delimiter between the site’s subtitle (if there’s one) and its title, in HTML’s<title>.

extra_template_paths

Example:

extra_template_paths=/home/okfn/brazil_ckan_config/templates

Default value: none

Use this option to specify where CKAN should look for additionaltemplates, before reverting to theckan/templates folder. You cansupply more than one folder, separating the paths with a comma (,).

For more information on theming, seeTheming guide.

extra_public_paths

Example:

extra_public_paths=/home/okfn/brazil_ckan_config/public

Default value: none

To customise the display of CKAN you can supply replacements forstatic files such as HTML, CSS, script and PNG files. Use this optionto specify where CKAN should look for additional files, beforereverting to theckan/public folder. You can supply more than onefolder, separating the paths with a comma (,).

For more information on theming, seeTheming guide.

ckan.base_public_folder

Example:

ckan.base_public_folder=public

Default value:public

This config option is used to configure the base folder for static files usedby CKAN core. Starting CKAN 2.11 it only accepts:public as a value.(This variable is kept for backwards compatibility when updating Bootstrapversions.)

ckan.base_templates_folder

Example:

ckan.base_templates_folder=templates

Default value:templates

This config option is used to configure the base folder for templates usedby CKAN core. Starting CKAN 2.11 it only accepts:templates as a value.(This variable is kept for backwards compatibility when updating Bootstrapversions.)

ckan.default.package_type

Default value:dataset

Default type of dataset that will be used in the UI links (eg. “New Dataset”).

Use this option to change the dataset type that is used site-wide. Only existing datasettypes can be used as a value for this option. Upon setting a custom value, the followinghappens:

  • all new datasets have theirtype field set to the custom value(if no explicit value provided)

  • all labels(e.g. “Create a Dataset”, “My datasets”, “Search datasets..”) are adapted to the custom value

  • all default links(e.g./dataset/new,/dataset/<name>/resource) are adapted to the custom value

If labels require additional changes, register a chained helpers forhumanize_entity_type().For example, setting a dataset typecamel_photo as default, will turn the “Datasets” link in the header into“Camel-photos”. If “Camel Photos” is expected, the code below can be used:

@p.toolkit.chained_helperdefhumanize_entity_type(next_helper:Callable[...,Any],entity_type:str,object_type:str,purpose:str):ifpurpose=="main nav":return"Camel Photos"returnnext_helper(entity_type,object_type,purpose)

Seehumanize_entity_type() for additional details.

ckan.default.group_type

Default value:group

Default type of group that used in UI links(eg. “New Group” button, “Groups” link in header)

Same asckan.default.package_type, but for groups.

ckan.default.organization_type

Default value:organization

Default type of group that used in UI links(eg. “New Organization” button, “Organizations” link in header)

Same asckan.default.package_type, but for organizations.

Storage Settings

ckan.uploads_enabled

Default value: none

Defines file uploads are enabled or not.

If enabled also setckan.storage_path if you want to use internal storage.

ckan.storage_path

Example:

ckan.storage_path=/var/lib/ckan/default

Default value: none

This defines the location of where CKAN will store all uploaded data.

If set to some directory, also setckan.uploads_enabled to true to enable uploads in the UI.

ckan.max_resource_size

Example:

ckan.max_resource_size=100

Default value:10

The maximum in megabytes a resources upload can be.

ckan.max_image_size

Example:

ckan.max_image_size=10

Default value:2

The maximum in megabytes an image upload can be.

Uploader Settings

ckan.upload.user.types

Example:

ckan.upload.user.types=imagetext

Default value:image

File types allowed to upload as user’s avatar. If empty andckan.upload.user.mimetypes is also empty, no uploads are allowed. To allow any kind of file upload, use the* string in both options (this is dangerous andnot recommended). Note also thattext/svg can contain embedded javascript code so it only should be used in trusted environments.

ckan.upload.user.mimetypes

Example:

ckan.upload.user.mimetypes=image/png

Default value:image/pngimage/gifimage/jpeg

File MIMETypes allowed to upload as user’s avatar. If empty andckan.upload.user.types is also empty, no uploads are allowed. To allow any kind of file upload, use the* string in both options (this is dangerous andnot recommended).

ckan.upload.group.types

Example:

ckan.upload.group.types=imagetext

Default value:image

File types allowed to upload as group or organization image. If empty andckan.upload.group.mimetypes is also empty, no uploads are allowed. To allow any kind of file upload, use the* string in both options (this is dangerous andnot recommended).

ckan.upload.group.mimetypes

Example:

ckan.upload.group.mimetypes=image/png

Default value:image/pngimage/gifimage/jpeg

File MIMEtypes allowed to upload as group or organization image. If empty andckan.upload.group.types is also empty, no uploads are allowed. To allow any kind of file upload, use the* string in both options (this is dangerous andnot recommended). Note also thattext/svg can contain embedded javascript code so it only should be used in trusted environments.

Webassets Settings

ckan.webassets.path

Example:

ckan.webassets.path=/var/lib/ckan/webassets

Default value: none

In order to increase performance, static assets (CSS and JS files) included via anasset tag inside templates are compiled only once,when the asset is used for the first time. All subsequent requests to theasset will use the existing file. CKAN stores the compiled webassets in the file system, in the path specified by this config option.

ckan.webassets.url

Example:

ckan.webassets.url=/serve/assets/from/here

Default value:/webassets

URL path for endpoint that serves webassets.

ckan.webassets.use_x_sendfile

Example:

ckan.webassets.use_x_sendfile=True

Default value:False

When serving static files, if this setting isTrue, the application will set theX-Sendfile header instead ofserving the files directly with Flask. This will increase performance when serving the assets, but itrequires that the web server (eg Nginx) supports theX-Sendfile header. SeeX-Sendfile for more information.

User Settings

ckan.user_list_limit

Example:

ckan.user_list_limit=50

Default value:20

This controls the number of users to show in the Users list. By default, it shows 20 users.

ckan.user_reset_landing_page

Example:

ckan.user_reset_landing_page=dataset

Default value:home.index

This controls the page where users will be sent after requesting a password reset.This is ordinarily the home page, but specific sites may prefer somewhere else.

ckan.user.unique_email_states

Example:

ckan.user.unique_email_states=['pending','active']

Default value:active

When a new user created, uniqueness of its email is checked amongusers with specified statuses.

Usingactive is appropriate if users are created on portal onlythrough original user registration form and always have activestatus. When user is deleted, his email can be reused by a newaccount.

Usingpending active is suitable for workflows with user approvalor invitations. In such scenario, user is created withpendingstatus initially and activated at some point in future.

Addingdeleted to this option makes sense if email of removed usersmust not be reused. In other words, when user is deleted, he is notable to create a new account with the same email and is virtuallyblocked on the portal.

Activity Streams Settings

ckan.activity_streams_enabled

Example:

ckan.activity_streams_enabled=false

Default value:True

Turns on and off the activity streams used to track changes on datasets, groups, users, etc. The activity feature has been moved to a separate activity plugin. To keep showing the activities in the UI and enable the activity related API actions you need to add the activity plugin to the ckan.plugins config option.

ckan.activity_streams_email_notifications

Example:

ckan.activity_streams_email_notifications=false

Default value:False

Turns on and off the activity streams’ email notifications. You’d also need to setup a cron job to sendthe emails. For more information, visitEmail notifications.

ckan.activity_list_limit

Example:

ckan.activity_list_limit=31

Default value:31

This controls the number of activities to show in the Activity Stream.

ckan.activity_list_limit_max

Example:

ckan.activity_list_limit_max=100

Default value:100

Maximum allowed value for Activity Streamlimit parameter.

ckan.email_notifications_since

Example:

ckan.email_notifications_since=2days

Default value:2days

Email notifications for events older than this time delta will not be sent.Accepted formats: ‘2 days’, ‘14 days’, ‘4:35:00’ (hours, minutes, seconds), ‘7 days, 3:23:34’, etc.

ckan.hide_activity_from_users

Example:

ckan.hide_activity_from_users=sysadmin

Default value: none

Hides activity from the specified users from activity stream. If unspecified,it’ll useckan.site_id to hide activity by the site user. The site useris a sysadmin user on every ckan user with a username that’s equal tockan.site_id. This user is used by ckan for performing actions from thecommand-line.

Feeds Settings

ckan.feeds.author_name

Example:

ckan.feeds.author_name=MichaelJackson

Default value: none

This controls the feed author’s name. If unspecified, it’ll useckan.site_id.

ckan.feeds.author_link

Example:

ckan.feeds.author_link=http://okfn.org

Default value: none

This controls the feed author’s link. If unspecified, it’ll useckan.site_url.

ckan.feeds.authority_name

Example:

ckan.feeds.authority_name=http://okfn.org

Default value: none

The domain name or email address of the default publisher of the feeds and elements. If unspecified, it’ll useckan.site_url.

ckan.feeds.date

Example:

ckan.feeds.date=2012-03-22

Default value: none

A string representing the default date on which the authority_name is owned by the publisher of the feed.

ckan.feeds.limit

Default value:20

Number of items returned in the feeds

Internationalisation Settings

ckan.locale_default

Example:

ckan.locale_default=de

Default value:en

Use this to specify the locale (language of the text) displayed inthe CKAN Web UI. This requires a suitablemo file installed for thelocale in the ckan/i18n. For more information oninternationalization, seeTranslating CKAN. If you don’tspecify a default locale, then it will default to the first localeoffered, which is by default English (alter that withckan.locales_offered andckan.locales_filtered_out.

ckan.locales_offered

Example:

ckan.locales_offered=endefr

Default value: none

By default, all locales found in theckan/i18n directory will beoffered to the user. To only offer a subset of these, list them underthis option. The ordering of the locales is preserved when offered tothe user.

ckan.locales_filtered_out

Example:

ckan.locales_filtered_out=plru

Default value: none

If you want to not offer particular locales to the user, then list them here to have them removed from the options.

ckan.locale_order

Example:

ckan.locale_order=frde

Default value: none

If you want to specify the ordering of all or some of the locales asthey are offered to the user, then specify them here in the requiredorder. Any locales that are available but not specified in thisoption, will still be offered at the end of the list.

ckan.i18n_directory

Example:

ckan.i18n_directory=/opt/locales/i18n/

Default value: none

By default, the locales are searched for in theckan/i18n directory. Use this option if you want to use another folder.

ckan.i18n.extra_directory

Example:

ckan.i18n.extra_directory=/opt/ckan/extra_translations/

Default value: none

If you wish to add extra translation strings and have them merged with thedefault ckan translations at runtime you can specify the location of the extratranslations using this option.

ckan.i18n.extra_gettext_domain

Example:

ckan.i18n.extra_gettext_domain=mydomain

Default value: none

You can specify the name of the gettext domain of the extra translations. Forexample if your translations are stored asi18n/<locale>/LC_MESSAGES/somedomain.mo you would want to set this optiontosomedomain

ckan.i18n.extra_locales

Example:

ckan.i18n.extra_locales=fresde

Default value: none

If you have set an extra i18n directory usingckan.i18n.extra_directory, youshould specify the locales that have been translated in that directory in thisoption.

ckan.i18n.rtl_languages

Example:

ckan.i18n.rtl_languages=hearfa_IR

Default value:hearfa_IR

Allows to modify the right-to-left languages

ckan.i18n.rtl_theme

Example:

ckan.i18n.rtl_theme=my-extension/my-custom-rtl-asset

Default value:css/main-rtl

Allows to override the default rtl asset used for the languages definedinckan.i18n.rtl_languages.

ckan.display_timezone

Example:

ckan.display_timezone=Europe/Zurich

Default value:UTC

By default, all datetimes are considered to be in the UTCtimezone. Use this option to change the displayed dates on thefrontend. Internally, the dates are always saved as UTC. This optiononly changes the way the dates are displayed.

The valid values for this options [can be found atpytz](http://pytz.sourceforge.net/#helpers)(pytz.all_timezones). You can specify the special valueserverto use the timezone settings of the server, that is running CKAN.

ckan.root_path

Example:

ckan.root_path=/my/custom/path/{{LANG}}/foo

Default value: none

This setting is used to construct URLs inside CKAN. It specifies two things:

  • At which path CKAN is mounted: By default it is assumed that CKAN is mountedat/, i.e. at the root of your web server. If you have configured yourweb server to serve CKAN from a different mount point then you need toduplicate that setting here.

  • Where the locale is added to an URL: By default, URLs are formatted as/some/url when using the default locale, or/de/some/url when usingthede locale, for example. Whenckan.root_path is set it mustinclude the string{{LANG}}, which will be replaced by the locale.

Important

The setting must contain{{LANG}} exactly as written here. Do not addspaces between the brackets.

See also

The host of your CKAN installation can be set viackan.site_url.

ckan.resource_formats

Example:

ckan.resource_formats=/path/to/resource_formats

Default value:/<CKAN_ROOT>/ckan/config/resource_formats.json

The purpose of this file is to supply a thorough list of resource formatsand to make sure the formats are normalized when saved to the databaseand presented.

The format of the file is a JSON object with following format:

["Format","Description","Mimetype",["List of alternative representations"]]

Please look in ckan/config/resource_formats.json for full details and and as anexample.

Form Settings

ckan.dataset.create_on_ui_requires_resources

Example:

ckan.dataset.create_on_ui_requires_resources=false

Default value:True

If False, there is no need to add any resources when creating a new dataset.

package_new_return_url

Default value: none

The URL to redirect the user to after they’ve submitted a new package form,example:

package_new_return_url = http://datadotgc.ca/new_dataset_complete?name=<NAME>

This is useful for integrating CKAN’s new dataset form into a third-partyinterface, seeForm Integration.

The<NAME> string is replaced with the name of the dataset created.

package_edit_return_url

Default value: none

The URL to redirect the user to after they’ve submitted an edit package form,example:

package_edit_return_url=http://datadotgc.ca/dataset/<NAME>

This is useful for integrating CKAN’s edit dataset form into a third-partyinterface, seeForm Integration.

The<NAME> string is replaced with the name of the dataset that was edited.

licenses_group_url

Example:

licenses_group_url=file:///path/to/my/local/json-list-of-licenses.json

Default value: none

A url pointing to a JSON file containing a list of license objects. This listdetermines the licenses offered by the system to users, for example whencreating or editing a dataset.

This is entirely optional - by default, the system will use an internal cachedversion of the CKAN list of licenses available from thehttp://licenses.opendefinition.org/licenses/groups/ckan.json.

More details about the license objects - including the license format and someexample license lists - can be found at theOpen Licenses Service.

Email settings

smtp.server

Example:

smtp.server=smtp.example.com:587

Default value:localhost

The SMTP server to connect to when sending emails with optional port.

smtp.starttls

Example:

smtp.starttls=true

Default value:False

Whether or not to use STARTTLS when connecting to the SMTP server.

smtp.user

Example:

smtp.user=username@example.com

Default value: none

The username used to authenticate with the SMTP server.

smtp.password

Example:

smtp.password=yourpass

Default value: none

The password used to authenticate with the SMTP server.

smtp.mail_from

Example:

smtp.mail_from=ckan@example.com

Default value: none

The email address that emails sent by CKAN will come from. Note that, if left blank, the SMTP server may insert its own.

smtp.reply_to

Example:

smtp.reply_to=noreply.example.com

Default value: none

The email address that will be used if someone attempts to reply to a system email.If left blank, noReply-to will be added to the email and the value ofsmtp.mail_from will be used.

email_to

Example:

email_to=errors@example.com

Default value: none

This controls where the error messages will be sent to.

error_email_from

Example:

error_email_from=ckan-errors@example.com

Default value: none

This controls from which email the error messages will come from.

Background Job Settings

ckan.jobs.timeout

Default value:180

The option defines the timeout in seconds until giving up on a job

Resource Proxy settings

ckan.resource_proxy.max_file_size

Example:

ckan.resource_proxy.max_file_size=1048576

Default value:1048576

This sets the upper file size limit for in-line previews. Increasing the value allows CKAN to preview larger files (e.g. PDFs) in-line; however, a higher value might cause time-outs, or unresponsive browsers for CKAN users with lower bandwidth.

ckan.resource_proxy.chunk_size

Example:

ckan.resource_proxy.chunk_size=8192

Default value:4096

This sets size of the chunk to read and write when proxying. Raising this value might save some CPU cycles. It makes no sense to lower it below the page size, which is default.

ckan.resource_proxy.timeout

Default value:5

Timeout in seconds to use on Resource Proxy requests.

text_view settings

ckan.preview.text_formats

Example:

ckan.preview.text_formats=txtplain

Default value:text/plaintxtplain

Space-delimited list of plain text based resource formats that will be rendered by the Text view plugin

ckan.preview.xml_formats

Example:

ckan.preview.xml_formats=xmlrdfrss

Default value:xmlrdfrdf+xmlowl+xmlatomrss

Space-delimited list of XML based resource formats that will be rendered by the Text view plugin

ckan.preview.json_formats

Example:

ckan.preview.json_formats=json

Default value:json

Space-delimited list of JSON based resource formats that will be rendered by the Text view plugin

ckan.preview.jsonp_formats

Default value:jsonp

Space-delimited list of JSONP based resource formats that will be rendered by the Text view plugin

image_view settings

ckan.preview.image_formats

Example:

ckan.preview.image_formats=pngjpegjpggif

Default value:pngjpegjpggif

Space-delimited list of image-based resource formats that will be rendered by the Image view plugin

datatables_view settings

ckan.datatables.page_length_choices

Example:

ckan.datatables.page_length_choices=205010050010005000

Default value:20501005001000

Space-delimited list of the choices for the number of rows per page, withthe lowest value being the default initial value.

Note

On larger screens, DataTables view will attempt to fill thetable with as many rows that can fit using the lowest closest choice.

ckan.datatables.state_saving

Example:

ckan.datatables.state_saving=false

Default value:True

Enable or disable state saving. When enabled, DataTables view will storestate information such as pagination position, page length, rowselection/s, column visibility/ordering, filtering and sorting using thebrowser’s localStorage. When the end user reloads the page, the table’sstate will be altered to match what they had previously set up.

This also enables/disables the “Reset” and “Share current view”buttons. “Reset” discards the saved state. “Share current view” base-64encodes the state and passes it as a url parameter, acting like a “savedsearch” that can be used for embedding and sharing table searches.

ckan.datatables.state_duration

Example:

ckan.datatables.state_duration=86400

Default value:7200

Duration (in seconds) for which the saved state information is consideredvalid. After this period has elapsed, the table’s state will be returnedto the default, and the state cleared from the browser’s localStorage.

Note

The value0 is a special value as it indicates that thestate can be stored and retrieved indefinitely with no time limit.

ckan.datatables.data_dictionary_labels

Example:

ckan.datatables.data_dictionary_labels=false

Default value:True

Enable or disable data dictionary integration. When enabled, a column’s data dictionary label will be used in the table header. A tooltip for each column with data dictionary information will also be integrated into the header.

ckan.datatables.ellipsis_length

Example:

ckan.datatables.ellipsis_length=100

Default value:100

The maximum number of characters to show in a cell before it istruncated. An ellipsis (…) will be added at the truncation point andthe full text of the cell will be available as a tooltip. This value canbe overridden at the resource level when configuring a DataTablesresource view.

Note

The value0 is a special value as it indicates that thecolumn’s width will be determined by the column name, and cell contentwill word-wrap.

ckan.datatables.date_format

Example:

ckan.datatables.date_format=YYYY-MM-DDddww

Default value:llll

Themoment.js date formatto use to convert raw timestamps to a user-friendly date format usingCKAN’s current locale language code. This value can be overridden at theresource level when configuring a DataTables resource view.

Note

The valueNONE is a special value as it indicates that nodate formatting will be applied and the raw ISO-8601 timestamp will bedisplayed.

ckan.datatables.default_view

Example:

ckan.datatables.default_view=list

Default value:table

Indicates the default view mode of the DataTable (valid values:tableorlist). Table view is the typical grid layout, with horizontalscrolling. List view is a responsive table, automatically hiding columnsas required to fit the browser viewport. In addition, list view allowsthe user to expand the remaining columns by clicking on the first cell,or view all valued for a row in a dialog box depending on theckan.datatables.responsive_modal setting.This value can be overridden at the resource level when configuring aDataTables resource view.

ckan.datatables.null_label

Example:

ckan.datatables.null_label=N/A

Default value: none

The option defines the label used to display NoneType values for the front-end.This should be a string and can be translated via po files.

ckan.datatables.responsive_modal

Example:

ckan.datatables.responsive_modal=true

Default value:False

When a table is in list (responsive) view mode with some columns hiddenand the user clicks on the first cell, use a modal dialog to display thecomplete row contents instead of expanding the missing columnsin the table itself. Prior to CKAN 2.12 the default setting was “true”.

Datastore settings

ckan.datastore.write_url

Example:

ckan.datastore.write_url=postgresql://ckanuser:pass@localhost/datastore

Default value:postgresql://ckan_default:pass@localhost/datastore_default

The database connection to use for writing to the datastore (this can be ignored if you’re not using theDataStore extension). Note that the database used should not be the same as the normal CKAN database. The format is the same as insqlalchemy.url.

ckan.datastore.read_url

Example:

ckan.datastore.read_url=postgresql://readonlyuser:pass@localhost/datastore

Default value:postgresql://datastore_default:pass@localhost/datastore_default

The database connection to use for reading from the datastore (this can be ignored if you’re not using theDataStore extension). The database used must be the same used inckan.datastore.write_url, but the user should be one with read permissions only. The format is the same as insqlalchemy.url.

ckan.datastore.sqlsearch.allowed_functions_file

Example:

ckan.datastore.sqlsearch.allowed_functions_file=/path/to/my_allowed_functions.txt

Default value:/<CKAN_ROOT>/ckanext/datastore/allowed_functions.txt

Allows to define the path to a text file listing the SQL functions that should be allowed to runon queries sent to thedatastore_search_sql() function(if enabled, seeckan.datastore.sqlsearch.enabled). Function names should be listed one oneach line, eg:

abbrevabsabstime...

ckan.datastore.sqlsearch.enabled

Example:

ckan.datastore.sqlsearch.enabled=true

Default value:False

This option allows you to enable thedatastore_search_sql() action function, and corresponding API endpoint.

This action function has protections from abuse including:

  • parsing of the query to prevent unsafe functions from being called, seeckan.datastore.sqlsearch.allowed_functions_file

  • parsing of the query to prevent multiple statements

  • prevention of data modification by using a read-only database role

  • use ofexplain to resolve tables accessed in the query to check against user permissions

  • use of a statement timeout to prevent queries from running indefinitely

These protections offer some safety but are not designed to prevent all types of abuse. Depending on the sensitivity of private data in your datastore and the likelihood of abuse of your site you may choose to disable this action function or restrict its use with aIAuthFunctions plugin.

ckan.datastore.search.rows_default

Example:

ckan.datastore.search.rows_default=1000

Default value:100

Default number of rows returned bydatastore_search, unless the clientspecifies a differentlimit (up tockan.datastore.search.rows_max).

NB this setting does not affectdatastore_search_sql.

ckan.datastore.search.rows_max

Example:

ckan.datastore.search.rows_max=1000000

Default value:32000

Maximum allowed value for the number of rows returned by the datastore.

Specifically this limits:

  • datastore_search’slimit parameter.

  • datastore_search_sql queries have this limit inserted.

ckan.datastore.sqlalchemy.<OPTION>

Default value: none

Custom sqlalchemy config parameters used to establish the DataStoredatabase connection.

To get the list of all the available properties check theSQLAlchemy documentation

ckan.datastore.default_fts_lang

Example:

ckan.datastore.default_fts_lang=english

Default value:english

The default language used when creating full-text search indexes and querying them. It can be overwritten by the user by passing the “lang” parameter to “datastore_search” and “datastore_create”.

ckan.datastore.default_fts_index_method

Example:

ckan.datastore.default_fts_index_method=gist

Default value:gist

The default method used when creating full-text search indexes. Currently it can be “gin” or “gist”. Refer to PostgreSQL’s documentation to understand the characteristics of each one and pick the best for your instance.

ckan.datastore.ms_in_timestamp

Default value:True

The default return milliseconds to column with timestamp type’s. To use old behavior set to ‘false’

ckan.datastore.default_fts_index_field_types

Example:

ckan.datastore.default_fts_index_field_types=texttsvector

Default value: none

A separate full-text search index will be created by default for fields with these types, and used when searching on fields by passing a dictionary to the datastore_search q parameter.Indexes increase the time and disk space required to load data into the DataStore.

Datapusher settings

ckan.datapusher.formats

Example:

ckan.datapusher.formats=csvxls

Default value:csvxlsxlsxtsvapplication/csvapplication/vnd.ms-excelapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetodsapplication/vnd.oasis.opendocument.spreadsheet

File formats that will be pushed to the DataStore by the DataPusher. When adding or editing a resource which links to a file in one of these formats, the DataPusher will automatically try to import its contents to the DataStore.

ckan.datapusher.url

Example:

ckan.datapusher.url=http://127.0.0.1:8800/

Default value: none

DataPusher endpoint to use when enabling thedatapusher extension. If you installed CKAN viaInstalling CKAN from package, the DataPusher was installed for you running on port 8800. If you want to manually install the DataPusher, follow the installationinstructions.

ckan.datapusher.api_token

Default value: none

Starting from CKAN 2.10, DataPusher requires a valid API token to operate (seeAuthentication and API tokens), and will fail to start if this option is not set.

ckan.datapusher.callback_url_base

Example:

ckan.datapusher.callback_url_base=http://ckan:5000/

Default value: none

Alternative callback URL for DataPusher when performing a request to CKAN. This is useful on scenarios where the host where DataPusher is running can not access the public CKAN site URL.

ckan.datapusher.assume_task_stale_after

Example:

ckan.datapusher.assume_task_stale_after=86400

Default value:3600

In case a DataPusher task gets stuck and fails to recover, this is the minimum amount of time (in seconds) after a resource is submitted to DataPusher that the resource can be submitted again.