Applications
How Anvil detects Laravel, WordPress, PHP, Node.js, Python, Rust, Go, .NET and Docker Compose projects, runs their dev servers and creates new apps.
Anvil detects each folder's type from its files. Override it in the app or with
anvil app type <site> <kind>.
| Type | Detected by | Served by |
|---|---|---|
| Laravel | artisan | PHP-FPM |
| Statamic | artisan and statamic/cms in composer.json | PHP-FPM |
| Symfony | bin/console and symfony/framework-bundle in composer.json | PHP-FPM |
| WordPress | wp-includes and wp-load.php or wp-config.php; Bedrock: web/wp-config.php and roots/wordpress in composer.json | PHP-FPM |
| PHP | composer.json, index.php or public/index.php | PHP-FPM |
| Rust | Cargo.toml | cargo run |
| Go | go.mod | go run . |
| .NET | a .csproj, .fsproj or .sln file | dotnet run |
| Django | manage.py that imports Django | python manage.py runserver |
| FastAPI | fastapi in pyproject.toml or requirements.txt (if there is also a package.json, only with a main.py, app.py, wsgi.py or app/main.py) | uvicorn |
| Flask | flask in pyproject.toml or requirements.txt (same rule) | flask run |
| Next.js | next in package.json | npm run dev |
| Nuxt | nuxt in package.json | npm run dev |
| Vite | vite or vite-plus in package.json | npm run dev |
| Node.js | package.json | npm run dev, or npm run start without a dev script |
| Docker Compose | compose.yaml, compose.yml, docker-compose.yaml or docker-compose.yml, when no type above matches and there is no .html page, dekit.yaml or mprocs.yaml | Docker, see Docker Compose |
| Static | an .html file at the top or in public/ | the web server |
| Folder | anything else | nothing: no address, no web server entry, no HTTPS |
- PHP applications run through PHP-FPM, see PHP.
- Other applications run their own dev server on a private port, passed in
$PORT. Anvil proxies<name>.testand<name>.localhostto it (on Linux,<name>.localhost:8080). Start command, port and language version are set per application (.NET reads its version from the project'sglobal.json). See Node.js, Python, Go, Rust and .NET. - A dev server doesn't start on its own. Use Start in the Dev tab, or
anvil app start <site>while the desktop app is open. A stopped application shows a "not running" page. - To start it with Anvil, turn on Start with Anvil in its Settings tab
or run
anvil app autostart <site> true(off by default). With the CLI alone, restartanvil startafterwards. - Git worktrees run next to their application at
<app>--<name>.test, with their own dev processes and database. See Worktrees.
PHP
PHP 8.1 to 8.5, and 8.6 as a preview, are portable builds in ~/.anvil/php/<version>, with a default
version and a version per application. See PHP.
Languages
Node.js, Go, Rust (through rustup), .NET and Python (through uv) are installed
into ~/.anvil/runtimes, with their caches inside ~/.anvil. Anvil puts them
on PATH for the applications it runs.
In your terminal, only node, npm, npx and pnpm reach them (the
terminal commands). Python, Go, Rust
and .NET stay whatever your PATH finds. On macOS and Linux, the app also picks
up your login shell's PATH at launch, so pnpm, Homebrew and nvm tools are found.
anvil runtime list
anvil runtime install node 22Dev processes
The Dev tab (⌘3) runs the programs an application needs while you work: queue worker, log tailer, Vite, a docs site. For an application with its own server, that server is the first process.
| Control | Does |
|---|---|
| Configure | Edit the process list, see Configure |
| Start / Stop | Starts every process marked Dev start; once all run, stops them all |
| Run ▾ | One-off scripts, in the Commands box (shown when there are scripts), see One-off scripts |
| All processes | Merged output, each line tagged with its process's name in color |
Output keeps terminal colors and shows only the current run. ⌘-click (Ctrl+click on Windows and Linux) opens a link. Log files stay in the Logs tab.
Keys: ↑↓ select, s start, x stop, r restart, q stop all, c clear.
Processes run with:
- Anvil's Node.js: the version from
.anvil.toml,.nvmrcor.node-versionif installed, else the newest - the application's PHP, for PHP applications
- your terminal's
PATH
A process that needs node_modules installs it first, with the package manager
the lock file names. Processes stop when Anvil quits or the application is
removed.
Sources, in order:
-
.anvil.tomlin the project, for any kind of application:[processes] queue = "php artisan queue:listen" vite = "npm run dev"It replaces detection: the sources below aren't read, and no extra dev servers get an address.
-
dekit.yaml, elsemprocs.yaml, for any kind of application; it replaces the sources below. See dekit and mprocs. -
Laravel 13: the processes of
php artisan dev(queue, logs, Vite), without its server. Withlaravel/octane, anoctaneprocess is added (Octane); withlaravel/reverb, areverbprocess (Reverb). -
Other PHP applications: each command the
composer run devscript starts withconcurrently, named by its--names.php artisan serveis left out. -
PHP applications without such a script:
npm run devwhenpackage.jsonhas adevscript. -
Applications with their own server: their extra dev servers (below).
A PHP application's processes run as written, without a port.
dekit and mprocs
A project's dekit.yaml (dekit is mprocs' new name) or mprocs.yaml gives
its Dev rows, e.g. a monorepo:
tasks:
frontend: { cmd: ["pnpm", "run", "dev"], cwd: frontend, autostart: true }
backend: { cmd: ["dotnet", "watch", "run"], cwd: backend, autostart: true }
mobile: { cmd: ["pnpm", "run", "android"], cwd: mobile }Start runs frontend and backend; mobile starts from its row.
| dekit.yaml | mprocs.yaml | |
|---|---|---|
| Tasks | tasks.<name> | procs.<name> |
| Command | cmd (array or string) or script | shell (string) or cmd (array) |
autostart unset | off | on |
- Each task runs in its
cwd, a path relative to the project, else the project folder. dekit'sdefaults.cwdapplies to every task. - On macOS and Linux, a leading
cmd /cis dropped. - Not read: a task's
env, mprocs' per-OS$select, and its<CONFIG_DIR>incwd. A name with other than letters, digits,-and_, or over 40 characters, is skipped. - No task gets a
.testaddress. - A compose file beside it doesn't make the project a Docker Compose application.
Configure
Configure turns the list into a table: Name, Command, Dev start (started by Start) and With Anvil (started when Anvil starts).
- + Add process adds one, × removes one.
- Reset to detected restores what Anvil found.
- Table | JSON switches to JSON editing.
- Done saves; Cancel drops changes.
Settings are stored in ~/.anvil/config.toml, never in the project, under
[sites."<name>".processes."<id>"]. See
Configuration.
The application's own dev server is the exception. Its Dev start can't be turned off. Its Command and With Anvil are the Start command and Start with Anvil settings in its Settings tab.
Extra dev servers
For an application with its own server, other package.json scripts that
start a dev server get a port and an address, <name>--<label>.test. For
example, docs:dev in vuefinder answers at vuefinder--docs.test.
Right-click one › Edit Address… to change the label; leave it empty to
restore the automatic one.
A script counts as a dev server when:
- its name is
startorserve, or ends in:dev, or - it runs
vite(notvite buildorvite preview),vp dev,vitepress dev,nuxt dev,next dev,astro devorstorybook dev.
preview, *:preview and *:serve are one-off scripts instead.
One-off scripts
Run ▾ lists the other package.json scripts and, for PHP applications, the
composer.json scripts. It leaves out dev, Composer's pre-/post- event
scripts and npm lifecycle hooks.
A script runs once after you confirm. It shows in the Commands box with a spinner, then ✓, or ✕ with its exit code. Right-click › Run Again… reruns it; × dismisses it.
Docker Compose
An application with compose.yaml, compose.yml, docker-compose.yaml or
docker-compose.yml gets a Containers tab laid out like Dev: state,
published ports, health, live log, and Start, Stop and Restart.
- If nothing else is detected, it is the Docker Compose type with no address of its own. Its containers answer on their published ports.
- A framework or
.htmlpage keeps its type, so a Laravel application with Sail has both Dev and Containers.
Start and Stop run docker compose up -d and docker compose stop for all
containers. Anvil never kills or removes containers (it never runs down), and
they keep running when Anvil quits. Anvil uses your installed docker; without
it, the Containers tab says why.
New applications
anvil new <kind> <name> or New… (⌘N): Laravel, Statamic, Symfony, WordPress, PHP,
static, Next.js, Nuxt, Vite, Node.js, Rust, Go, .NET, Django, FastAPI and
Flask. The app groups them by language (PHP, JavaScript, Python, Other), shows
the resulting address, and keeps options under a one-line summary:
- Laravel's starter kit (React, Vue, Svelte, Livewire or none) and database
- WordPress's MySQL service (see WordPress)
- Next.js's TypeScript and Tailwind
- Vite's framework and TypeScript
- the package manager (npm, pnpm or bun) for Laravel, Statamic, Next.js, Nuxt and Vite
- the PHP or Node.js version
- Git
- HTTPS (off unless Settings › General › Addresses › HTTPS for new applications is on)
Create shows each step over the live output. Open in Browser opens the new application and selects it; with the web server stopped the button is Show. Use Existing Folder… serves a project already on your computer instead.
- Anvil uses its own PHP, Composer and toolchains. If the template's PHP or language isn't installed, the form says so with an Install button.
- The project gets a Git repository with a first commit, unless Git is off
(
--no-git). Without a Git name and email, the commit is skipped. - Output goes to
~/.anvil/log/create-<name>.log. A failed create leaves nothing behind. - A new application outside a parked folder is linked.
Storage
Anvil measures each application's disk use in three groups:
| Group | Contents | |
|---|---|---|
| Safe | Logs and caches | Delete any time |
| Rebuildable | node_modules, vendor, target, .next | Deletable only while the application is stopped |
| Keep | Code and data, e.g. storage/app, a SQLite database | Never deleted by Anvil |
The app cleans item by item, or the safe items of every application at once.
anvil usage shows the same numbers plus the services an application's .env
points at. anvil clean <site> <path> (or --safe) deletes listed items.