Deploy Angular SSR to your own VPS with Node.js 24
Deploy an Angular app with server-side rendering to your own VPS: ox builds it, runs the server.mjs Angular writes under systemd, and Caddy adds HTTPS.
Last updated 2026-10-09
On this page
To deploy Angular SSR to a VPS with ox, add the repo as a project and deploy it, with no Dockerfile and no ox.toml. ox reads angular.json and package.json, runs npm install and npm run build, then starts node dist/store/server/server.mjs 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 Angular SSR repo in ox's tests. A deploy on a real server is not recorded yet.
angular.json and package.json, builds the plan on the card, and starts node dist/store/server/server.mjs on your server.What ox detects in a Angular SSR repo
This is the plan ox check prints for a minimal an Angular app with server-side rendering, 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 | node dist/store/server/server.mjs | detected:angular.json |
build.install | npm install | detected:package.json |
build.commands[0] | npm run build | detected:package.json |
tools.node | 24 | default |
The ox.toml for Angular SSR
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 Angular SSR
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 Angular SSR
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 Angular SSR deploy fails
build 1/1: npm run build: exit status 1: Your build failed. The lines above it are the build's own output; run the same command on your computer, fix it, and push. 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
- Angular: Deploy an Angular single-page app to your own VPS.
- 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.
Angular SSR FAQ
Do I need a Dockerfile or an ox.toml to deploy Angular SSR to a VPS?
No. ox does not use Docker, and ox check on a Angular SSR 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 Angular SSR?
Only what the plan names: node 24 (ox's default). Your app's own dependencies are installed by the build into the release folder, not system-wide.
How does ox know my Angular app renders on the server?
From angular.json: with server rendering on, ox runs the server.mjs the build writes under the output path, here dist/store/server/server.mjs.
Related guides
- Next.js static exportDeploy a Next.js app with output: 'export' to your own VPS: ox runs next build and Caddy serves the out folder over HTTPS, with no Node process running.
- GatsbyDeploy a Gatsby site to your own VPS: ox reads gatsby-config.js, runs gatsby build from package.json, and Caddy serves the public folder over HTTPS.
Every stack ox deploys, and the ones it does not yet, is on the Stacks page.