Deploy an Angular App

This tutorial walks you through deploying an Angular application on Temps. Whether you are building a static SPA or using Angular SSR, Temps handles both configurations.


What you will build

  • An Angular app deployed from a Git repository
  • Static or SSR deployment
  • Automatic HTTPS and deployment on every push

Time required: 10 minutes.

Prerequisites:

  • A running Temps instance (install guide)
  • An Angular app in a Git repository
  • (Optional) A custom domain

Option A: Static Angular SPA

Step 1: Prepare your app

Verify your package.json has the build script:

package.json

{
  "name": "my-angular-app",
  "scripts": {
    "start": "ng serve",
    "build": "ng build"
  },
  "dependencies": {
    "@angular/core": "^19.0.0"
  }
}

Angular builds static files to dist/<project-name>/browser/ by default. Temps detects this and serves them.

Step 2: Deploy

  1. Open the Temps dashboard and create a new project
  2. Connect your repository
  3. Temps detects Angular and configures the build
  4. Push to deploy
bunx @temps-sdk/cli projects create -n "my-angular-app" -d "Angular application"
bunx @temps-sdk/cli projects git -p my-angular-app --owner yourorg --repo my-angular-app --branch main --preset static -y
bunx @temps-sdk/cli deploy my-angular-app -b main -e production -y

Option B: Angular SSR

Step 1: Prepare your app

Angular 19+ includes SSR support. Make sure your angular.json has SSR enabled:

angular.json (excerpt)

{
  "projects": {
    "my-app": {
      "architect": {
        "build": {
          "options": {
            "outputMode": "server"
          }
        }
      }
    }
  }
}

Step 2: Create a Dockerfile

Dockerfile

FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
EXPOSE 4000
CMD ["node", "dist/my-app/server/server.mjs"]

Step 3: Deploy

Connect your repository and push:

bunx @temps-sdk/cli deploy my-angular-app -b main -e production -y

Environment variables

Angular does not have built-in runtime environment variable support. Common patterns:

  1. Build-time: Use environment.ts files and swap at build time
  2. Runtime: Fetch a config JSON file at startup

For build-time variables, set them in Temps and reference in your build:

API_URL=https://api.example.com

What to do next

Was this page helpful?