Angular is a popular web application framework and development platform for creating efficient and sophisticated single‑page apps. While many hosting accounts provide automated installers, you may sometimes need to install Angular manually — for example, if you want a specific version or are working on an unmanaged server.

 

Why Install Angular Manually?

  • Greater control over version selection.

  • Works on unmanaged VPS or dedicated servers.

  • Useful for developers who want custom setups.

 

Steps to Install Angular Manually

  1. Log in to Your Account via SSH.

    • Use an SSH client to connect to your hosting account.

  2. Create a Node.js Application Environment.

    • Run the following command (replace example.com with your domain):

      Bash
      
      cloudlinux-selector create --json --interpreter nodejs --version 18 --app-root angdemo --domain example.com --app-uri angdemo angdemo
      
       
  3. Initialize Project Directory.

    • Navigate to the project folder:

      Bash
      
      cd ~/angdemo
      
       
    • Create a package.json file:

      {
        "name": "angdemo",
        "version": "1.0.0",
        "description": "My Demo App",
        "main": "app.js",
        "scripts": {
          "test": "echo \"Error: no test specified\" && exit 1"
        },
        "author": "",
        "license": "ISC"
      }
      

       

  4. Install Node.js Modules.

    • Replace username with your account username:

      Bash
      
      cloudlinux-selector install-modules --json --interpreter nodejs --user username --app-root angdemo angdemo
      
       
  5. Activate Virtual Environment.

    • Replace username with your account username:

      Bash
      
      source /home/username/nodevenv/angdemo/18/bin/activate && cd /home/username/angdemo
      
  6. Configure Git (Optional).

    • Angular uses Git for version control. Configure your details:

      Bash
      
      git config --global user.email "user@example.com"
      git config --global user.name "Username"
      
  7. Install Angular CLI.

    • Run:

      Bash
      
      npm config set strict-ssl false
      npm install -g @angular/cli
      

       

  8. Create a New Angular App.

    • Example:

      Bash
      
      ng new my-app
      
    • This generates a new Angular project named my-app.

 

Notes

  • Angular is compatible with all ruachost.com accounts.

  • Always use strong admin and database passwords.

  • Keep Angular updated to prevent vulnerabilities.

  • Consider enabling automatic backups for added protection.

這篇文章有幫助嗎? 0 用戶發現這個有用 (0 投票)

Powered by WHMCompleteSolution