fastly.toml package manifest format

Fastly services provide execution environments for your custom edge code. In the case of VCL services, you can upload VCL source code, which is compiled on the Fastly platform. However, Compute@Edge services are compiled in your own environment using the Fastly CLI, and the resulting binary is uploaded to the Fastly platform.

Compute@Edge packages are configured using a fastly.toml file in the root of the package directory tree. This file specifies configuration metadata related to a variety of tasks:

  1. attribution of the package (e.g., name, author)
  2. information required by the fastly CLI to compile and upload it to a compatible Fastly service
  3. configuration of local server environments
  4. bootstrapping of service configuration

In general, you should not write a fastly.toml file yourself. Instead, create a new Compute@Edge project using the fastly CLI by executing:

$ fastly compute init

This will walk you through the creation of the project and will write the fastly.toml file for you.


The following is an example of a fastly.toml file for a project built using our Rust SDK:

1manifest_version = 2
2name = "my-compute-project"
3description = "A wonderful Compute@Edge project that adds edge computing goodness to my application architecture."
4authors = [""]
5language = "rust"
6service_id = "SU1Z0isxPaozGVKXdv0eY"
9build = "cargo build --bin fastly-compute-project --release --target wasm32-wasi --color always"


The syntax of fastly.toml is the TOML format.

The TOML format supports comments. A line that begins with a # character is ignored:

# This is a comment.

Property names and values are separated by =. The following properties are defined for fastly.toml files. Required fields are marked. Where a section is optional, if the section is defined, the required fields under that section are also marked. Refer to the TOML specification to understand the 'Types' mentioned below:

Property nameTypeDescription
manifest_versionNumberPackage manifest schema version number. Currently at version 2. Any breaking changes to the manifest format should be accompanied by a change to the manifest version and the format changes will be documented here.
nameStringName of the package. If there is no service_id specified in the same manifest, a new service will be created and this will become the name of the service as well as the name of the uploaded package. If the project is deployed to an existing service, any change to the name will update the name of the compute package, but will not change the name of the service.
authorsArray: stringAn array of strings, listing email addresses of the authors of the project, for audit purposes. Displayed in the web interface and reported back via the API.
descriptionStringBrief description of the project, for audit purposes. Displayed in the web interface and reported back via the API.
languageStringLanguage used for the project. Either "rust", "assemblyscript", or another language SDK supported by Compute@Edge. This determines how the fastly CLI will compile your project to WebAssembly before it is uploaded to the Fastly edge cloud.
profileStringName of the profile account the Fastly CLI should use to make API requests. The profile consists of a token and email that is associated with a profile 'name'.
scriptsTableCustomisation options for the Fastly CLI build step. See "Scripts".
└─ buildStringCustom shell command to produce a Wasm binary (the output path should be bin/main.wasm).
└─ post_buildStringCustom shell command to run after the build step in the Fastly CLI.
service_idStringThe Fastly service ID of the service to which the fastly CLI should deploy the package. If not specified, a new service will be created when the project is deployed.
local_serverTableDescribes the configuration for the local server built into the Fastly CLI, which can be invoked with fastly compute serve.
└─ backendsTableA list of backends that should be provided by the local server.
└─{name}TableEach backend is a section whose name is the string used as the backend ID in the package code.
   └─ urlStringThe URL of the server to which to route requests made by the package to this backend. Must contain a scheme and host. May contain a port or path prefix. See below for examples.
   └─ override_hostStringUsed to override the Host header in requests sent to the local server's backends.
   └─ cert_hostStringHostname for certificate checking (and SNI, if enabled). If not set, the host from the backend URI is used.
   └─ use_sniBooleanSpecify whether to employ SNI for the backend. The default is true.
└─ dictionariesTableA list of dictionaries that should be provided by the local server.
  └─ {name}TableEach dictionary is a section whose name is the string used as the dictionary ID in the package code.
   └─ contentsTableA section containing inline dictionary items. Only used when format is set to inline-toml. See below for examples.
    └─ {key}StringIndividual dictionary items.
   └─ fileStringThe path to a JSON file containing the dictionary items that the local server should provide to the app. Only used when format is set to file. See below for examples.
   └─ formatStringThe format of the dictionary items. Supports json, inline-toml.
setupTableDescribes a set of service configuration that works with the code in the package. See setup information below. Ignored if service_id is present.
└─ backendsTableA list of backends that are required to be created on a first run of compute deploy.
  └─ {name}TableThe name of the backend used to connect to it from inside the package code, e.g. "api".
   └─ descriptionStringLabel to describe the backend, e.g. "API origin server".
   └─ addressStringHostname or IP address of the backend.
   └─ portNumberPort number of the backend.
└─ dictionariesTableA list of Edge dictionaries that are required to be created on a first run of compute deploy.
   └─ {name}TableThe name of the dictionary used to reference it from inside the package code, e.g. "config".
     └─ descriptionStringLabel to describe the dictionary, e.g. "Configuration settings".
     └─ itemsTableList of predefined dictionary items for dictionaries requiring a fixed set of entries.
        └─ {key}TableThe key for the dictionary item.
      └─ valueStringSuggested value for the dictionary item.
      └─ input_typeStringInput type hint, allowing for validation and improved input form usability (not supported in the Fastly CLI). One of string, number, integer, email, url, http-header, password.
      └─ descriptionStringLabel to describe the key/value pair.
