First time / fresh machine? Install Docker, Python, and DBox first — see installation.md → First-time setup on a fresh PC. Then come back here.
There are two entry points: create a brand-new project, or init an
existing one. Both end with dbox start.
dbox create laravel blogThis will:
- Create a
blog/directory. - Write
blog/dbox.ymlwith sensible defaults for Laravel (PHP 8.3, the extensions Laravel wants, Mailpit + phpMyAdmin enabled, MariaDB withblog/blogcredentials). - Generate
blog/.dbox/(Docker artifacts). - Build the PHP image.
- Scaffold the framework (
composer create-project laravel/laravel). - Start the stack and print a summary (URLs and database credentials).
cd blog
dbox start # if it isn't already runningstart / create print everything you need in one place — service URLs plus
the database host, name, username, password, and a ready-to-paste connection
string (also written to .dbox/env/.env):
blog — environment ready ───────────────────────────────
URLs
App http://localhost:8080
Mailpit http://localhost:8025
phpMyAdmin http://localhost:8081
Database
Engine mariadb
Host (in app) db
Host (your PC) localhost:3306
Database blog
Username blog
Password blog
Root login root / root
Connection mysql://blog:blog@db:3306/blog
The generic form is:
dbox create <framework> <name>See frameworks.md for every supported <framework> value.
Magento additionally prompts for your Marketplace access keys (or reads
MAGENTO_PUBLIC_KEY/MAGENTO_PRIVATE_KEYfrom the environment). See frameworks.md.
DBox isn't PHP-only. The same create command works across runtimes:
dbox create gin myapi # Go + Gin (auto-installs gin into go.mod)
dbox create echo myapi # Go + Echo
dbox create go myapi # plain Go (net/http)
dbox create actix myapi # Rust + Actix-web
dbox create axum myapi # Rust + Axum
dbox create rust myapi # plain RustGo and Rust projects come with live reload baked in (air and
cargo-watch) and auto-wire to the DBox database — Gin/Echo via DB_* env
vars, Actix/Axum via DATABASE_URL. The app container exposes its port
directly (default 7090). See runtimes.md for the full
picture. Use dbox go … / dbox cargo … to run the toolchain inside the
container.
git clone https://github.com/acme/shop
cd shop
dbox init
dbox startdbox init inspects the directory and infers:
- Framework — from marker files and
composer.json - PHP version — from the
phpconstraint incomposer.json - Extensions — framework defaults plus any
ext-*incomposer.json - Services — framework defaults (e.g. Mailpit + phpMyAdmin for Laravel)
It then writes dbox.yml and .dbox/. Re-run with --force to overwrite
an existing dbox.yml.
Preview what it would do without writing anything:
dbox detectdbox start # build (if needed) + run
dbox logs -f # tail logs
dbox shell # bash inside the PHP container
dbox artisan migrate # run framework CLIs in the container
dbox composer require x/y # Composer in the container
dbox stop # stop containers (data preserved)
dbox down # remove containers + network
dbox down -v # …and delete the database volumeEdit dbox.yml and run dbox start, or use the convenience commands:
dbox php use 8.4 # switch PHP, rebuild image
dbox db postgres # switch database engine
dbox server caddy # switch web server
dbox ext install redis # add an extension, rebuild image
dbox redis enable # toggle a service
dbox ssl enable # local HTTPSAll of these update dbox.yml, regenerate .dbox/, and tell you when a
dbox start is needed to apply the change.
dbox doctorChecks Docker, the config, framework detection, the running containers, the database/Redis services, recommended extensions, and SSL.