DEV Community

hamed pakdaman
hamed pakdaman

Posted on • Originally published at unfoldcms.com

Self-Hosted CMS on Shared Hosting: What Works in 2026

📝 Originally published on unfoldcms.com — reposted here for the DEV community. (I work on UnfoldCMS.)

Shared hosting is where most developers start. It's cheap, it's familiar, and it's already running millions of WordPress sites. The question is whether a modern self-hosted CMS can run there too — or whether you're forced onto a VPS the moment you want to own your stack.

The honest answer: it depends on the CMS, and the limitations are real. This post covers what actually works on shared hosting in 2026, what breaks, and when a $4/month VPS makes more sense.

TL;DR: A PHP-based self-hosted CMS can run on shared hosting if the host supports PHP 8.x, MySQL 8, and composer. The main constraints are no persistent queue workers, limited cron job reliability, and no root access for server tuning. For most small sites, these constraints are acceptable. For anything with high traffic or complex background tasks, a VPS is the better call.


What Shared Hosting Actually Gives You

Shared hosting means your site runs on a server shared with hundreds of other sites. You get a slice of resources — CPU, RAM, disk — without root access or the ability to configure the server stack.

Modern shared hosting (cPanel-based hosts like SiteGround, Hostinger, or A2 Hosting) typically includes:

  • PHP 8.1–8.3 (selectable per-site)
  • MySQL 5.7 or 8.0
  • Composer (sometimes, or you deploy vendor directory manually)
  • SSH access (on better plans)
  • Cron jobs (one entry, running every 5 minutes minimum)
  • Let's Encrypt SSL (free, auto-renewing)

What you don't get:

  • Root access or sudo
  • Ability to install system packages (Node, Redis, custom PHP extensions)
  • Persistent background processes or queue workers
  • PHP-FPM configuration (pool settings, process manager)
  • Nginx (almost always Apache)
  • More than ~512MB RAM per PHP process

These constraints shape what's possible.


Can a Laravel-Based CMS Run on Shared Hosting?

Yes — with caveats. Laravel itself runs fine on shared hosting as long as:

  1. PHP 8.1+ is available (most modern hosts support this)
  2. MySQL is available (always true on shared hosting)
  3. You can deploy the vendor/ directory (either via SSH + Composer, or by committing it)
  4. The .htaccess rewrite rules work (Apache mod_rewrite must be enabled)

The full VPS setup guide for UnfoldCMS covers a proper server stack. On shared hosting, you skip the server configuration steps and deploy directly into the public_html directory — but you need to be careful about directory structure.

The directory problem: Laravel's public root is the public/ folder. On shared hosting, the web root is typically public_html/. You have two options:

Option A — Symlink approach (requires SSH):

# Deploy CMS one level above public_html
/home/user/cms/          ← CMS root
/home/user/public_html/  ← Web root (symlink or copied files)
Enter fullscreen mode Exit fullscreen mode

Copy the contents of public/ into public_html/, then update index.php to point to the CMS root:

require __DIR__.'/../cms/vendor/autoload.php';
$app = require_once __DIR__.'/../cms/bootstrap/app.php';
Enter fullscreen mode Exit fullscreen mode

Option B — Subdirectory install:
Deploy everything under a subdomain (cms.yourdomain.com) with its own document root pointing to the public/ folder. Cleaner and more secure.


The Queue Worker Problem

This is the biggest constraint on shared hosting. Laravel (and most modern CMSes) use background jobs for things like sending emails, processing media, generating sitemaps, and syncing data.

Background jobs need a persistent process — a queue worker — running continuously. Shared hosting doesn't allow persistent processes.

The workaround: QUEUE_CONNECTION=sync

In your .env, set:

QUEUE_CONNECTION=sync
Enter fullscreen mode Exit fullscreen mode

This runs jobs synchronously, inline with the web request. No queue worker needed. The trade-off: the user's request waits for the job to complete before getting a response.

For most CMS operations — publishing a post, saving settings, uploading an image — sync mode works fine. The operations are fast enough that the user barely notices.

Where sync mode breaks down:

  • Sending bulk emails (blocks the request for seconds)
  • Heavy image processing (resizing large files synchronously)
  • Any job that could fail and needs retry logic

UnfoldCMS is built for shared hosting compatibility — QUEUE_CONNECTION=sync is the default, and all core features work without a queue worker. The benefits of self-hosting your CMS don't require a VPS to access.


Cron Jobs on Shared Hosting

Most self-hosted CMSes need scheduled tasks — publishing posts at a set time, clearing caches, sending digest emails. On a VPS, you run:

* * * * * cd /path && php artisan schedule:run
Enter fullscreen mode Exit fullscreen mode

On shared hosting, cron jobs have two limitations:

  1. Minimum interval is usually 5 minutes (not 1 minute like a VPS)
  2. The PHP path varies — you often need to use the full path to PHP

Set up your cron via cPanel → Cron Jobs:

*/5 * * * * /usr/local/bin/php /home/user/cms/artisan schedule:run >> /dev/null 2>&1
Enter fullscreen mode Exit fullscreen mode

