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
| Field | Default | Meaning |
|---|---|---|
tld | "test" (Linux: "localhost") | Domain suffix: applications answer at <name>.<tld> |
http_port | 8080 (Windows: 80) | Web server HTTP port; on macOS, port 80 forwards here after the standard ports step |
https_port | 8443 (Windows: 443) | Web server HTTPS port; on macOS, port 443 forwards here |
https_default | false | HTTPS 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_port | 5354 (Windows: 53) | Port of Anvil's DNS server on 127.0.0.1 |
php | none | Default 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_update | true | Settings › 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) |
editor | none | App for "Open in editor", e.g. "PhpStorm" |
terminal | none | App for "Open Terminal", e.g. "iTerm" |
git_client | none | App for the Git button, e.g. "Fork"; unset uses the first installed |
theme | none | "light" or "dark"; unset follows the system |
dock_icon | false | Keep the Dock icon while no window is open |
accepted_licenses | {} | Accepted service licenses: license id → date (Services) |
notifications | true | Notify on a process crash or a new application while Anvil isn't in front |
trim_app_logs | true | Trim 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_builds | false | Clean 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_database | none | "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 |
mcp | false | Enables anvil mcp (Settings › Features › Agents (MCP)); stored only when on |
tunnel | false | Settings › Features › Tunnel: Share… on an application's Overview; stored only when on |
mail_catcher | false | Settings › Features › Mail catcher: an inbox per application; stored only when on |
mail_port | 2525 | The Mail catcher's SMTP port on 127.0.0.1 |
db_viewer | false | Settings › Features › Database viewer: Adminer at db.<tld>; stored only when on |
request_log | true | Settings › 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.portsdaemon 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>"]
| Field | Meaning |
|---|---|
https | true: HTTPS, with http:// redirecting; false: HTTP only; unset follows https_default (anvil https) |
php | PHP version (anvil app php <name> <version>) |
root | Web root relative to the project folder; unset is public/ when present, else the folder (anvil app root) |
ini | php.ini values for this application; gives it its own PHP-FPM pool (anvil app ini) |
ext | Extensions for this application, over its PHP version's (anvil app ext) |
browser | true: Browser errors on, for all but static sites (anvil app browser --on). A worktree without it follows its application |
kind | Overrides the detected type, e.g. "vite" (anvil app type) |
command | Start command for own-server applications (anvil app command) |
port | Fixed private port for own-server applications (anvil app port) |
autostart | Start the application with Anvil (anvil app autostart) |
processes | Other processes by id; see Process settings |
runtime | Language version for own-server applications, e.g. "24" for Node.js (anvil app runtime). Ignored for .NET, which uses global.json |
worktree | The 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.
| Field | Meaning |
|---|---|
command | Replaces the detected command (Command) |
autostart | Start the process when Anvil starts (With Anvil) |
manual | Excluded from the Dev tab's Start (Dev start off) |
hidden | Removed from the list (×); Reset to detected brings it back |
added | Added by you (+ Add process): runs command; the id is its name |
host | Label 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>"]
| Field | Meaning |
|---|---|
kind | mysql, postgres, redis, mailpit, versitygw or silo (S3); docker or external |
version | Fixed when added; unset means the kind's default |
enabled | Start with Anvil |
port | Port on 127.0.0.1 |
web_port | Mailpit inbox (default 8025) or S3 console port (default 7071 for Versity S3 Gateway, 9001 for SILO) |
tags | Free-form labels, e.g. ["queue"] |
apps | Applications using the service |
docker | A Docker service's container, and for an image Anvil runs, image, container_port and env |
external | An 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.
| Path | Contents |
|---|---|
config.toml | Your 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 |
CLI reference
Reference for every anvil CLI command, covering sites, worktrees, PHP versions and extensions, language runtimes, services, databases and local HTTPS.
Architecture
How Anvil serves local sites: a request goes from the browser through Anvil's DNS and Caddy to PHP-FPM, static files or an app's dev server.