VPS

⌘K
  1. Home
  2. VPS
  3. Hostinger

Hostinger

Part 1: KVM VPS Setup and Basic Configuration

  1. Setting up your KVM VPS:
    • Overview of KVM virtual machines.
    • Accessing your VPS via SSH.
    • Basic Linux commands for server management.
  2. Server Hardening:
    • Setting up a firewall (UFW).
    • Configuring SSH keys for secure login.
    • Disabling root login for extra security.
    • Installing and configuring Fail2Ban for protection.

Part 2: Node.js Setup

  1. Installing Node.js & npm:
    • Using nvm (Node Version Manager) for easy management of Node.js versions.
    • Setting up your development environment.
  2. Setting up Node.js App Environment:
    • Installing necessary packages and dependencies.
    • Configuring environment variables and process management with pm2.
    • Setting up auto-start for Node.js apps on reboot.
  3. Nginx as a Reverse Proxy for Node.js:
    • Installing Nginx.
    • Configuring Nginx to serve as a reverse proxy for your Node.js app.
    • Enabling SSL for your Node.js app using Let’s Encrypt.

Part 3: Python/Django Setup

  1. Installing Python and Virtual Environments:
    • Installing Python 3 and pip for package management.
    • Setting up virtual environments with venv or virtualenv.
  2. Setting Up Django Application:
    • Installing Django and other dependencies.
    • Setting up the PostgreSQL or MySQL database.
    • Configuring the Django application for production (security settings, logging, etc.).
  3. Serving Django with Gunicorn and Nginx:
    • Installing and configuring Gunicorn to serve your Django app.
    • Configuring Nginx as a reverse proxy for Gunicorn.
    • Enabling SSL for Django application using Let’s Encrypt.

Part 4: PHP/WordPress Setup

  1. Installing PHP and Required Modules:
    • Installing PHP, PHP-FPM, and necessary PHP modules (e.g., php-mysql, php-xml).
    • Configuring PHP for performance optimization (caching, opcache, etc.).
  2. Installing WordPress:
    • Installing WordPress using the LAMP stack (Linux, Apache, MySQL, PHP).
    • Setting up MySQL database for WordPress.
    • Configuring Apache as the web server for WordPress.
  3. Configuring Nginx for WordPress (optional):
    • Setting up Nginx with PHP-FPM for WordPress.
    • Configuring caching and permalinks for performance.

Part 5: Laravel Setup

  1. Installing Laravel with Composer:
    • Installing Composer (PHP dependency manager).
    • Installing Laravel framework via Composer.
    • Setting up .env file for configuration.
  2. Configuring Apache or Nginx for Laravel:
    • Setting up Apache with mod_rewrite for Laravel routing.
    • Alternatively, setting up Nginx as the web server for Laravel.
    • Setting up a database (MySQL/PostgreSQL) for Laravel.
  3. Running Laravel on Production:
    • Configuring Laravel’s production environment settings.
    • Setting up Redis and queues for optimized background jobs.
    • Configuring SSL for Laravel app using Let’s Encrypt.

Part 6: Security and Optimization

  1. Configuring Firewall with UFW:
    • Securing server with firewall rules.
    • Allowing traffic for HTTP/HTTPS, SSH, and custom ports.
  2. Setting Up Backups and Monitoring:
    • Installing and configuring automated backups for your apps and databases.
    • Setting up system monitoring tools (e.g., htop, atop, fail2ban).
  3. Optimizing Web Servers (Nginx/Apache):
    • Tuning Nginx or Apache for high traffic.
    • Setting up gzip compression and browser caching.
    • Enabling HTTP/2 for faster page load times.

Part 7: Final Steps and Deployment

  1. Deploying Node.js, Django, Laravel Apps:
    • Setting up environment variables (e.g., .env, .bashrc).
    • Deploying your apps using Git or FTP.
  2. Setting Up Continuous Integration/Deployment (Optional):
    • Automating deployments using CI/CD tools (e.g., Jenkins, GitLab CI).
  3. Setting Up SSL and Security:
    • Installing SSL certificates using Let’s Encrypt.
    • Setting up HTTPS redirects.
    • Final server hardening checks

Articles

How can we help?