For a CMS that publishes scheduled posts, a 5-minute interval means posts go live up to 5 minutes after their scheduled time. For most editorial workflows, that's acceptable.

If you need minute-level precision for scheduled publishing, a VPS is the right answer.


Performance on Shared Hosting

Shared hosting performance is inherently limited — you share CPU and RAM with hundreds of neighbors. But for a CMS serving moderate traffic (under ~20,000 monthly visits), a well-configured shared host is fine.

What helps:

Enable OPcache. Most shared hosts have OPcache available — check your PHP settings panel. With OPcache enabled, PHP bytecode is cached in memory. Response times drop by 30–50%.

Cache aggressively. Use file-based caching for config, routes, and views:

php artisan config:cache
php artisan route:cache
php artisan view:cache
Enter fullscreen mode Exit fullscreen mode

Run these after every deployment. Don't skip them on shared hosting — they matter more here than on a VPS because you can't tune PHP-FPM.

Use a CDN. A CDN like Cloudflare (free tier) sits in front of your shared host and caches static assets at the edge. Your shared host only handles dynamic PHP requests; CSS, JS, and images come from the CDN.

Limit plugins and heavy dependencies. Shared hosting has strict memory limits (often 256MB per PHP process). Every dependency adds memory pressure. Keep your CMS lean.


Shared Hosting vs VPS: When to Upgrade

Situation Shared Hosting VPS
Monthly visits under 20,000 ✅ Fine Overkill
Need background email sending ❌ Sync-only ✅ Queue workers
Need Redis for caching/sessions ❌ Not available ✅ Install yourself
Need custom PHP extensions ❌ Can't install ✅ Full control
Multiple sites on one server Limited ✅ Easy
Budget under $5/month ✅ Shared is cheaper
Traffic spikes or high load ❌ Resource limits ✅ Scalable

The self-hosted vs SaaS CMS comparison covers the broader decision. The shared vs VPS question is really about how much control and performance you need within the self-hosted category.

A Hetzner CX22 VPS at €4/month is roughly the same price as a basic shared hosting plan — and gives you complete control. For new projects, the VPS is usually the better starting point unless you specifically need the simplicity of cPanel.


Deploying UnfoldCMS on Shared Hosting: Step by Step

If shared hosting is your choice, here's the deployment sequence:

  1. Create a MySQL database via cPanel → MySQL Databases
  2. Upload the CMS files via SFTP or SSH (git clone if SSH is available)
  3. Install dependencies via SSH: composer install --no-dev --optimize-autoloader
  4. Configure .env with your database credentials, APP_URL, and QUEUE_CONNECTION=sync
  5. Point the document root to the public/ directory (or use the symlink approach above)
  6. Add .htaccess to public/ — Laravel ships one, make sure it's uploaded
  7. Run migrations: php artisan migrate --force
  8. Cache config/routes/views: php artisan optimize
  9. Set up cron job via cPanel with /5 * * * * interval
  10. Test by visiting your domain and checking the admin at /admin

Common shared hosting gotchas:

  • .htaccess not working: Apache mod_rewrite must be enabled — check with your host
  • 500 errors on deploy: Check storage/logs/laravel.log for the actual error
  • Composer not found: Some hosts require using the full path /usr/local/bin/composer
  • File permissions: storage/ and bootstrap/cache/ must be writable by the web server

Frequently Asked Questions

Which shared hosting providers work best for a PHP CMS in 2026?

SiteGround, A2 Hosting, and Hostinger all support PHP 8.3, MySQL 8, SSH access, and cron jobs. They're the most compatible with modern PHP CMSes. Avoid hosts that only offer PHP 7.x or don't provide SSH access.

Can I run UnfoldCMS on shared hosting without SSH?

Technically yes, but it's painful. Without SSH you can't run Composer or Artisan commands — you'd need to upload the vendor/ directory manually and configure everything via FTP. SSH access is strongly recommended; most reputable hosts include it on standard plans.

How do I handle media uploads on shared hosting?

Media uploads work normally — files go into storage/app/public/ and are served via a symlink or direct path. The constraint is disk space (shared hosting plans often cap at 10–20GB) and upload size limits (controlled by php.ini — request your host to increase upload_max_filesize).

Will my shared hosted CMS handle traffic spikes?

Probably not. Shared hosting has hard resource limits. A traffic spike (from a viral post, for example) can trigger throttling or a temporary suspension. If you expect unpredictable traffic, start on a VPS. You can always start on a $4/month Hetzner CX22 and get predictable performance.


Sources

  • PHP hosting compatibility — tested against SiteGround, A2 Hosting, and Hostinger as of May 2026
  • Laravel shared hosting documentation — official Laravel deployment docs covering .htaccess and directory structure
  • UnfoldCMS production configurationQUEUE_CONNECTION=sync default and schedule:run compatibility confirmed in the live codebase
  • Hetzner Cloud pricing — VPS cost figures verified May 2026

💬 First published on my own site: https://unfoldcms.com/blog/self-hosted-cms-on-shared-hosting/

UnfoldCMS is a self-hosted, developer-first CMS. If any of this was useful — or you disagree — I'm in the comments.

Top comments (0)