Workspace
What is the Workspace container?
workspace is Laradock's general-purpose development shell, the container you exec into to run Composer, Artisan, Git, Node/npm, and most other CLI work against your mounted project code. It's built from the laradock/workspace base image (tagged by PHP version) and runs as a non-root laradock user matched to your host UID/GID, so files it creates aren't owned by root.
Unlike php-fpm, it's not what actually serves your app to a browser, nginx/apache talk to php-fpm for that. workspace is where you sit and type commands.
Enter the Workspace
The fastest path in is the dedicated shortcut, it starts workspace for you if it isn't running yet (equivalent to the Start the Workspace command below), then drops you in as the non-root laradock user:
- Laradock CLI
- Docker Compose
./laradock workspace
docker compose exec -u laradock workspace bash
You land in /var/www (your project, mounted from APP_CODE_PATH_HOST) as the laradock user. Pass --root (CLI only: ./laradock workspace --root) to land as root instead, useful for one-off apt-get installs.
ws and shell also work as shorthands for ./laradock workspace.
Start the Workspace
If you'd rather start it explicitly, without entering a shell, for example alongside other services:
- Laradock CLI
- Docker Compose
./laradock start workspace
docker compose up -d workspace
Name any other services alongside it to start them together, for example ./laradock start nginx mysql workspace.
Stop the Workspace
- Laradock CLI
- Docker Compose
./laradock stop workspace
docker compose stop workspace
What's installed by default
A handful of WORKSPACE_INSTALL_* / WORKSPACE_* flags in workspace/defaults.env default to true (everything else defaults to false):
| Variable | Default | What it does |
|---|---|---|
WORKSPACE_INSTALL_NODE | true | Node.js via NVM (WORKSPACE_NODE_VERSION=node tracks latest). |
WORKSPACE_INSTALL_YARN | true | Yarn package manager. |
WORKSPACE_INSTALL_NPM_GULP | true | Gulp CLI, global npm install. |
WORKSPACE_INSTALL_NPM_VUE_CLI | true | Vue CLI, global npm install. |
WORKSPACE_INSTALL_PHPREDIS | true | PHP Redis extension (for CLI scripts, Artisan, etc.). |
WORKSPACE_INSTALL_AST | true | PHP AST extension. |
WORKSPACE_INSTALL_MEMCACHED | true | PHP Memcached extension. |
WORKSPACE_INSTALL_DNSUTILS | true | dig/nslookup and friends. |
WORKSPACE_INSTALL_JDK | true | Java Development Kit. |
WORKSPACE_COMPOSER_GLOBAL_INSTALL | true | Runs composer global install at build time. |
WORKSPACE_COMPOSER_VERSION | 2 | Composer major version (1, 2, 2.2, or a specific version string). |
Pick your tools with the CLI
The wizard asks about workspace tools directly, so you don't have to know a flag name to find a tool. Step 8 of ./laradock setup is a searchable, grouped picker over every tool below, with what you already have pre-ticked:
./laradock setup
----------------------------------------------------------------------
Step 8 of 10 Workspace tools
----------------------------------------------------------------------
The workspace is your dev shell: the container you run php, composer, artisan,
npm and git inside (./laradock workspace). These are the tools baked into it.
Debug & testing
[ ] xdebug
[x] pcov
Node & frontend
[x] node
...
type to filter · arrows move · space toggles on/off · enter when done
Type to filter (xde finds xdebug), space to toggle, enter to accept. Only the tools you actually change are written to your .env, so it stays a short diff of your choices rather than a copy of all ~87 flags. When you change something, the CLI reminds you to rebuild.
It's safe to re-run ./laradock setup any time to add or remove tools later; your current answers are pre-filled.
The WORKSPACE_INSTALL_* toggle pattern
If you'd rather not use the wizard, every tool is just an on/off flag in workspace/defaults.env: WORKSPACE_INSTALL_<THING>=false. Flip one to true in your .env, then rebuild:
WORKSPACE_INSTALL_XDEBUG=true
WORKSPACE_INSTALL_DRUSH=true
WORKSPACE_INSTALL_WP_CLI=true
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Then restart it to pick up the new build:
- Laradock CLI
- Docker Compose
./laradock restart workspace
docker compose up -d workspace
To turn one back off, either untick it in ./laradock setup, or:
./laradock unset WORKSPACE_INSTALL_XDEBUG # back to the shipped default
./laradock rebuild workspace
Removing a tool rebuilds the image without it. Your code and database are untouched: the workspace holds no data of its own, only tools.
Every tool you can install
The complete list, grouped the same way the ./laradock setup picker groups them. On = installed unless you turn it off. Names in the first column are what you type in the picker; the flag is what you'd set by hand.
Debug & testing
| Tool | Flag | Default | What it does |
|---|---|---|---|
xdebug | WORKSPACE_INSTALL_XDEBUG | off | Step debugger and profiler. See the Xdebug + IDE guide. |
pcov | WORKSPACE_INSTALL_PCOV | off | Fast code-coverage driver for PHPUnit (much quicker than Xdebug's). |
phpdbg | WORKSPACE_INSTALL_PHPDBG | off | PHP's built-in interactive debugger, also usable for coverage. |
dusk-deps | WORKSPACE_INSTALL_DUSK_DEPS | off | Chrome and the libraries Laravel Dusk needs for browser tests (amd64 only). |
taint | WORKSPACE_INSTALL_TAINT | off | Static analysis extension that flags possible XSS in strings. |
Node & frontend
| Tool | Flag | Default | What it does |
|---|---|---|---|
node | WORKSPACE_INSTALL_NODE | on | Node.js via NVM. Version set by WORKSPACE_NODE_VERSION. |
yarn | WORKSPACE_INSTALL_YARN | on | Yarn package manager. |
pnpm | WORKSPACE_INSTALL_PNPM | off | pnpm package manager. |
npm-gulp | WORKSPACE_INSTALL_NPM_GULP | on | Gulp task runner CLI, installed globally. |
npm-vue-cli | WORKSPACE_INSTALL_NPM_VUE_CLI | on | Vue CLI, installed globally. |
npm-angular-cli | WORKSPACE_INSTALL_NPM_ANGULAR_CLI | off | Angular CLI, installed globally. |
npm-bower | WORKSPACE_INSTALL_NPM_BOWER | off | Bower, the legacy frontend package manager. |
npm-check-updates-cli | WORKSPACE_INSTALL_NPM_CHECK_UPDATES_CLI | off | ncu, checks your package.json for newer versions. |
Database clients & drivers
| Tool | Flag | Default | What it does |
|---|---|---|---|
mysql-client | WORKSPACE_INSTALL_MYSQL_CLIENT | off | The mysql command, for a SQL shell or mysqldump from the workspace. |
pg-client | WORKSPACE_INSTALL_PG_CLIENT | off | The psql command and Postgres client tools. |
mongo | WORKSPACE_INSTALL_MONGO | off | PHP MongoDB driver. |
mssql | WORKSPACE_INSTALL_MSSQL | off | PHP SQL Server driver (sqlsrv/pdo_sqlsrv). |
oci8 | WORKSPACE_INSTALL_OCI8 | off | PHP Oracle driver. Needs the Instant Client files. |
cassandra | WORKSPACE_INSTALL_CASSANDRA | off | PHP Cassandra driver. |
aerospike | WORKSPACE_INSTALL_AEROSPIKE | off | PHP Aerospike driver. |
ssdb | WORKSPACE_INSTALL_SSDB | off | PHP SSDB client. |
rdkafka | WORKSPACE_INSTALL_RDKAFKA | off | PHP Kafka client. See the section below. |
zookeeper | WORKSPACE_INSTALL_ZOOKEEPER | off | PHP ZooKeeper client. |
PHP extensions
| Tool | Flag | Default | What it does |
|---|---|---|---|
phpredis | WORKSPACE_INSTALL_PHPREDIS | on | Redis extension, so Artisan and CLI scripts can talk to Redis. |
memcached | WORKSPACE_INSTALL_MEMCACHED | on | Memcached extension. |
apcu | WORKSPACE_INSTALL_APCU | off | In-memory user cache (APCu). |
amqp | WORKSPACE_INSTALL_AMQP | off | AMQP extension, for RabbitMQ. |
gearman | WORKSPACE_INSTALL_GEARMAN | off | Gearman job-queue client. |
event | WORKSPACE_INSTALL_EVENT | off | libevent bindings for async PHP. |
swoole | WORKSPACE_INSTALL_SWOOLE | off | Coroutine/async runtime used by Octane, Hyperf. |
soap | WORKSPACE_INSTALL_SOAP | off | SOAP client/server. |
gnupg | WORKSPACE_INSTALL_GNUPG | off | GnuPG encryption bindings. |
gmp | WORKSPACE_INSTALL_GMP | off | Arbitrary-precision maths. |
bz2 | WORKSPACE_INSTALL_BZ2 | off | bzip2 compression. |
imap | WORKSPACE_INSTALL_IMAP | off | IMAP mailbox access. |
ldap | WORKSPACE_INSTALL_LDAP | off | LDAP / Active Directory auth. |
mailparse | WORKSPACE_INSTALL_MAILPARSE | off | Parse raw email messages. |
phpdecimal | WORKSPACE_INSTALL_PHPDECIMAL | off | Correctly-rounded decimal maths, for money. |
ssh2 | WORKSPACE_INSTALL_SSH2 | off | SSH/SFTP from PHP. |
xmlrpc | WORKSPACE_INSTALL_XMLRPC | off | XML-RPC client/server. |
xsl | WORKSPACE_INSTALL_XSL | off | XSLT transforms. |
yaml | WORKSPACE_INSTALL_YAML | off | Fast YAML parsing. |
zmq | WORKSPACE_INSTALL_ZMQ | off | ZeroMQ messaging. |
trader | WORKSPACE_INSTALL_TRADER | off | Technical-analysis functions. |
xlswriter | WORKSPACE_INSTALL_XLSWRITER | off | Write large Excel files quickly. |
v8js | WORKSPACE_INSTALL_V8JS | off | Run JavaScript from PHP via V8. |
phalcon | WORKSPACE_INSTALL_PHALCON | off | The Phalcon framework extension. |
ast | WORKSPACE_INSTALL_AST | on | Exposes PHP's syntax tree. Needed by Phan and other static analysers. |
ioncube | WORKSPACE_INSTALL_IONCUBE | off | ionCube loader for encoded PHP. Not available on PHP 8.0 or 8.4+. |
Framework CLIs
| Tool | Flag | Default | What it does |
|---|---|---|---|
laravel-installer | WORKSPACE_INSTALL_LARAVEL_INSTALLER | off | The laravel new command. |
laravel-envoy | WORKSPACE_INSTALL_LARAVEL_ENVOY | off | Envoy task runner for remote deploys. |
symfony | WORKSPACE_INSTALL_SYMFONY | off | The Symfony CLI. |
deployer | WORKSPACE_INSTALL_DEPLOYER | off | Deployer, the PHP deployment tool. |
drush | WORKSPACE_INSTALL_DRUSH | off | Drupal's command line. |
drupal-console | WORKSPACE_INSTALL_DRUPAL_CONSOLE | off | Drupal Console. |
wp-cli | WORKSPACE_INSTALL_WP_CLI | off | The wp command, for WordPress. |
prestissimo | WORKSPACE_INSTALL_PRESTISSIMO | off | Parallel downloads for Composer 1. Pointless on Composer 2. |
Media & documents
| Tool | Flag | Default | What it does |
|---|---|---|---|
imagemagick | WORKSPACE_INSTALL_IMAGEMAGICK | off | Image manipulation, plus the PHP imagick extension. |
libpng | WORKSPACE_INSTALL_LIBPNG | off | PNG libraries some image tools need. |
ffmpeg | WORKSPACE_INSTALL_FFMPEG | off | Audio/video transcoding. |
audiowaveform | WORKSPACE_INSTALL_AUDIOWAVEFORM | off | BBC waveform data generator. |
image-optimizers | WORKSPACE_INSTALL_IMAGE_OPTIMIZERS | off | jpegoptim, optipng, pngquant, svgo and friends. |
wkhtmltopdf | WORKSPACE_INSTALL_WKHTMLTOPDF | off | Render HTML to PDF. |
poppler-utils | WORKSPACE_INSTALL_POPPLER_UTILS | off | pdftotext and other PDF tools. |
graphviz | WORKSPACE_INSTALL_GRAPHVIZ | off | Render .dot graphs to images. |
Shell & tools
| Tool | Flag | Default | What it does |
|---|---|---|---|
git-prompt | WORKSPACE_INSTALL_GIT_PROMPT | off | Show the current branch in your shell prompt. |
powerline | WORKSPACE_INSTALL_POWERLINE | off | Powerline status line for the prompt. |
mc | WORKSPACE_INSTALL_MC | off | Midnight Commander, a terminal file manager. |
lnav | WORKSPACE_INSTALL_LNAV | off | Log file navigator. |
linuxbrew | WORKSPACE_INSTALL_LINUXBREW | off | Homebrew for Linux, for anything not listed here. |
gnu-parallel | WORKSPACE_INSTALL_GNU_PARALLEL | off | Run shell jobs in parallel. |
fswatch | WORKSPACE_INSTALL_FSWATCH | off | Watch files and react to changes. |
inotify | WORKSPACE_INSTALL_INOTIFY | off | PHP inotify bindings for file watching. |
ping | WORKSPACE_INSTALL_PING | off | The ping command. |
dnsutils | WORKSPACE_INSTALL_DNSUTILS | on | dig, nslookup, for debugging container DNS. |
sshpass | WORKSPACE_INSTALL_SSHPASS | off | Non-interactive SSH passwords, for scripts. |
subversion | WORKSPACE_INSTALL_SUBVERSION | off | The svn client. |
smb | WORKSPACE_INSTALL_SMB | off | SMB/CIFS client, for Windows shares. |
supervisor | WORKSPACE_INSTALL_SUPERVISOR | off | Keep queue workers and daemons running. |
DevOps
| Tool | Flag | Default | What it does |
|---|---|---|---|
docker-client | WORKSPACE_INSTALL_DOCKER_CLIENT | off | The docker command inside the workspace. See Docker-in-Docker. |
terraform | WORKSPACE_INSTALL_TERRAFORM | off | The Terraform CLI. |
github-cli | WORKSPACE_INSTALL_GITHUB_CLI | off | The gh command. |
protoc | WORKSPACE_INSTALL_PROTOC | off | Protocol Buffers compiler. |
workspace-ssh | WORKSPACE_INSTALL_WORKSPACE_SSH | off | Run an SSH server in the workspace. See SSH into the Workspace. |
Other languages
| Tool | Flag | Default | What it does |
|---|---|---|---|
python | WORKSPACE_INSTALL_PYTHON | off | Python 2 and pip. |
python3 | WORKSPACE_INSTALL_PYTHON3 | off | Python 3 and pip3. |
jdk | WORKSPACE_INSTALL_JDK | on | Java Development Kit. Only needed for tools that run on Java. |
See the sections below for setup instructions on individual tools, and the PHP-FPM guide for extension-specific install/config guides (Xdebug, pcov, phpdbg, YAML, rdkafka, ionCube, etc.) that apply to workspace as well as php-fpm.
Published ports
workspace/compose.yml exposes several dev-server ports on the host, all overridable in .env:
| Variable | Default | Used for |
|---|---|---|
WORKSPACE_SSH_PORT | 2222 | SSH into the container (if WORKSPACE_INSTALL_WORKSPACE_SSH=true). |
WORKSPACE_BROWSERSYNC_HOST_PORT | 3000 | Browsersync. |
WORKSPACE_BROWSERSYNC_UI_HOST_PORT | 3001 | Browsersync UI. |
WORKSPACE_VUE_CLI_SERVE_HOST_PORT | 8080 | vue-cli-service serve. |
WORKSPACE_VUE_CLI_UI_HOST_PORT | 8001 | Vue CLI UI. |
WORKSPACE_ANGULAR_CLI_SERVE_HOST_PORT | 4200 | Angular CLI dev server. |
WORKSPACE_VITE_PORT | 5173 | Vite dev server. |
User and permissions
WORKSPACE_PUID/WORKSPACE_PGID (default 1000/1000) set the UID/GID of the laradock user inside the container. Match these to your host user if you're on Linux and hitting file-ownership mismatches on files created inside the container.
Change the PHP-CLI version
The PHP-CLI lives in the Workspace container and is used only for Artisan and Composer, it does not serve your application code (that's PHP-FPM's job), so changing it is usually optional.
- In
.env, setPHP_VERSIONto the version you want:PHP_VERSION=8.1 - Rebuild the Workspace:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Install the rdkafka extension
Needed for composer install when your dependencies require Kafka.
- In
.env, setWORKSPACE_INSTALL_RDKAFKAtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
To install rdkafka for the PHP-FPM container instead (the one that actually serves your app), see Install the rdkafka extension on the PHP-FPM guide.
Install the AST extension
AST exposes the abstract syntax tree generated by PHP 7+. It's required by tools such as Phan, a static analyzer. WORKSPACE_INSTALL_AST defaults to true, so it's already installed unless you've turned it off.
- In
.env, setWORKSPACE_INSTALL_ASTtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
To pin a specific version, set
WORKSPACE_AST_VERSIONbefore rebuilding.
Node.js & NVM
- In
.env, setWORKSPACE_INSTALL_NODEtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
A
.npmrcis included in theworkspacefolder and is copied into the root and laradock users' home directories on build, in case you need global npm config.
Package managers
pnpm
pnpm stores a single copy of each package version on disk and hard-links it into each project's node_modules, saving large amounts of space and speeding up installs. More on the pnpm motivation.
- In
.env, set bothWORKSPACE_INSTALL_NODEandWORKSPACE_INSTALL_PNPMtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Yarn
- In
.env, set bothWORKSPACE_INSTALL_NODEandWORKSPACE_INSTALL_YARNtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
npm-check-updates
npm-check-updates upgrades your package.json dependencies to the latest versions.
- In
.env, make sureWORKSPACE_INSTALL_NODEistrue. - Set
WORKSPACE_INSTALL_NPM_CHECK_UPDATES_CLItotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Frontend build tool CLIs
Gulp
- In
.env, setWORKSPACE_INSTALL_NPM_GULPtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Bower
Legacy. Bower is deprecated, prefer npm, Yarn, or pnpm for new projects.
- In
.env, setWORKSPACE_INSTALL_NPM_BOWERtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Vue CLI
- In
.env, setWORKSPACE_INSTALL_NPM_VUE_CLItotrue. - Optionally change the ports:
WORKSPACE_VUE_CLI_SERVE_HOST_PORT(default8080) andWORKSPACE_VUE_CLI_UI_HOST_PORT(default8001). - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Run vue serve or vue ui from the Workspace, then browse to the matching port.
Angular CLI
- In
.env, setWORKSPACE_INSTALL_NPM_ANGULAR_CLItotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Composer extras
Global Composer install
Install your global Composer requirements at build time so they're available in the container afterward.
- In
.env, setWORKSPACE_COMPOSER_GLOBAL_INSTALLtotrue. - Add your dependencies to
workspace/composer.json. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Prestissimo
Legacy. Prestissimo parallelized downloads for Composer 1 only and is abandoned. Composer 2 (Laradock's default) already downloads in parallel, so you almost certainly don't need this.
- Enable Global Composer install (steps 1-2 above).
- Add
"hirak/prestissimo": "^0.3"toworkspace/composer.json. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Deployment & task runners
Deployer
A deployment tool for PHP.
- In
.env, setWORKSPACE_INSTALL_DEPLOYERtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
See the Deployer documentation.
Laravel Envoy
A task runner.
- In
.env, setWORKSPACE_INSTALL_LARAVEL_ENVOYtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
See the Laravel Envoy documentation.
System utilities
Linuxbrew
Linuxbrew is the Linux port of Homebrew.
- In
.env, setWORKSPACE_INSTALL_LINUXBREWtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Supervisor
Supervisor monitors and controls long-running processes on UNIX-like systems.
- In
.env, set bothWORKSPACE_INSTALL_SUPERVISORandWORKSPACE_INSTALL_PYTHONtotrue. - Create a worker config in
php-worker/supervisord.d/by copyinglaravel-worker.conf.example. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
GNU Parallel
GNU Parallel runs multiple processes concurrently from the command line.
- In
.env, setWORKSPACE_INSTALL_GNU_PARALLELtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
dnsutils
- In
.env, set both flags totrue:WORKSPACE_INSTALL_DNSUTILSPHP_FPM_INSTALL_DNSUTILS
- Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace php-fpm
docker compose build workspace php-fpm
Media & document tools
FFmpeg
- In
.env, setWORKSPACE_INSTALL_FFMPEGtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
If you queue conversions, also install FFmpeg in the php-worker and php-fpm containers (same flag pattern), otherwise the php-ffmpeg binary errors out.
BBC audiowaveform
audiowaveform generates waveform data from MP3, WAV, FLAC, or Ogg Vorbis files, for rendering visual waveforms.
- In
.env, setWORKSPACE_INSTALL_AUDIOWAVEFORMtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
If you queue processing, also install it in the php-worker, laravel-horizon, and php-fpm containers (same flag pattern), otherwise the audiowaveform binary errors out.
wkhtmltopdf
wkhtmltopdf renders a PDF from HTML.
- In
.env, setWORKSPACE_INSTALL_WKHTMLTOPDFtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Also install it in the php-fpm container (same flag pattern), otherwise the wkhtmltopdf binary errors out.
poppler-utils & antiword
poppler-utils is a set of PDF command-line tools (info, text/image extraction, format conversion, signature verification, and more). It's commonly paired with antiword, so Laradock installs both together when the flag is set.
- In
.env, set the flag totruefor each container you need it in:WORKSPACE_INSTALL_POPPLER_UTILS,PHP_FPM_INSTALL_POPPLER_UTILS,PHP_WORKER_INSTALL_POPPLER_UTILS,LARAVEL_HORIZON_INSTALL_POPPLER_UTILS. - Rebuild the affected containers:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace php-fpm php-worker laravel-horizon
docker compose build workspace php-fpm php-worker laravel-horizon
Graphviz
Graphviz renders graphs from text descriptions. Enable it in whichever container needs it:
| Container | Flag | Rebuild |
|---|---|---|
| Workspace | WORKSPACE_INSTALL_GRAPHVIZ | ./laradock rebuild workspace |
| PHP-FPM (most common) | PHP_FPM_INSTALL_GRAPHVIZ | ./laradock rebuild php-fpm |
| PHP-Worker | PHP_WORKER_INSTALL_GRAPHVIZ | ./laradock rebuild php-worker |
Set the flag to true, then rebuild.
GitHub Copilot CLI
Requires GitHub Copilot access.
- In
.env, setWORKSPACE_INSTALL_GITHUB_CLItotrue. - Rebuild the Workspace:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
- Enter the Workspace:
- Laradock CLI
- Docker Compose
./laradock workspace
docker compose exec workspace bash
(The CLI shortcut starts workspace for you first if it isn't already running; with plain Docker Compose, run docker compose up -d workspace first if needed.)
- Authenticate, then install the Copilot extension:
gh auth logingh extension install github/gh-copilot
Shell & terminal
Oh My Zsh
Oh My Zsh manages your Zsh configuration. Laradock wires it up with the Laravel autocomplete plugin.
- In
.env, setSHELL_OH_MY_ZSHtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
- Use it: enter the Workspace (
./laradock workspace, ordocker compose exec --user=laradock workspace bash), then runzsh.
Configure it by editing
/home/laradock/.zshrcin the running container.
Optional plugins:
- Autosuggestions: set
SHELL_OH_MY_ZSH_AUTOSUGESTIONStotrue, then rebuild. Suggests commands as you type, from history and completions (zsh-autosuggestions). - Bash aliases: set
SHELL_OH_MY_ZSH_ALIASEStotrue, then rebuild, to load Laradock'saliases.shinto Zsh.
Git Bash prompt
A bash prompt showing the current branch, diff with remote, and counts of staged/changed files.
- In
.env, setWORKSPACE_INSTALL_GIT_PROMPTtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Customize it by editing
workspace/gitprompt.shand rebuilding. See the bash-git-prompt repo.
Terminal aliases
On startup, Laradock copies workspace/aliases.sh into the container and sources it from ~/.bashrc. Edit that file to add your own aliases or function macros.
Powerline
- In
.env, set bothWORKSPACE_INSTALL_POWERLINEandWORKSPACE_INSTALL_PYTHONtotrue(Powerline requires Python). - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
Run a one-off command without entering the shell
For a single command (a CI-style composer install, an Artisan call from a script, etc.) you don't need an interactive session at all:
docker compose exec workspace composer install
docker compose exec -u laradock workspace php artisan migrate
There's no dedicated ./laradock shortcut for this (only for opening an interactive shell), plain docker compose exec is already the simplest form.
SSH into the Workspace
Useful for pointing an IDE's remote interpreter (PhpStorm, VS Code Remote-SSH) or a deploy tool at the container over SSH instead of Docker's own exec.
- In
.env, setWORKSPACE_INSTALL_WORKSPACE_SSHtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
- Connect to
localhostonWORKSPACE_SSH_PORT(2222by default) asroot, using the bundledworkspace/insecure_id_rsakey:
ssh -p 2222 -i workspace/insecure_id_rsa root@localhost
That key is called "insecure" for a reason, it ships in the repo and is the same for every Laradock install. Fine for a purely local dev container reachable only from your own machine; if the port is ever exposed beyond localhost (a shared dev server, a cloud sandbox), replace workspace/insecure_id_rsa/.pub with your own key pair before rebuilding, or don't enable SSH access at all and use ./laradock workspace/docker compose exec instead.
Docker CLI inside the Workspace (Docker-in-Docker)
workspace can run docker/docker compose commands of its own, wired to a sibling docker-in-docker container (docker:29-dind) rather than your host's Docker socket. This is what lets tools like Testcontainers or Sail-style build scripts work from inside the Workspace.
- In
.env, setWORKSPACE_INSTALL_DOCKER_CLIENTtotrue. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH are already set on the container's environment (see workspace/compose.yml), so once you're inside (./laradock workspace), docker ps/docker build/docker compose ... just work against the docker-in-docker sibling, completely isolated from your host's Docker.
Private Composer packages (auth.json)
If composer install needs credentials for a private registry (private Packagist, a private Satis, Magento's repo.magento.com, etc.):
- Set
WORKSPACE_COMPOSER_AUTH_JSONtotruein.env. - Put your real credentials in
workspace/auth.json(Composer's standardauth.jsonformat), the file already exists as a placeholder in that folder. - Rebuild:
- Laradock CLI
- Docker Compose
./laradock rebuild workspace
docker compose build workspace
workspace/auth.json holds real credentials once you fill it in, don't commit it to your app's repo.
Common issues
- A tool you enabled isn't there.
WORKSPACE_INSTALL_*flags only take effect on build, not on a plain restart:./laradock rebuild workspacethen./laradock start workspace. - Files created in the container are owned by the wrong user on your host. Set
WORKSPACE_PUID/WORKSPACE_PGIDto match your host user'sid -u/id -g, then rebuild. - Composer/npm installs are painfully slow. Set
WORKSPACE_COMPOSER_REPO_PACKAGISTorWORKSPACE_NPM_REGISTRYto a closer mirror, orCHANGE_SOURCE=trueif you're behind the Great Firewall (switches apt sources to a Tsinghua mirror). - Xdebug and Blackfire both enabled, neither works right. They can't coexist in the same PHP process, the build skips the Blackfire probe entirely when
WORKSPACE_INSTALL_XDEBUG=true.
Need the container that actually runs your PHP app? See the PHP-FPM guide. New to Laradock? Start at Getting Started.