How To Install Angular on Debian 13

Install Angular on Debian 13

Angular is one of the most powerful frontend frameworks in production today, and if you’re running Debian 13 Trixie, you’re working with one of the most stable Linux platforms available for development. Setting up Angular on a fresh Debian 13 system involves a few well-defined steps: updating your system, installing Node.js from the NodeSource repository, installing the Angular CLI globally, and scaffolding your first project. This guide walks you through every step of that process with exact commands, expected outputs, and real troubleshooting fixes you can apply immediately.

If you’ve been searching for a clean, no-fluff tutorial on how to install Angular on Debian 13, you’re in the right place. By the end of this guide, you’ll have Angular CLI 20.x running on top of Node.js 22.x LTS on your Debian 13 Trixie machine, ready for real development work. Whether you’re a developer spinning up a new workstation or a sysadmin configuring a remote VPS, this process takes under ten minutes to complete.

What Is Angular and Why Run It on Debian 13?

Angular is an open-source, TypeScript-based web application framework maintained by Google. It follows a component-based architecture, which means you build your UI out of self-contained, reusable building blocks. Companies like Microsoft, IBM, and Google itself use Angular to power large-scale enterprise applications, real-time dashboards, and single-page applications (SPAs).

Debian 13 Trixie is the current stable release of Debian GNU/Linux, released in August 2025. It ships with a modern kernel, long-term security support, and excellent compatibility with the NodeSource repository, which is the standard way to install a current Node.js version on Debian-based systems. Debian’s APT package manager, combined with its rock-solid stability, makes it a natural fit for Angular development environments on both desktops and servers.

What You Need to Know Before Starting

The Angular CLI is a Node.js-based command-line tool. That means Node.js is not optional; it is the runtime that makes Angular CLI work at all. Angular 20 specifically requires Node.js 18.x or higher, and the tested, recommended version on Debian 13 Trixie is Node.js 22.x LTS.

You do not need prior Angular experience to follow this guide. What you do need is access to a terminal and a few minutes of focused time.

Prerequisites Before You Begin

Before running a single command, confirm you have the following in place:

System Requirements:

  • Debian 13 Trixie installed (physical machine, VPS, or VM)
  • Minimum 4 GB RAM (8 GB recommended for larger Angular projects)
  • At least 10 GB free disk space
  • Dual-core CPU minimum (quad-core recommended)

Access and Permissions:

  • Root or sudo-level terminal access
  • Active internet connection for downloading packages from APT and npm

Knowledge Assumed:

  • Basic Linux command-line navigation (cd, ls, sudo)
  • Familiarity with a terminal text editor is helpful but not required
  • No prior Angular or Node.js experience is necessary

If you tick all of those boxes, you’re ready to move forward.

Step 1: Update and Upgrade Your Debian 13 System

Every solid Linux installation procedure starts here. Updating your system before installing new software prevents version conflicts, ensures APT’s package index is current, and closes known security gaps in installed packages.

Run the following commands:

sudo apt update
sudo apt upgrade -y

What these commands do:

  • sudo apt update refreshes the local package index from all configured repositories. It does not install anything; it only tells your system what packages are available and at what versions.
  • sudo apt upgrade -y installs newer versions of all currently installed packages. The -y flag auto-confirms prompts so you don’t have to type “yes” repeatedly.

On a fresh Debian 13 Trixie install, this step can take one to three minutes depending on how many pending updates exist. Once it finishes, run one optional cleanup command:

sudo apt autoremove -y

This removes orphaned packages no longer needed by other software, freeing disk space. With the system fully updated, you’re ready to install Node.js.

Step 2: Install Node.js 22.x LTS on Debian 13 via NodeSource

This is the most important dependency step. The Angular CLI runs on Node.js, and the version of Node.js matters. Debian 13’s default APT repositories do not always ship the latest Node.js LTS release, which means you need to add the NodeSource repository to get Node.js 22.x.

Why NodeSource Instead of the Default APT Repo?

Debian’s default Node.js package is often one or two major versions behind the current LTS release. Angular 20 requires Node.js 18.x as a minimum, with 22.x being the recommended version for full compatibility with Debian 13 Trixie. Using NodeSource ensures you get the correct, up-to-date version every time.

Add the NodeSource Repository and Install Node.js

Run this command to download and execute the NodeSource setup script for Node.js 22.x:

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -

What this does:

  • curl -fsSL downloads the setup script silently, with error handling enabled (-f fails on server errors, -s runs silently, -S shows errors if they occur, -L follows redirects)
  • sudo -E bash - runs the downloaded script as root while preserving the current user’s environment variables
  • The script adds the NodeSource signing key to APT and creates a new APT source entry for Node.js 22.x