└─ log_endpointsTableA list of log endpoints that are required to be created on a first run of compute deploy.
  └─ {name}TableThe name of the log endpoint used to reference it from inside the package code, e.g. "bigquery_requests".
     └─ providerStringThe name of the log provider (e.g. BigQuery, NewRelic etc). Used as part of a generic message to the user indicating the type of provider needed.


The [scripts] section of the fastly.toml file specifies how to define a build step, and 'post build' step, that integrates with the Fastly CLI.

The build property must produce a bin/main.wasm binary. From version v4.0.0 onwards, configuring the build property is required.

IMPORTANT: For officially supported Compute@Edge languages, the CLI will verify that toolchain dependencies are already installed on your system. If you choose to use a custom build command in conjunction with an officially supported language (e.g., a custom build script for a Rust project) use the --skip-verification flag to skip toolchain validation.

Here is an example for a project built using our JS SDK:

build = "$(npm bin)/webpack && $(npm bin)/js-compute-runtime ./bin/index.js ./bin/main.wasm"

Webpack bundles the project's ./src/index.js into a ./bin/index.js. js-compute-runtime then takes the bundled file and produces the required ./bin/main.wasm binary.

NOTE: Once js-compute-runtime supports spec-compliant import/export statements, the Fastly JS starter kits will no longer have a reliance on webpack.

The post_build is executed after the Wasm binary has been produced, but before it has been packaged into a .tar.gz archive file. This allows users to further optimise the produced Wasm binary to meet their requirements.

Here is an example of defining a post_build step for a project built using our Go SDK:

build = "tinygo build -target=wasi -wasm-abi=generic -gc=conservative -o bin/main.wasm ./"
post_build = "wasm-strip bin/main.wasm"

Local server

The [local_server] section of the fastly.toml file specifies how fastly compute serve should simulate the Fastly platform to enable you to test a package on your local machine. Currently this configuration section supports defining backends and dictionaries.

To see how this configuration is used, read more about testing and debugging Compute@Edge.


Test backends are local or remote servers to which we should route traffic coming from your package. Each backend is a table and contains a single url key:

url = ""
url = ""
url = ""
url = ""

If the url property contains a path component, then any request to that backend will be prefixed with that path. For the example shown above, a request to GET /foo issued by your package to the backend_c backend will result in a request being made to

HINT: Using a path prefix is useful if your service has multiple backends and, in your test environment, you have a single server that is standing in for all of the backends. The one backend-mocking server can use the path prefix to determine which backend is being targeted by the fetch.


Test dictionaries can be defined either as local JSON files that contain the dictionary items your app requires to run, or they can be written inline into the fastly.toml file.

For example, if you had an app that required a set of localized strings to be loaded from a dictionary named strings:

"en.welcome": "welcome",
"de.welcome": "willkommen",
"fr.welcome": "bienvenue",
"es.welcome": "bienvenido"

You can then reference this dictionary in your fastly.toml file:

file = "strings.json"
format = "json"

Alternatively you can inline that file directly within the fastly.toml:

format = "inline-toml"
"en.welcome" = "welcome"
"de.welcome" = "willkommen"
"fr.welcome" = "bienvenue"
"es.welcome" = "bienvenido"


The local server may be invoked with an --env argument that specifies the name of an environment. Environments are defined by creating files of the form fastly.{ENV-NAME}.toml (e.g., fastly.staging.toml), alongside the fastly.toml file. Environment-specific files define an alternative configuration for [local_testing].

For example, the following configuration matches the one above, except that it defines a different URL for backend_b:

url = ""
url = "http://localhost:1234/"
url = ""
url = ""

Setup information

The optional [setup] section of the fastly.toml file allows the Fastly CLI and web interface to provide a smarter experience when a deployment of a package requires a Fastly service to be created, normally when you run fastly compute deploy for the first time.

Compute@Edge programs are able to use features of Fastly services configured outside the program by referring to the feature - such as a backend or dictionary - by name. It's therefore important that when deploying a C@E program, the service it is deployed to has a set of configured features matching the expectations of the package code. For example, if the program reads values from a dictionary called "config", then there must be a "config" dictionary in the same service.

Starter kits may include [setup] in their fastly.toml file so that the Fastly CLI has all the information needed to create a service in which that starter kit can be deployed.

Once a Compute@Edge project is associated with a Fastly service, the [setup] data is no longer used, and the service configuration can be managed normally via the web interface, the API, using CLI commands, or third party orchestration tooling.

Example setup configuration

The following configuration demonstrates how to configure two separate backends (named httpbin and httpme) and a dictionary populated with two keys (named s3-primary-host and s3-fallback-host):

address = ""
description = "A simple HTTP Request & Response Service."
port = 443
address = ""
description = "HTTP me is a tiny express app initally designed to replicate the features of"
port = 443
description = "Configuration data for my service"
value = "eu-west-2"
value = "us-west-1"

Declaring resources without values

It's possible to define resources that are required, but to not provide any configuration for them, other than a name.

fastly.toml [setup] sections with no fields defined

This configuration states that two backend resources (one called 'api' and the other 'content') and a log endpoint resource (called 'request_logger') are required. When presented with this configuration, the Fastly CLI will prompt the user for the fields relevant to each resource, and a default value provided within the prompt if applicable.