Deployment Overview of MEAN on Server¶
Prerequisites and Basic Requirements¶
The deployment process requires a Linux server running either Debian or Ubuntu. The following system-level prerequisites must be met before proceeding:
- Operating System: Debian or Ubuntu
- Privileges: Root access or
sudoprivileges are required to install system packages and manage services. - Network: The server must have internet access to download packages and dependencies.
- Ports: Ensure that the default ports for PostgreSQL (5432) and the Node.js application are available and not blocked by external firewalls.
Application Installation Process¶
The MEAN stack components are installed using package managers and Node.js package manager (npm). The installation steps differ slightly based on the operating system version.
Debian Installation¶
On Debian systems, the following components are installed:
- Prerequisites: The
curl,gnupg, andsoftware-properties-commonpackages are installed and updated. - Node.js: Node.js version 18.x is installed via the NodeSource repository.
- PostgreSQL: The PostgreSQL database server is installed and configured to start automatically on boot.
- Angular CLI: The Angular Command Line Interface is installed globally.
- Express: The Express generator is installed globally.
- PostgreSQL Client: The
pgmodule for Node.js is installed to enable database connectivity.
Ubuntu Installation¶
On Ubuntu systems, the installation follows a similar pattern with specific versioning:
- Prerequisites: The
curl,gnupg, andsoftware-properties-commonpackages are installed and updated. - Node.js: Node.js version 14.x is installed via the NodeSource repository.
- PostgreSQL: The PostgreSQL database server is installed and configured to start automatically on boot.
- Angular CLI: The Angular Command Line Interface is installed globally.
- Express: The Express generator is installed globally.
- PostgreSQL Client: The
pgmodule for Node.js is installed.
Databases¶
The application utilizes PostgreSQL as its primary database.
- Connection Method: The application connects to the database using the
pgNode.js client library. - Storage Location: Database files are stored in the default PostgreSQL data directory managed by the operating system.
- Service Status: The PostgreSQL service is configured to be running and enabled to start automatically upon system boot.
Starting, Stopping, and Updating¶
The database service is managed using the system's service manager.
- Start PostgreSQL:
- Stop PostgreSQL:
- Restart PostgreSQL:
- Enable PostgreSQL on Boot:
The Node.js application components (Angular CLI, Express) are installed globally and are available in the system path immediately after installation. Updates to these components are performed by re-running the respective npm install commands with the desired version flags.