After the script completes, install Node.js:

sudo apt install -y nodejs

Key detail: The NodeSource Node.js package bundles npm automatically. You do not need to install npm separately.

What npm Is and Why It Matters Here

npm (Node Package Manager) is the package manager bundled with Node.js. It installs, updates, and manages JavaScript libraries and tools, including Angular CLI itself. Every Angular project you create will use npm to manage its dependencies.

Step 3: Verify Node.js and npm Are Installed Correctly

Do not skip this step. Verifying your Node.js and npm installation before moving forward saves you from chasing mysterious Angular CLI errors later.

Run both version check commands:

node -v
npm -v

Expected output on Debian 13 Trixie:

v22.19.0
10.9.3

Your exact patch version may differ slightly depending on when you run this, but the major version should be 22.x for Node.js and 10.x for npm.

If either command returns command not found, your PATH is not yet updated. Fix it by reloading your shell:

source ~/.bashrc

If that still does not work, log out of your terminal session completely and log back in. The issue is almost always a PATH variable that has not refreshed yet. Do not proceed to the next step until both node -v and npm -v return valid version numbers.

Step 4: Install Angular CLI Globally on Debian 13

With Node.js and npm confirmed and working, you can now install the Angular CLI. The Angular CLI, invoked with the ng command, is the tool you’ll use for everything: creating projects, generating components, running the dev server, building production bundles, and running tests.

Run the Global Install Command

sudo npm install -g @angular/cli@20

Breaking down this command:

  • npm install installs a package from the npm registry
  • -g installs the package globally, making the ng command available system-wide from any directory
  • @angular/cli@20 pins the installation to the Angular 20.x release branch, which is the version tested and verified on Debian 13 Trixie

Expected terminal output:

added 348 packages in 11s
68 packages are looking for funding
  run `npm fund` for details

The npm fund message is informational only. It is not an error, not a warning, and not something you need to act on. It simply lists packages that request financial support from maintainers.

Installation typically completes within 15 to 30 seconds on a normal broadband connection.

Step 5: Verify Angular CLI Installation

Before creating a project, switch to a non-root user. Running Angular projects as root is a security risk and can also cause permission issues inside your project directories.

Switch to your regular user account if you’re currently in a root session, then run:

ng version

Expected output:

Angular CLI: 20.3.1
Node: 22.19.0
Package Manager: npm 10.9.3
OS: linux x64

Angular:
...
Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2003.1 (cli-only)
@angular-devkit/core         20.3.1 (cli-only)
@angular-devkit/schematics   20.3.1 (cli-only)
@schematics/angular          20.3.1 (cli-only)

The Angular: field shows no version number yet because you have not created a project. The Angular framework version installs per-project, not globally. The (cli-only) annotations on the @angular-devkit packages confirm this is your global CLI installation working correctly.

If ng returns command not found, reload your shell:

source ~/.bashrc

Step 6: Create Your First Angular Project on Debian 13

Now you run the command that actually scaffolds a real Angular application. This step confirms that your entire Angular on Debian 13 setup is working end to end.

Generate the Project

ng new hello-world

What ng new does:

  • Creates a new folder named hello-world
  • Scaffolds a complete Angular application with a standard directory structure
  • Installs all required npm dependencies into node_modules/
  • Initializes a Git repository in the project directory
  • Generates TypeScript configuration, Angular workspace config, and default component files

The CLI will ask you three interactive questions:

  1. Enable autocompletion? Choose Yes. This adds source <(ng completion script)> to your ~/.bashrc, enabling TAB-based autocomplete for all ng commands.
  2. Which stylesheet format would you like to use? Choose CSS if you’re getting started, or SCSS if you’re comfortable with Sass.
  3. Do you want to enable Server-Side Rendering (SSR)? You can safely choose No for now. SSR can be added later.

Expected confirmation output:

Packages installed successfully.
Successfully initialized git.

Navigate Into the Project Directory

cd hello-world

Your Angular project is now fully scaffolded and ready to run. The node_modules folder is already populated from the ng new step, so you do not need to run npm install separately.

Step 7: Serve and Access Your Angular Application

Start the Development Server

For a local machine, use the standard serve command:

ng serve

For a VPS or remote server where you need to access the app from a different machine, bind the server to all network interfaces:

ng serve --host 0.0.0.0 --port 4200

What each flag does:

  • --host 0.0.0.0 tells the dev server to listen on all available network interfaces, making it accessible from external IPs
  • --port 4200 specifies the port (4200 is the default; change it if that port is already occupied)

