Deploy a plain PHP site to a VPS with FrankenPHP
Deploy a plain PHP site to your own VPS: ox finds index.php, installs FrankenPHP, and serves the site under systemd behind Caddy with HTTPS, no ox.toml.
Last updated 2026-10-09
On this page
To deploy a PHP site to a VPS with ox, add the repo as a project and deploy it, with no Dockerfile and no ox.toml. ox reads index.php, then starts frankenphp php-server --root . --listen 127.0.0.1:$PORT under systemd behind Caddy with HTTPS. Run ox check in your repo to see the same plan before the first deploy.
Plan verified, real-server test pending. The plan below is what ox check prints for a minimal Plain PHP repo in ox's tests. A deploy on a real server is not recorded yet.
index.php, builds the plan on the card, and starts frankenphp php-server --root . --listen 127.0.0.1:$PORT on your server.What ox detects in a Plain PHP repo
This is the plan ox check prints for a minimal a plain PHP site, with no ox.toml. Each row says where its value came from: a file in the repo, or ox's default.
| Field | Value | Source |
|---|---|---|
app.start | XDG_CONFIG_HOME=/tmp XDG_DATA_HOME=/tmp exec frankenphp php-server --root . --listen 127.0.0.1:$PORT | detected:index.php |
tools.github:php/frankenphp | 1.13.0 | default |
The ox.toml for Plain PHP
None is needed: the plan above comes from the repo alone. Write one to serve your own domain or to change what ox detected. This one passes ox check against the same repo: [app] keeps the detected start command and build.
domains = ["www.example.com"]
[app]Check and deploy Plain PHP
Add the repo as a project, then check and ship it from a terminal:
ox check # in the repo: the plan above, offline
ox new <owner/repo> --server <server> # add the repo as a project
ox deploy <project> --wait # stream the deploy, exit with its result
ox logs <project> --follow # the app's own logsVariables to set for Plain PHP
None before the first deploy: ox check asks for no variable. Add your own on the dashboard's Variables tab or with ox vars set <project> KEY.
ox provides these to the app itself: PORT, HOST, OX_ENV, OX_PROJECT, OX_RELEASE, OX_DATA_DIR, PUBLIC_URL and PUBLIC_HOST.
If the Plain PHP deploy fails
no index.php at the root or in public/; set [app] start = "frankenphp php-server --root <dir> --listen 127.0.0.1:$PORT": Putindex.phpat the root or inpublic/, or set[app] startwith your document root. More.TCP connect to 127.0.0.1:8001 did not answer within 120s: dial tcp 127.0.0.1:8001: connect: connection refused: The app started but never answered on the port ox gave it. Listen on127.0.0.1at$PORT; the lines above the message are the app's own output. More.web of shop on main keeps crashing: systemd restarted it 5 times in the last 10 minutes. The Logs tab shows why.: The release went live and then kept dying. Read the Logs tab for the error and deploy a fix, or roll back. More.
Your visitors never see a failed deploy: the previous release keeps serving until the new one passes its health check.
Next steps
- The Laravel guide: Composer, a queue worker and the scheduler.
- The
[app]keys: start, health check, memory and the rest. - Add a custom domain with one A record; Caddy gets the HTTPS certificate.
- Read the logs live, search them, or download them.
- Set variables and secrets on the dashboard or with
ox vars.
Plain PHP FAQ
Do I need a Dockerfile or an ox.toml to deploy a PHP site to a VPS?
No. ox does not use Docker, and ox check on a Plain PHP repo with no ox.toml prints Ready to deploy. Write an ox.toml only to change what ox detected.
What does ox install on the server for Plain PHP?
Only what the plan names: github:php/frankenphp 1.13.0 (ox's default). Your app's own dependencies are installed by the build into the release folder, not system-wide.
Do I need Composer?
Not for a site with no composer.json: the plan above installs only FrankenPHP and serves the folder that holds index.php.
Related guides
- PhoenixDeploy an Elixir Phoenix app to your own VPS: ox builds a mix release with its assets, runs Release.migrate, starts it under systemd, and adds PostgreSQL.
- Spring Boot (Maven)Deploy a Spring Boot app built with Maven to your own VPS: ox builds the jar with mvnw, installs Java 21, runs it under systemd and adds PostgreSQL for it.
Every stack ox deploys, and the ones it does not yet, is on the Stacks page.