Skip to main content

Command Palette

Search for a command to run...

🚀 Navigating the Shift: From Shared Hosting to VPS with Hostinger hPanel

Updated
5 min read
🚀 Navigating the Shift: From Shared Hosting to VPS with Hostinger hPanel
M

I’m Insaf Nilam, a full-stack developer passionate about crafting clean, efficient, and future-ready software. I love solving complex problems, exploring new tech stacks, and sharing my learnings through blogs. When I’m not coding, I’m probably tweaking deployments, experimenting with microservices, or geeking out over cloud architecture.

When I first deployed projects on Hostinger’s shared hosting, I realized something important:

The real struggle isn’t the code — it’s figuring out where everything lives, how .htaccess behaves, and how subdomains interact with deployments.

If you’ve been there, this guide is for you. We’ll go step by step through Hostinger Shared Hosting setup, highlight its quirks and limitations, and explore why and when you should move to a VPS.


🖥️ Hostinger Shared Hosting: Quick Setup

Shared hosting is perfect for small projects, blogs, or MVPs. It’s cheap, easy to use, and backed by Hostinger’s hPanel.

Setup Flow:

  1. Sign up → Example: Business Shared Hosting ($3.79/month).

  2. Choose website type → Skip or select "Empty website".

  3. Domain setup → Claim a free domain or connect an existing one.

  4. Server location → Choose the nearest server to your users.

  5. Finish setup → Hosting profile is created.

💡 Tip: If you’re new to Hostinger, create a new profile to avoid conflicts with old setups.

  1. Access hPanel → Websites → Manage Site → you should see your default Hostinger page.

⚙️Advanced Configuration

  • SSL: Install/reinstall Let’s Encrypt from hPanel.

  • PHP Config: Choose PHP version, enable necessary extensions.

  • SSH Access: Enable under Advanced → SSH. Add an SSH key for secure login.

cd ~/.ssh
ssh-keygen -t ed25519 -f ~/.ssh/id_<username>
  • Databases: Create MySQL database → manage via phpMyAdmin.

✅ At this point, your hosting is ready for PHP apps like WordPress or Laravel.


🌐 Domains: Shared Hosting vs VPS

Shared Hosting

  • Add Website → Empty Website.

  • Domains/subdomains auto-mapped:

Main domain → /domains/<domain>/public_html/  
Subdomain  → /domains/<domain>/public_html/<subdomain>/

✅ Minimal setup — hPanel handles everything.

VPS

  • Point domain to VPS IP.

  • Manually configure Apache/Nginx (/etc/nginx/sites-available/...).

  • More control, but requires server knowledge.

⚠️ DNS propagation: Usually 5–6 hours, up to 48 hours. Monitor via whatsmydns.net.


🌐 Subdomains in Shared Hosting

Shared hosting structures can be tricky:

Main domain  → /domains/example.com/public_html/  
Subdomain    → /domains/example.com/public_html/blog.example.com/

⚠️ Issue: Deploying the main domain via CI/CD can overwrite subdomain folders.

Fix: Treat the main domain like a subdomain using .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/example.com/public/
    RewriteRule ^(.*)$ example.com/public/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

✅ This way, each site lives in its own folder → safer CI/CD pipelines.

Alternative deployment: Use File Manager to upload .zip files or FTP accounts for quick uploads.


🛠️ Setup a PHP Application with Composer

SSH access makes managing PHP apps much easier.

  1. Connect via SSH

     ssh -p <port> <username>@<server_ip>
    

    ⚠️ Hostinger often uses non-standard ports (e.g., 65002).

  2. Install Composer

     php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
     php composer-setup.php
     php -r "unlink('composer-setup.php');"
    
     mv composer.phar ~/composer
    
  3. Clone Laravel Project

     git clone https://github.com/<username>/<project>.git
     cd <project>
    
  4. Install Dependencies

     php ~/composer install
    
  5. Configure Laravel

     cp .env.example .env
     nano .env
    

    Example config:

     APP_ENV=production
     APP_DEBUG=false
     APP_URL=<your_app_url>
    
     DB_CONNECTION=mysql
     DB_HOST=127.0.0.1
     DB_PORT=3306
     DB_DATABASE=<your_database_name>
     DB_USERNAME=<your_db_user>
     DB_PASSWORD=<your_db_password>
    
     php artisan key:generate --ansi
     php artisan storage:link
    
  6. Database Setup

     php artisan migrate
     php artisan db:seed
    

As engineers, we usually automate deployments using FTP, SSH, or CI/CD pipelines instead of manual steps.


⚡ Deploying Laravel/PHP Apps

Laravel expects the web server to serve from the public/ folder, while shared hosting defaults to public_html/.

Two options:

1️⃣ .htaccess Redirect (quick fix)

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

2️⃣ Symlink (Recommended)

rm -rf public_html
ln -s public public_html

🤖 Automating Deployment with GitHub Actions

Here’s an example workflow for Laravel + React deployment:

name: 🚀 Deploy Website

on:
  push:
    branches: [main]

jobs:
  web-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: shivammathur/setup-php@v2
        with:
          php-version: "8.2"

      - run: composer update --no-interaction --prefer-dist
      - run: php artisan storage:link

      - uses: actions/setup-node@v4
        with:
          node-version: "21"

      - run: npm install
      - run: npm run build

      - uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: ${{ secrets.FTP_SERVER }}
          port: ${{ secrets.FTP_PORT }} # usually 21
          username: ${{ secrets.FTP_USER }}
          password: ${{ secrets.FTP_PASSWORD }}
          server-dir: /

✅ Store FTP credentials in GitHub Secrets for security.

Using FTP + CI/CD allows consistent, repeatable deployments without manual intervention.


🛑 Why Node.js, Rust, and Go Don’t Work on Shared Hosting

Shared hosting has strict limits:

  • ❌ No root access → can’t install runtimes.

  • ❌ No process managers (systemd, PM2, Docker).

  • ❌ Restricted environment for security/fair usage.

Hacky workarounds fail in production: apps die after logout, no logs, no scaling.

✅ Shared hosting = fine for PHP apps, not for modern stacks.


🌐 Moving to VPS

When projects grow (APIs, microservices, CI/CD automation), VPS is the natural next step.

Hostinger VPS Example

  • KVM 2: $6.99/mo (renews $12.99)

  • 2 vCPU cores, 8 GB RAM, 100 GB NVMe, 8 TB bandwidth

VPS Benefits

  • ✅ Run any stack (PHP, Node.js, Rust, Go, Docker)

  • ✅ Full root access (server, firewall, cron jobs)

  • ✅ CI/CD pipelines over SSH

  • ✅ Dedicated resources, better performance

🔍 Shared Hosting vs VPS at a Glance

FeatureShared HostingVPS
Root Access❌ No✅ Yes
Custom Runtimes❌ Limited✅ Full
Deployment Automation⚠️ FTP only✅ CI/CD
Scalability❌ Limited✅ High

📝 Final Thoughts

  • Shared Hosting: Great for quick starts. Use .htaccess wisely, isolate subdomains, and leverage hPanel.

  • Limitations: No modern runtimes, no root access, restricted environment.

  • VPS: Full control, automation, scalability — the right choice when projects outgrow shared hosting.

If you’re tired of .htaccess hacks or want to run modern backend apps, VPS is the next step.

More from this blog

I

Insaf’s Dev Journal

28 posts