Expected terminal output:

Application bundle generation complete. [1.662 seconds]
Watch mode enabled. Watching for file changes...
→ Local:   http://localhost:4200/
→ Network: http://YOUR_SERVER_IP:4200/

The CLI may ask whether to share usage analytics with the Angular Team at Google. Choose No for a private development environment.

Open the App in Your Browser

  • Local machine: Open http://localhost:4200 in your browser
  • VPS / remote server: Open http://YOUR_SERVER_IP:4200

If the Angular welcome page loads with the Angular logo and a “Congratulations” message, your installation is complete and working. Press Ctrl + C in the terminal to stop the development server.

Important: ng serve is a development-only server. Do not use it to serve production traffic. For production deployments, use ng build to generate a static build, then serve it with Nginx or Apache.

Understanding the Angular Project File Structure

Getting oriented inside your project saves you hours of confusion later. Here is what the key files and folders in your hello-world project do:

  • src/ — all application source code lives here
  • src/app/ — root application component, including app.component.ts, app.component.html, and app.component.css
  • src/main.ts — the application bootstrap entry point; this is where Angular starts loading
  • src/index.html — the shell HTML file into which Angular injects the rendered application
  • angular.json — workspace and project configuration; controls builder options, assets, styles, and scripts
  • package.json — lists all project dependencies and available npm scripts (ng build, ng test, etc.)
  • tsconfig.json — TypeScript compiler configuration
  • node_modules/ — all installed npm packages; never edit this folder manually
  • .gitignore — pre-configured to exclude node_modules and build output from Git tracking

How To Update or Uninstall Angular CLI on Debian 13

Update Angular CLI to the Latest Version

For major CLI version updates, a clean uninstall-then-reinstall is more reliable than running npm update:

sudo npm uninstall -g @angular/cli
sudo npm install -g @angular/cli@latest
ng version

Running ng version after the reinstall confirms the new version is active.

Uninstall Angular CLI Completely

sudo npm uninstall -g @angular/cli

This removes the global CLI only. Existing Angular project folders and their node_modules directories are not affected. To also remove Node.js from your system:

sudo apt remove nodejs
sudo apt autoremove -y

Troubleshooting Common Angular Installation Issues on Debian 13

Error: “ng: command not found”

Cause: The npm global binary directory is not in your system PATH yet.

Fix: Reload your shell configuration:

source ~/.bashrc

If that does not resolve it, log out and back in. If the problem persists, add the npm bin directory to your PATH manually:

export PATH=$PATH:$(npm bin -g)

Error: “EACCES: permission denied” During npm install -g

Cause: You ran npm install -g without sudo, or the npm global prefix directory is owned by root.

Fix: Add sudo to the install command as shown in Step 4:

sudo npm install -g @angular/cli@20

Node.js Version Is Too Old

Cause: The node -v output shows a version below 18.x, meaning Debian’s default APT repo was used instead of NodeSource.

Fix: Remove the existing Node.js and reinstall using the NodeSource 22.x script from Step 2:

sudo apt remove nodejs
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Port 4200 Not Accessible on a VPS

Cause: Your server’s firewall is blocking inbound connections on port 4200.

Fix: Open the port using UFW:

sudo ufw allow 4200/tcp
sudo ufw reload

Then confirm your ng serve command uses --host 0.0.0.0 as shown in Step 7.

Slow ng new or npm Install Hanging

Cause: The npm registry is responding slowly, or your registry is misconfigured to point to a mirror.

Fix: Reset npm to the official registry:

npm config set registry https://registry.npmjs.org/

Then re-run ng new or your install command.

Congratulations! You have successfully installed Angular. Thanks for using this tutorial to install the latest version of Angular on Debian 13 “Trixie”. For additional help or useful information, we recommend you check the official Angular website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
r00t is a dedicated and highly skilled Linux Systems Administrator with over a decade of progressive experience in designing, deploying, and maintaining enterprise-grade Linux infrastructure. His professional journey began in the telecommunications industry, where early exposure to Unix-based operating systems ignited a deep and enduring passion for open-source technologies and server administration.​ Throughout his career, r00t has demonstrated exceptional proficiency in managing large-scale Linux environments, overseeing more than 300 servers across development, staging, and production platforms while consistently achieving 99.9% system uptime. He holds advanced competencies in Red Hat Enterprise Linux (RHEL), Debian, and Ubuntu distributions, complemented by hands-on expertise in automation tools such as Ansible, Terraform, Bash scripting, and Python.

Related Posts