This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the AngularJS on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.
- A server running one of the following operating systems: AlmaLinux 9.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install AngularJS on AlmaLinux 9
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf clean all sudo dnf update
Step 2. Installing Node.js on AlmaLinux 9.
By default, Node.js is available on the AlmaLinux 9 base repository. Now, checklist the available Nodejs streams by running the following command:
sudo dnf module list nodejs
From the above output, Node.js version 10 is the default. To install another latest version, we need to enable and install it using this command below:
sudo dnf module enable nodejs:16 sudo dnf install nodejs
Finally, verify Node.js and NPM versions using this command:
$ node -v v16.15.1
$ npm -v 8.13.1
Step 3. Installing AngularJS on AlmaLinux 9.
By default, AngularJS is not available on the AlmaLinux 9 base repository. Simply run the following command below to install Angular CLI to your AlmaLinux system:
sudo npm install -g @angular/cli
Verify the AngularJS version installed once the installation is complete:
[root@idroot ~]# ng --version Angular CLI: 14.0.3 Node: 16.15.1 Package Manager: npm 8.13.1 OS: linux x64 Angular: ... Package Version ------------------------------------------------------ @angular-devkit/architect 0.1400.3 (cli-only) @angular-devkit/core 14.0.3 (cli-only) @angular-devkit/schematics 14.0.3 (cli-only) @schematics/angular 14.0.3 (cli-only)
Step 4. Create Sample Angular Application.
You may use the
ng command to create a new AngularJS application:
ng new MyApplication
Next, change into the newly created
MyApplication directory with the following command below:
Serve up the new application with the command:
ng serve --host 0.0.0.0
Once the create a sample project, you can now access it on the URL from your browser: