"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
Quick add
Mounted 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

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

GBRAM

GBDisk (SSD)

GBObject storage

$13.21

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 repositoriesPrerequisite: check authorization1Open your ZCP workspace2Start in the browser IDE3Connect from your local IDE or terminal4Work with the dev/stage flow5Move toward production
Deploy more environments

Taking ownership of the AI Agent environment

Clone the template repositories

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

Prerequisite: check authorization

After you deploy the AI Agent environment, an authorization dialog should appear.

Complete the Claude Code authorization before continuing. This is separate from your Zerops access token and uses your own Claude Code subscription or API credentials.

Claude Code authorization dialog in Zerops

1. Open your ZCP workspace

The deployment creates your app services and a zcp@1 workspace.

The agent, terminal, and browser IDE run inside the ZCP service. Your app still runs in the app services, not in the ZCP workspace.

ZCP workspace service in Zerops

2. Start in the browser IDE

The fastest way to work with the agent is to open the browser IDE from the ZCP service.

  • No local setup is required.
  • The agent runs close to your Zerops project.
  • It can inspect project context and use available MCP tools.
  • After the agent makes a change, open the app URL and verify the result.
Browser IDE with Claude Code in Zerops

3. Connect from your local IDE or terminal

If you prefer local tooling, connect your machine to the Zerops project network.

Install zCLI and log in:

bash
npm i -g @zerops/zcli
zcli login <personal-access-token>

Start the VPN:

bash
zcli vpn up

Connect to the remote service:

bash
ssh -A <service-name>.zerops

4. Work with the dev/stage flow

Use the development environment for fast iteration with the agent. Use staging to verify the result before moving toward production.

Typical flow:

  1. Ask the agent for a focused change.
  2. Review and test the result.
  3. Push the change to your repository or deploy with zcli push.
  4. Verify the result in staging.
  5. Continue with the production guide when ready.

5. Move toward production

When the staging version is ready, finish the production setup:

  • configure the deployment pipeline
  • set up your domain
  • check logs and runtime behavior
  • configure backups if the recipe includes a database
  • review scaling settings before real traffic arrives
Have an app already? Integrate Zerops into it

These services were wired into Zerops with per-service integration guides. Open the Integrate flow to follow the same steps for your own application.

Deploy more environments

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 buildCommandsconfig: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.

Related platform & services docs