Configuration

Reference for every field in ~/.anvil/config.toml: domain suffix, ports, default PHP, local HTTPS, per-application settings, services and worktrees.

The CLI and the desktop app both write ~/.anvil/config.toml; every field is optional. After a hand edit, restart anvil start (or use Reload in the app).

Top-level fields

FieldDefaultMeaning
tld"test" (Linux: "localhost")Domain suffix: applications answer at <name>.<tld>
http_port8080 (Windows: 80)Web server HTTP port; on macOS, port 80 forwards here after the standard ports step
https_port8443 (Windows: 443)Web server HTTPS port; on macOS, port 443 forwards here
https_defaultfalseHTTPS for applications without their own https. The app's HTTPS for new applications first pins existing applications to their current value, so only new ones follow it. A hand edit affects every application without its own https
dns_port5354 (Windows: 53)Port of Anvil's DNS server on 127.0.0.1
phpnoneDefault PHP version, e.g. "8.4". Set by the first anvil php install, changed with anvil use
paths[]Parked folders (anvil park)
links{}Name → folder (anvil link)
hidden[]Parked applications hidden from the list; their folders stay
groups{}App list groups: group name → application names
ini{}php.ini values for all applications (anvil php ini)
php_ext{}Extensions on for every application on a PHP version, by minor version (anvil php ext add)
php_auto_updatetrueSettings › Languages › PHP › Update automatically: new patches of installed versions install on their own; stored only when off
php_opcache_off[]PHP minor versions whose OPcache is turned off in Settings › Languages › PHP; they run with opcache.enable=0 (OPcache)
editornoneApp for "Open in editor", e.g. "PhpStorm"
terminalnoneApp for "Open Terminal", e.g. "iTerm"
git_clientnoneApp for the Git button, e.g. "Fork"; unset uses the first installed
themenone"light" or "dark"; unset follows the system
dock_iconfalseKeep the Dock icon while no window is open
accepted_licenses{}Accepted service licenses: license id → date (Services)
notificationstrueNotify on a process crash or a new application while Anvil isn't in front
trim_app_logstrueTrim application logs weekly: trims each application's storage/logs/*.log over 10 MB to its last 1 MB, deletes daily logs older than 14 days, and keeps Anvil's own logs under 5 MB. Desktop app only; anvil start trims nothing
clean_rust_buildsfalseClean Rust builds: once a day, a stopped Rust application's target is deleted after 7 days without a code change; with your own cargo-sweep, other stopped ones keep only what builds used in 30 days (Storage). Desktop app only
worktree_databasenone"copy": new worktrees start with a copy of the application's database (Settings › Worktrees › Copy the database too); unset: empty. The application, its .anvil.toml or a preset can override it. See Worktrees
worktree_presets{}Your edits to worktree hook presets from Settings › Worktrees, by preset id (laravel, symfony, …). See Worktrees
worktrees{}Written by Anvil, per worktree: the database choice (db), the databases it uses and whether Anvil made them or you chose Use existing (copies), and whether Use existing was clicked (adopted). See Worktrees
mcpfalseEnables anvil mcp (Settings › Features › Agents (MCP)); stored only when on
tunnelfalseSettings › Features › Tunnel: Share… on an application's Overview; stored only when on
mail_catcherfalseSettings › Features › Mail catcher: an inbox per application; stored only when on
mail_port2525The Mail catcher's SMTP port on 127.0.0.1
db_viewerfalseSettings › Features › Database viewer: Adminer at db.<tld>; stored only when on
request_logtrueSettings › Features › Request log: the web server logs each application's requests for its Requests tab. Off: no request logs, no Requests tab, and anvil app requests and MCP requests refuse; stored only when off

After changing tld, dns_port, http_port or https_port, rerun setup. On macOS, also run the command it prints:

  • /etc/resolver/<tld> holds the suffix and DNS port (Getting started).
  • The dev.anvil.ports daemon keeps forwarding 80 and 443 to the old ports until setup rewrites it.

tld = "localhost" needs no resolver file or DNS server. anvil tld <suffix> sets tld.

