"Hello World" Examples PHP Laravel

Laravel showcase

A Laravel application connected to PostgreSQL, Valkey (Redis-compatible), S3-compatible object storage, and Meilisearch, running on Zerops with six ready-made environment configurations โ€” from AI agent and remote development to stage and highly-available production.

ZCP configuration
Coding Agent
Claude Code
Subscription Login
Cloud IDE
VS Code
Public Access
Connected services
app dev
Lightweight project core
Single dedicated container with balancers (L3/L7), logger and statistics services
appdev
PHP+Nginx

Container

1Shared Core

0.5 GBRAM

GBDisk (SSD)

 GitHub repo
appstage
PHP+Nginx

Container

1Shared Core

0.5 GBRAM

GBDisk (SSD)

 GitHub repo
workerstage
PHP+Nginx

Container

1Shared Core

0.5 GBRAM

GBDisk (SSD)

 GitHub repo
db:5432,:6432
PostgreSQL

Container

1Shared Core

0.25 GBRAM

GBDisk (SSD)

redis:6379,:6380
Valkey

Container

1Shared Core

0.25 GBRAM

GBDisk (SSD)

storage
Object storage

External

GBSize

search:7700
Meilisearch

Container

1Shared Core

0.25 GBRAM

GBDisk (SSD)

6Shared Cores

2.25 GBRAM

GBDisk (SSD)

GBObject storage

$10.96

Per month for
Resources cost
add
FreePer month for
Lightweight pkg.

After deploying one of the environments and getting to know Zerops, you have two paths forward. 1 Clone our GitHub repositories and use the whole recipe as a template, or if you already have an existing application on a similar stack, 2 integrate the recipe setup with your application.

or
Taking ownership of theenvironment

AI agent environment provides a development space for AI agents to build and version the app. It includes a dev service with the code repository and necessary development tools, a staging service, a low-resource database, a cache store, an object storage, and a search engine.

๐Ÿ“ฆClone the template repositories1Your ZCP Workspace is Ready2Authorize Claude Code3Option A: Fastest Loop via Browser IDE4Option B: Local Terminal Setup๐ŸWhat's next?

Taking ownership of the AI Agent environment

๐Ÿ“ฆ Clone the template repositories

Fork or clone the following to your local machine or GitHub account:

1. Your ZCP Workspace is Ready

The deploy creates your app runtimes, managed dependencies, and the zcp@1 workspace. The agent, terminal, and browser IDE run inside this specific service. App code still deploys to the app runtimes, not to zcp.

Service Dashboard

2. Authorize Claude Code

When provisioning finishes, the dashboard opens the authentication flow. Use your own Claude Code subscription login or API credentials. This is handled separately from the Zerops token.

Authorize Agent

3. Option A: Fastest Loop via Browser IDE

After authentication, continue into Browser VS Code. Remote setup keeps the browser IDE and bundled agent inside Zerops.

  • The workspace opens with files, ZCP configuration, terminal access, and the Claude Code panel.
  • You are inside the remote workspace where the agent can read live state and use MCP tools.
  • Ask for the app behavior in natural language, like "Build a task board for my team."
  • Open the final URL and try the behavior the agent says it verified.
Cloud IDE

4. Option B: Local Terminal Setup

If you prefer keeping the agent next to your local files and editor, you can connect your machine directly to the internal network.

  • Log in to the Zerops dashboard, navigate to User Settings, and create a new personal access token.
  • Run npm i -g @zerops/zcli in your terminal to install the CLI.
  • Run zcli login <personal-access-token> and replace the placeholder with your copied key.
  • Run zcli vpn up and select your specific project to establish a secure tunnel.
  • Run ssh -A <service-name>.zerops to log directly into your application containers.
Generate Token

๐Ÿ What's next?

See how the applications were integrated with Zerops

Even when you use this recipe as a template, it's good to have an idea of what steps were taken to best integrate the apps into Zerops.

Deploy environments for the rest of the development lifecycle

One environment rarely tells the full story โ€” deploy environments for other stages of development to see how they work on Zerops.

Knowledge Base

PHP+Nginxappdevappstageworkerstage

zerops-recipe-apps/laravel-showcase-app

Gotchas

  • No .env file โ€” Zerops injects environment variables as OS env vars. Creating a .env file with empty values shadows the OS vars, causing env() to return null for every key that appears in .env even if the platform has a value set.
  • Cache commands in initCommands, not buildCommands โ€” config:cache, route:cache, and view:cache bake absolute paths into their cached files. The build container runs at /build/source/ while the runtime serves from /var/www/. Caching during build produces paths like /build/source/storage/... that crash at runtime with "directory not found."
  • APP_KEY is project-level โ€” Laravel's encryption key must be shared across all services that read the same database (app + worker both need the same key for sessions and encrypted columns). Set it once at project level in Zerops; do not add it per-service or in zerops.yaml envVariables.
  • PDO PostgreSQL extension โ€” The php-nginx base image includes pdo_pgsql out of the box. No prepareCommands or apk add needed for PostgreSQL connectivity.
  • Predis over phpredis โ€” The php-nginx base image does not include the phpredis C extension. Use the predis/predis Composer package and set REDIS_CLIENT=predis to avoid "class Redis not found" errors.
  • Object storage requires path-style โ€” Zerops object storage uses MinIO, which requires AWS_USE_PATH_STYLE_ENDPOINT=true. Without it, the SDK attempts virtual-hosted bucket URLs that MinIO cannot resolve.
  • Vite manifest missing on dev after fresh deploy โ€” the dev setup intentionally omits npm run build from buildCommands so the HMR workflow (npm run dev via SSH) stays fast. Any view rendering @vite(...) therefore 500s with Vite manifest not found at: /var/www/public/build/manifest.json on the first request after a zerops_deploy. Fix: run ssh appdev 'cd /var/www && npm run build' once after the deploy and before zerops_verify โ€” SSHFS propagates the manifest into the container without a redeploy. For iterative work, ssh appdev 'cd /var/www && nohup npm run dev > /tmp/vite.log 2>&1 &' drops public/build/hot and Laravel routes asset URLs to the dev server. Do NOT add npm run build to dev buildCommands โ€” it adds ~20โ€“30 s to every zcli push and defeats the HMR-first design.