The application config file is at conf/app.conf relative to your app root. It uses the syntax accepted by revel/config which is similar to INI files. We’ll cover the general structure here. See comprehensive keys for a list of all built-in config keys and their values.


Two sections, dev (develop) and prod (production): = myapp
app.secret = pJLzyoiDe17L36mytqC912j81PfTiolHm1veQK6Grn1En3YFdB5lvEHVTwFEaWvj
http.addr =
http.port = 9000 = 1234 = Sheebang!

# Development settings
results.pretty = true
watch = true
http.addr =

log.trace.output = off  = stderr
log.warn.output  = stderr
log.error.output = stderr

# Production settings
results.pretty = false
watch = false
http.port = 9999

log.trace.output = off  = off
log.warn.output  = %(
log.error.output = %(

Config values can be accesed via the revel.Config variable, more below

driver := revel.Config.StringDefault("db.driver", "mysql")
ena := revel.Config.BoolDefault("myapp.remote.enabled", false)

Run Modes

Each section is a Run Mode and selected with the revel run command, eg.

revel run dev
  • The keys at the top level (eg app, http) are not within any [section] and apply to all run modes (ie default).
  • This allows values to be overridden (or introduced) as required in each run mode [section].
  • Also not in the example above, keys under the [prod] section applies only to prod mode.
  • The run mode is chosen at runtime by the argument provided to the revel run. eg:
    • revel run my-app - will start in dev mode as the default
    • revel run my-app prod - will start with prod mode.

Revel creates new apps with dev and prod run modes defined, but the developer may create any sections they wish.

Environment variables

Besides static configuration, Revel also supports dynamic configuration by injecting environment variables or the value of other parameters.

In most cases, you’ll want to load sensitive values from environment variables rather than storing them in your configuration file. The syntax for including an environment variable is similar to the shell syntax: ${ENV_VAR_NAME}.

Example = chat
http.port = 9000

db.driver = ${CHAT_DB_DRIVER}
db.spec = ${CHAT_DB_SPEC}

Revel will then load the CHAT_DB_DRIVER and CHAT_DB_SPEC environment variables and inject them into the config at runtime.

Composing other parameters

To incorporate the value of one parameter into another, you can “unfold” it by using the %(var_name)s syntax (note the ‘s’ at the end).

Example = chat
http.port = 9000

log.warn.output = %(
log.error.output = %(

Will be parsed by revel/config as:

log.warn.output = chat.log
log.error.output = chat.log

Custom properties

The developer may define custom keys and access them via the revel.Config variable, which exposes a simple api.


In your app.conf:

myapp.remote =
myapp.remote.enabled = true

In your Go code:

var remoteServer string
if revel.Config.BoolDefault("myapp.remote.enabled", false) {
    remoteServer = revel.Config.StringDefault("myapp.remote", "")
    DoSomethingTo( remoteServer )

External app.conf

Since v0.13, Revel has supported loading a external app.conf from a given directory. It’s a convenient way to override or add config values to the application. Please make sure app.conf is in the given path.


func init() {
    revel.ConfPaths = []string{"/etc/myapp/conf"}

Built-in properties

Application settings

The human-readable application name. This is used for some console output and development web pages.

Example = Booking example application

Default: Auto Generated For example:, = myrevelapp


The secret key used for cryptographic operations, see revel.Sign.

  • Revel also uses it internally to sign session cookies.
  • Setting it to empty string disables signing and is not recommended.
  • It is set to a random string when initializing a new project with revel new


  app.secret = pJLzyoiDe17L36mytqC912j81PfTiolHm1veQK6Grn1En3YFdB5lvEHVTwFEaWvj

Default: Auto Generated random seed value


If true Revel will resolve client IP address from HTTP headers X-Forwarded-For and X-Real-Ip in the order. By default Revel will get client IP address from http.Request’s RemoteAddr. Set to true if Revel application is running behind the proxy server like nginx, haproxy, etc.


  app.behind.proxy = true

Default: false

HTTP settings


The port to listen on.


  http.port = 9000


The IP address on which to listen.

  • On Linux, an address of will listen on all interfaces assigned to the host
  • on Windows, an empty string is silently converted to "localhost"
  • An empty string is converted to localhost for security reasons.

Default: “localhost”


Specifies the port for the application to listen on, when run by the harness. For example, when the harness is running, it will listen on http.port, run the application on harness.port, and reverse-proxy requests. Without the harness, the application listens on http.port directly.

By default, a random free port will be chosen. This is only necessary to set when running in an environment that restricts socket access by the program.

Default: 0


If true, Revel’s web server will configure itself to accept SSL connections. This requires an X509 certificate and a key file.

Default: false


Specifies the path to an X509 certificate file.

Default: “”


Specifies the path to an X509 certificate key.

Default: “”

Read timeout specifies a time limit for http.Server.ReadTimeout in seconds made by a single client. A Timeout of zero means no timeout.

Example = 300

Default: 90


Write timeout specifies a time limit for http.Server.WriteTimeout in seconds made by a single client. A Timeout of zero means no timeout.


  http.timeout.write = 120

Default: 60



Determines whether the template rendering should use chunked encoding. Chunked encoding can decrease the time to first byte on the client side by sending data before the entire template has been fully rendered.

Default: false


Configures RenderXML and RenderJSON to produce indented XML/JSON.


  results.pretty = true

Default: false



Specifies the default language for messages when the requested locale is not recognized. If left unspecified, a dummy message is returned to those requests.


  i18n.default_language = en

Default: “”


Specifies the name of the cookie used to store the user’s locale.

Default: %(cookie.prefix)_LANG (see cookie.prefix)


Revel watches your project and supports hot-reload for a number of types of source. To enable watching:

  watch = true

If false, nothing will be watched, regardless of the other watch.* configuration keys. (This is appropriate for production deployments)

Default: true


  • If watch.mode = "eager", the server starts to recompile the application every time the application’s files change.
  • If watch.mode = "normal", the server recompiles with a request eg a browser refresh.

Default: "normal"


If true, Revel will watch the views/ template directory (and sub-directories) for changes and reload them as necessary.

Default: true


If true, Revel will watch the app/routes file for changes and reload as necessary.

Default: false


If true, Revel will watch the Go code for changes and rebuild your application as necessary. This runs the harness as a reverse-proxy to the application.

All code within the application’s app/ directory, or any sub-directory is watched.

Default: true


Revel components use the following cookies by default:



Revel uses this property as the prefix for the Revel-produced cookies. This is so that multiple REVEL applications can coexist on the same host.


  cookie.prefix = MY

would result in the following cookie names:


Default: REVEL

A secure cookie has the secure attribute enabled and is only used via HTTPS, ensuring that the cookie is always encrypted when transmitting from client to server. This makes the cookie less likely to be exposed to cookie theft via eavesdropping. = false

Default: false in dev mode, otherwise true



Revel uses this property to set the expiration of the session cookie. Revel uses ParseDuration to parse the string. The default value is 30 days. It can also be set to "session" to allow session only expiry. Please note that the client behaviour is dependent on browser configuration so the result is not always guaranteed.



Specifies an override for the left and right delimiters used in the templates.
The delimiters must be specified as “LEFT_DELIMS RIGHT_DELIMS”

Default: {{ }}


Specifies the default date format for the application. Revel uses this in two places:

Default: 2006-01-02


Specifies the default datetime format for the application. Revel uses this in two places:

  • Binding dates to a time.Time (see parameters)
  • Printing dates using the datetime template function (see template funcs)

Default: 2006-01-02 15:04



Specifies the import path of the desired database/sql driver for the db module.

Default: “”


Specifies the name of the database/sql driver (used in sql.Open).

Default: “”


Specifies the data source name of your database/sql database (used in sql.Open).

Default: “”



Build tags to use when building an application.

Default: “”


See logging for details.


The cache module is a simple interface to a heap or distributed cache.


Sets the default duration before cache entries are expired from the cache. It is used when the caller passes the constant cache.DEFAULT.

It is specified as a duration string acceptable to time.ParseDuration

(Presently it is not possible to specify a default of FOREVER)

Default: 1h (1 hour)


If true, the cache module uses memcached instead of the in-memory cache.

Default: false


If true, the cache module uses redis instead of the in-memory cache.

Default: false


A comma-separated list of memcached hosts. Cache entries are automatically sharded among available hosts using a deterministic mapping of cache key to host name. Hosts may be listed multiple times to increase their share of cache space.

Default: “”

Scheduled Jobs

The jobs module allows you to run scheduled or ad-hoc jobs.


  • The number of jobs allowed to run concurrently.
  • Default is 10.
  • If zero (0), then there is no limit imposed.
  jobs.pool = 4


If true (default is false), allows a job to run even if previous instances of that job are still in progress.

  jobs.selfconcurrent = true


If true (default is false), the status page will accept the X-Forwarded-For header as the remote address used to allow or deny public access. This is diabled by default as the header value can be spoofed and therefore is not trustable. You should only use this if you are access your Revel app via a reverse proxy (e.g. Nginx). It is not recommended to allow this is production mode due to the security implications.

  jobs.acceptproxyaddress = true

Named Schedules

Named cron schedules may be configured by setting a key of the form:

  cron.schedulename = @hourly

The names schedule may be referenced upon submission to the job runner. For example:

  jobs.Schedule("cron.schedulename", job)


  • Modules may be added to an application by specifying their base import path.
  • An empty import path disables the module.
    module.testrunner =
    ## FIXME mymodule crashes so disabled for now
    # module.mymodulename = /path/to/mymodule
    module.mymodulename =

Error Handling

  • An optional value to wrap error path and line locations with a hyper link.
  • Disabled by default; does not wrap error location with link.
  • An example using Sublime Text’s custom URI scheme: = "subl://open?url=file://{{Path}}&line={{Line}}"

Areas for development

  • Allow inserting command line arguments as config values or otherwise specifying config values from the command line.
GoDoc Reference
GitHub Labels