Per-application settings: [sites."<name>"]

FieldMeaning
httpstrue: HTTPS, with http:// redirecting; false: HTTP only; unset follows https_default (anvil https)
phpPHP version (anvil app php <name> <version>)
rootWeb root relative to the project folder; unset is public/ when present, else the folder (anvil app root)
iniphp.ini values for this application; gives it its own PHP-FPM pool (anvil app ini)
extExtensions for this application, over its PHP version's (anvil app ext)
browsertrue: Browser errors on, for all but static sites (anvil app browser --on). A worktree without it follows its application
kindOverrides the detected type, e.g. "vite" (anvil app type)
commandStart command for own-server applications (anvil app command)
portFixed private port for own-server applications (anvil app port)
autostartStart the application with Anvil (anvil app autostart)
processesOther processes by id; see Process settings
runtimeLanguage version for own-server applications, e.g. "24" for Node.js (anvil app runtime). Ignored for .NET, which uses global.json
worktreeThe application's own worktree hooks (copy, copy_database, keys, after_create, and check, which only a hand edit sets), from its Settings tab, Worktrees, Customize…. Overrides .anvil.toml and the preset

Process settings

[sites."<name>".processes."<id>"] holds your changes to one of an application's dev processes. Configure in the Dev tab writes it. The application's own dev server uses command and autostart above.

FieldMeaning
commandReplaces the detected command (Command)
autostartStart the process when Anvil starts (With Anvil)
manualExcluded from the Dev tab's Start (Dev start off)
hiddenRemoved from the list (×); Reset to detected brings it back
addedAdded by you (+ Add process): runs command; the id is its name
hostLabel in an extra dev server's address, e.g. docs in vuefinder--docs.test (Edit Address…)

Legacy pinned and top are ignored and dropped on the next save.

Services: [services."<name>"]

FieldMeaning
kindmysql, postgres, redis, mailpit, versitygw or silo (S3); docker or external
versionFixed when added; unset means the kind's default
enabledStart with Anvil
portPort on 127.0.0.1
web_portMailpit inbox (default 8025) or S3 console port (default 7071 for Versity S3 Gateway, 9001 for SILO)
tagsFree-form labels, e.g. ["queue"]
appsApplications using the service
dockerA Docker service's container, and for an image Anvil runs, image, container_port and env
externalAn external server's kind (mysql, postgres, redis or other), host, and optional user, password and database

Prefer anvil service add: it picks a free port and installs the program. See Services.

Example

tld = "test"
http_port = 8080
https_port = 8443
https_default = false
dns_port = 5354
php = "8.4"
editor = "PhpStorm"
terminal = "iTerm"
paths = ["/Users/me/Sites"]

[links]
shop = "/Users/me/code/shop"

[ini]               # php.ini defaults for every application
memory_limit = "512M"

[sites."myapp"]
php = "8.3"
https = true

[sites."myapp".ini]
memory_limit = "1G" # this application gets its own PHP-FPM pool

[sites."dashboard"]
command = "npm run dev"
port = 41500
autostart = true

[services.mysql]
kind = "mysql"
enabled = true
port = 3306

[services.queue]
kind = "redis"
enabled = true
port = 6380
tags = ["queue"]
apps = ["myapp"]

The ~/.anvil folder

Everything Anvil installs and generates. ANVIL_HOME overrides the location.

PathContents
config.tomlYour settings
php/<version>/PHP binaries and php.ini
runtimes/<id>/Node.js, Go, Rust, .NET, Python and uv
services/<kind>/<version>/Service programs, shared by every service of that version
data/<name>/Each service's data
data/caddy/CA and application certificates
bin/Web server, Composer, and the copy of anvil the shims run
shims/php, composer, laravel, forge, node, npm, npx, pnpm
composer/Anvil's global Composer packages, e.g. the Laravel installer and Laravel Forge's CLI
cache/Package and build caches
run/Generated configuration, sockets and pid files
log/Logs of the web server, PHP-FPM, services, applications and anvil new

On this page