Deployment Steps on Hostinger

To deploy an app like https://sea-lion-app-v962e.ondigitalocean.app/ on Hostinger, follow these steps based on your tech stack (Node.js, Next.js, React.js, MySQL, etc.).


๐Ÿš€ Deployment Steps on Hostinger

1. Choose a Hosting Plan

  • Use Hostinger's VPS Hosting (for Node.js apps) or

For a Node.js or Next.js app, VPS is recommended.


2. Set Up Your Server (For VPS)

  1. Log in to Hostinger → Go to VPS Dashboard
  2. Choose Ubuntu 22.04 (or latest) as the OS
  3. Use SSH to connect to your server:
    ssh username@your-server-ip
    

3. Install Node.js, PM2, and Nginx,  and Mysql

Run these commands:

sudo apt update && sudo apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs nginx
sudo npm install -g pm2

4. Upload Your App

โœ… Option 1: Use Git

  1. Install Git:
    sudo apt install git -y
    
  2. Clone your repository:
    git clone https://github.com/your-repo.git
    cd your-repo
    

โœ… Option 2: Use Hostinger's File Manager

  • Zip your project
  • Upload via File Manager in Hostinger
  • Extract the files in /home/your-project/

5. Install Dependencies & Start the App

  1. Inside your project folder, run:
    npm install
    npm run build  # For Next.js apps
    
  2. Start the app using PM2:
    pm2 start npm --name "my-app" -- start
    pm2 save
    

6. Configure Nginx (For Custom Domains & Reverse Proxy)

  1. Open the Nginx config file:
    sudo nano /etc/nginx/sites-available/default
    
  2. Replace contents with:
    server {
        listen 80;
        server_name yourdomain.com;
    
        location / {
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }
    }
    
  3. Save & restart Nginx:
    sudo systemctl restart nginx
    

7. Link a Domain (Optional)

  • Go to Hostinger → Domains → Manage
  • Set A Record to point to your VPS IP
  • Set CNAME for www.yourdomain.com → yourdomain.com

๐ŸŽฏ Your App is Live!

Visit http://yourdomain.com ๐ŸŽ‰

Would you like help with specific database setup, SSL (HTTPS), or auto-deployment (GitHub Actions)? ๐Ÿš€


Was this article helpful?