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)
- Log in to Hostinger → Go to VPS Dashboard
- Choose Ubuntu 22.04 (or latest) as the OS
- 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
- Install Git:
sudo apt install git -y - 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
- Inside your project folder, run:
npm install npm run build # For Next.js apps - Start the app using PM2:
pm2 start npm --name "my-app" -- start pm2 save
6. Configure Nginx (For Custom Domains & Reverse Proxy)
- Open the Nginx config file:
sudo nano /etc/nginx/sites-available/default - 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; } } - 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)? ๐