Skip to content

About

Angular starter template from Cloudways with PM2 and Apache proxy configuration to help developers get started with Angular applications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Cloudways Angular Template

A minimal Angular starter you can deploy on Cloudways Velocity — managed Node.js hosting with NGINX, PM2, SSL, and Git-based deploys — or any other host.

Includes a Cloudways-branded sample home page so you can confirm the deploy worked, then replace it with your own site.

Velocity supports client-side frameworks such as Angular, so you do not need Apache .htaccess, mod_proxy, or manual SSH/PM2 setup used on classic Cloudways Flexible servers.

What’s in this repo

File / folder Purpose
src/app/ Cloudways-branded sample home page
public/ Logo, favicon, and hero assets
package.json Build + start scripts for Velocity (app port 3000)
angular.json Angular project config (cli.analytics: false)

Build and start commands used by Velocity:

npm run build   # → NG_CLI_ANALYTICS=false ng build
npm start       # → serve the browser build on port 3000

Prerequisites

  • A Cloudways account with Velocity access
  • This repository pushed to GitHub (or another Git provider Velocity can connect to)
  • A domain (optional at first; Velocity provides a default URL)
  • Node.js 20.x, 22.x, or 24.x LTS (selectable per app in Velocity)

Environment variables (required on Velocity)

Velocity has no interactive terminal for CLI prompts. Set this in the Velocity app Environment Variables panel so Angular CLI never asks about analytics during build/start:

Variable Value Notes
NG_CLI_ANALYTICS false Disables Angular CLI analytics prompts and telemetry
NG_CLI_ANALYTICS=false

This template also sets NG_CLI_ANALYTICS=false inside npm scripts and "analytics": false in angular.json, but you should still add the env var in Velocity so non-interactive deploys stay quiet even if scripts change.

Optional:

Variable Example Notes
NODE_ENV production Standard production flag
PORT 3000 Velocity’s app port (keep 3000 unless Cloudways docs say otherwise)

Quick start (local)

git clone https://github.com/YOUR_USERNAME/cloudways-angular-template.git
cd cloudways-angular-template
npm install
npm run dev

Open http://localhost:4200 to see the Cloudways-branded sample home page.

Command Description
npm run dev Local Angular dev server (ng serve, port 4200)
npm run build Production browser build → dist/cloudways-angular-template/browser/
npm start Serve the production build on port 3000 (Velocity-style)
npm run preview Preview the production build locally on port 4200

Local smoke test of the Velocity start command:

npm run build
NG_CLI_ANALYTICS=false npm start
# open http://localhost:3000

1. Push this repository

git clone https://github.com/YOUR_USERNAME/cloudways-angular-template.git
cd cloudways-angular-template
git remote -v   # confirm origin points at your GitHub repo
git push -u origin main

Velocity deploys from Git — keep package.json and package-lock.json on the branch you will connect (usually main).

2. Create a Velocity application

  1. Open the Cloudways platform and go to Velocity.
  2. Click Get Started / create a new application.
  3. Connect your Git provider and select this repository.
  4. Choose branch main (or your deploy branch).
  5. Set framework to Angular (or Node.js / custom if Angular is not listed).
  6. Select Node.js 20.x, 22.x, or 24.x.
  7. Confirm build and start commands:
    • Build: npm run build
    • Start: npm start
  8. Add environment variables (see above), especially NG_CLI_ANALYTICS=false.
  9. Pick a plan size and deploy.

Velocity handles NGINX reverse proxy, PM2 process management, OS patching, and SSL for the default hostname. No .htaccess or Apache proxy setup is required.

3. Custom domain and SSL

  1. In Velocity, open your application → Domains (or equivalent).
  2. Add your domain / subdomain.
  3. Point DNS (A/CNAME) as instructed by Cloudways.
  4. Wait for SSL provisioning.
  5. Redeploy if needed, then open the custom domain.

4. Verify the install

  1. Open your Velocity app URL (or custom domain).
  2. You should see the Cloudways-branded sample home page stating this is a sample app from Cloudways.
  3. In Velocity logs, confirm the process is running and listening on port 3000.

Deploy elsewhere

This template is host-agnostic. Build once, then either run npm start (Node static server on 3000) or publish the browser folder as static files.

Platform Notes
Netlify / Vercel / Cloudflare Pages Build: npm run build; publish dist/cloudways-angular-template/browser
GitHub Pages Build in CI and publish dist/cloudways-angular-template/browser/
Nginx / VPS / Docker Serve that folder as the document root, or run npm start behind a reverse proxy

Project structure

.
├── public/                 # Static assets (copied into the browser build)
│   ├── cloudways-logo.svg
│   ├── favicon.ico
│   ├── favicon.svg
│   └── hero-cloud.svg
├── src/
│   ├── app/                # Root component (sample home page)
│   ├── index.html          # HTML shell + fonts
│   ├── main.ts             # Bootstrap
│   └── styles.css          # Cloudways brand tokens
├── angular.json            # Angular config (analytics disabled)
└── package.json            # Velocity build / start scripts

Customization

  1. Edit src/app/app.component.html (and .css) to replace the sample home page.
  2. Add routes in src/app/app.routes.ts and create components under src/app/.
  3. Put images and other static files in public/.
  4. Update site metadata in src/index.html.

Troubleshooting (Velocity)

Symptom What to check
Build hangs on analytics prompt Set NG_CLI_ANALYTICS=false in Velocity Environment Variables
App won’t start Velocity build logs; Node ≥ 20; npm run build succeeds
Blank page / 502 Process must listen on 3000; confirm Start is npm start
CSS/images 404 Confirm the build output under dist/cloudways-angular-template/browser/ was produced
Deep links 404 npm start uses SPA fallback (serve -s); confirm start command was not changed
Stale UI after push Trigger a Velocity redeploy after the new commit lands on the connected branch

Useful links

License

MIT — see LICENSE.

Contributing

PRs welcome. Fork, branch, and open a pull request.


Use this repo as a GitHub template: click Use this template on GitHub to create your own project from this starter.

About

Angular starter template from Cloudways with PM2 and Apache proxy configuration to help developers get started with Angular applications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages