HTMX + Laravel

IntermediateWeb App

Laravel Blade templates enhanced with HTMX: PHP interactivity without writing JavaScript.

Published 27 September 2026Last updated 16 October 2026

Core Tools
HTMX
HTMX
Laravel
Laravel
PHP
PHP
HTML
HTML
CSS
CSS
Database
PostgreSQL
MySQL
MariaDB
Hosting
Hetzner
Railway
Render
Fly.io
DigitalOcean

About HTMX + Laravel

HTMX + Laravel brings server-driven interactivity to Laravel's Blade templating system. HTMX lets Blade-rendered HTML trigger HTTP requests and replace sections of the page with the server response, giving the feel of a single-page app while keeping all logic in PHP Laravel controllers. PostgreSQL is the database, Tailwind CSS is an optional styling addition, and a cost-effective VPS is the typical host.

Laravel routing, Eloquent ORM, and Blade components are all fully preserved alongside HTMX. A table row with hx-delete and hx-target removes itself from the DOM when the Laravel controller confirms deletion, without a page reload or a custom JavaScript fetch. Search inputs with hx-get and hx-trigger="keyup delay:300ms" send requests as the user types and HTMX replaces the results container. Laravel returns a Blade partial; HTMX swaps it in.

This stack is the natural progression for Laravel developers who want more interactivity than full-page reloads provide, without adopting Livewire or building a separate Vue or React SPA. Affordable VPS hosting keeps costs low for PHP applications that do not need serverless scaling. The combination of Laravel's productivity and HTMX's minimal footprint is compelling for teams that live in PHP but want modern UX.

Key Features

  • ✓HTMX partial updates swap Blade partial responses into the page without full reloads
  • ✓Laravel controllers return either full Blade views or partial fragments based on HTMX request headers
  • ✓Eloquent ORM with relationships, scopes, and migration history for PostgreSQL
  • ✓Tailwind CSS utility classes work naturally with server-rendered Blade templates
  • ✓Laravel auth, queues, events, and notifications remain fully available
  • ✓Low-cost VPS hosting, significantly cheaper than PaaS platforms for PHP apps

When to Use HTMX + Laravel

  • Laravel apps that need more interactivity than Blade plus full-page reloads can provide
  • Teams that want to avoid Livewire or a React/Vue SPA without sacrificing UX
  • Admin panels and internal tools with inline editing, filters, and live search
  • Data entry workflows where partial validation feedback improves the experience

Pros

  • Laravel developers add interactivity to existing Blade apps with minimal new concepts
  • No JavaScript build pipeline: no npm, no webpack, no package.json in the PHP project
  • A VPS such as Hetzner is significantly cheaper than PaaS platforms for PHP workloads
  • Server-side rendering keeps SEO intact, and HTMX pages are indexable without extra configuration

Cons

  • Network round-trips on every HTMX interaction, so it's not suitable for real-time collaborative features
  • Rich client-side interactions (drag-and-drop, canvas, complex animations) still require JavaScript
  • A self-managed VPS requires server configuration, without the managed deploys of a PaaS platform
  • HTMX and Livewire serve similar use cases, and teams sometimes struggle choosing between them

Database Options for HTMX + Laravel

PostgreSQL

HTMX + Laravel with PostgreSQL

The standard choice: a full PostgreSQL instance on a managed host or your own server, connected from Laravel via Eloquent, with complete control over configuration and extensions.

MySQL

HTMX + Laravel with MySQL

The other half of the classic LAMP-adjacent PHP stack: Eloquent talks to MySQL exactly the same way it talks to PostgreSQL, so this is a vendor choice, not an architecture change. Worth it if your host, team, or existing tooling is already MySQL-centric.

MariaDB

HTMX + Laravel with MariaDB

Laravel's Eloquent ORM and Query Builder support MariaDB through the same MySQL driver, and Laravel's own documentation lists MariaDB as a supported database alongside MySQL. Pick this over MySQL for MariaDB's fully open licensing, or when that's what your host defaults to.

These are highlighted picks. To see all the tools, check the Databases category.

Hosting Options for HTMX + Laravel

Hetzner

Deploy HTMX + Laravel on Hetzner

A self-hosted VPS running the whole Laravel + HTMX app yourself, at the price of managing deployment and updates. Entry-level instances start around €4-5/mo, the cheapest option here, though there's no bundled CDN.

Railway

Deploy HTMX + Laravel on Railway

A container-based platform where the whole Laravel + HTMX app deploys as a persistent service, a natural fit for PHP-FPM holding a live database connection pool. No free tier: the Hobby plan starts around $5/mo in usage credit, plus usage-based billing for CPU, memory, and network. Auto-deploys on push.

Render

Deploy HTMX + Laravel on Render

The same persistent-service model as Railway, with a genuinely free tier for small Laravel apps, built-in cron jobs, and its own CDN for static assets. Free-tier services spin down after inactivity; predictable always-on pricing starts around $7/mo.

Fly.io

Deploy HTMX + Laravel on Fly.io

Runs the Laravel app as a container close to users across multiple regions, useful if latency to a geographically spread user base matters more than raw cost. Billing is usage-based with only a small free allowance.

DigitalOcean

Deploy HTMX + Laravel on DigitalOcean

A managed VPS or App Platform deployment with predictable flat-rate pricing, starting around $4-6/mo for a basic Droplet or about $5/mo for App Platform's smallest tier.

These are highlighted picks. To see all the tools, check the Hosting & Cloud category.

HTMX + Laravel Add-ons

Each addition below extends this stack with a capability the base stack works fine without. None are required: include the ones your product actually needs when building this stack, and skip the rest.

App features and services

5

What your users see and use: sign-in, payments, email, and the look and feel of the interface.

Authentication Add-ons

Add authentication when the app needs user accounts — sign-up, login, and data scoped to a specific user instead of a fully open app.

Laravel Fortify
HTMX + Laravel with Laravel Fortify

Laravel's official headless authentication backend: registration, email verification, password reset, and two-factor authentication out of the box, wired into Laravel's own Auth facade. The default here because it's what most Laravel projects reach for once they need more than the framework's bare guards and providers.

Auth0
HTMX + Laravel with Auth0

A hosted identity platform with an official PHP SDK for verifying sessions in Laravel middleware, worth it over Fortify if you'd rather not self-host the auth logic at all, or need enterprise features like SSO that Fortify doesn't cover.

These are highlighted picks. To see all the tools, check the Authentication category.

Email Add-ons

Add email when the app needs to send account verification, password reset, or notification messages.

Resend
HTMX + Laravel with Resend

A transactional email API for account verification, password resets, and notification emails, sent via Resend's official Laravel package, which plugs into Laravel's own Mail facade, with a free tier for getting started.

SendGrid
HTMX + Laravel with SendGrid

The established high-volume choice, with dedicated IP addresses and deliverability tooling for apps sending at serious scale. No permanent free plan (a 60-day trial, then paid tiers), so it earns its slot when volume and deliverability matter more than upfront cost.

Brevo
HTMX + Laravel with Brevo

An all-in-one platform combining the transactional email API with marketing campaigns, a built-in CRM, and SMS from the same dashboard. A permanent free tier of 300 emails a day with no card required makes it an easy starting pick for an early-stage app.

Payments Add-ons

Add payments when the product is ready to charge for subscriptions or one-time purchases.

Stripe
HTMX + Laravel with Stripe

Adds subscription billing, one-time checkout, and invoicing via Stripe's hosted Checkout or embedded Elements, with Laravel handling webhook verification and API calls server-side. The stack works fully without it; add this once the product is ready to charge for something.

Styling Add-ons

Add styling when you want a component or utility-class system to build the UI faster than hand-writing CSS from scratch.

Tailwind CSS
HTMX + Laravel with Tailwind CSS

A utility-class CSS framework: styles are composed directly in markup via class names instead of writing separate stylesheet files. The default styling choice bundled by most modern framework CLIs (create-next-app, create-vue, the SvelteKit and Astro starters all offer it), and the base layer shadcn/ui components are built on when that's loaded into the catalog in the future.

Bootstrap
HTMX + Laravel with Bootstrap

Ready-made components and a grid for Blade templates, a long-standing choice in Laravel projects and available through the laravel/ui package, which can scaffold Bootstrap-styled auth views. Laravel's official starter kits ship with Tailwind, so Bootstrap means setting up the Vite build yourself. Pick it or Tailwind, not both.

These are highlighted picks. To see all the tools, check the CSS Frameworks category.

Interactivity Add-ons

Add client-side interactivity when you want local UI state — toggles, modals, dropdowns, tabs — without a full JS framework or an extra server round trip.

Alpine.js
HTMX + Laravel with Alpine.js

Alpine.js is the client-side half of Laravel's own official TALL stack (Tailwind, Alpine, Laravel, Livewire) and ships by default in the Breeze and Jetstream starter kits, so most Laravel + HTMX projects already have it a composer create-project away. It handles local UI state (toggles, modals, dropdowns) that does not need a server round trip, leaving HTMX free to handle the parts that do.

These are highlighted picks. To see all the tools, check the HTML-first Frameworks category.

Under the hood (backend)

2

Services your users never see, which store data and keep the app fast and reliable.

Object Storage Add-ons

Add object storage when your app accepts file uploads or produces files, such as avatars, documents, images, and exports, and those files should live outside your database and server disk.

Cloudflare R2
HTMX + Laravel with Cloudflare R2

S3-compatible object storage with no egress fees, so serving uploads, images, and exports costs only for storage and operations. Laravel's s3 filesystem disk, built on Flysystem's S3 adapter, accepts a custom endpoint, so Storage::put and temporaryUrl work unchanged and the keys stay in .env. The 10 GB free tier covers an early product.

Amazon S3
HTMX + Laravel with Amazon S3

The reference object store and the API the others copy, with the most storage classes, regional controls, and lifecycle rules. Laravel's s3 filesystem disk, built on Flysystem's S3 adapter, accepts a custom endpoint, so Storage::put and temporaryUrl work unchanged and the keys stay in .env. It fits best when the rest of the app already runs on AWS, though data transfer out is billed.

Backblaze B2
HTMX + Laravel with Backblaze B2

An S3-compatible store at roughly a third of S3 Standard's storage price, a fit for backups and large media libraries. Laravel's s3 filesystem disk, built on Flysystem's S3 adapter, accepts a custom endpoint, so Storage::put and temporaryUrl work unchanged and the keys stay in .env. Egress is free up to three times the stored data, and a CDN in front of a public bucket covers heavier delivery.

These are highlighted picks. To see all the tools, check the Object Storage category.

Caching Add-ons

Add caching when the same reads or computations repeat and you want them answered from memory: a cache holds hot data, shared counters, and session state in front of a database or an upstream API.

Redis
HTMX + Laravel with Redis

Laravel's Cache facade on its built-in Redis driver: Cache::remember stores rendered Blade partials and slow query results that HTMX requests fetch again and again, and the session and queue drivers can share the same Redis. Switching is CACHE_STORE=redis plus a connection in config/database.php. PostgreSQL already serves hot rows from memory, so add Redis when repeated fragment renders begin to slow responses.

Build and deploy

2

Testing, packaging, and shipping your code on every change.

CI/CD Add-ons

Add CI/CD when you want a dedicated pipeline for running tests, linting, or multi-stage builds before a deploy goes out. Many hosting platforms already redeploy automatically on every push on their own — a CI/CD tool adds the most value on top of that by gating the deploy on a passing test suite, and matters even more when the hosting choice does not auto-deploy at all, such as a self-hosted server.

GitHub Actions
HTMX + Laravel with GitHub Actions

Runs the test suite and triggers deployments on every push, directly from the same GitHub repo the code already lives in, with no separate CI service to configure.

GitLab CI/CD
HTMX + Laravel with GitLab CI/CD

GitLab's built-in CI/CD system, configured via .gitlab-ci.yml in the repository, the natural pick if the project's code lives on GitLab (self-hosted or gitlab.com) rather than GitHub, with the same YAML-pipeline model as GitHub Actions.

These are highlighted picks. To see all the tools, check the CI/CD Pipelines category.

Containerization Add-ons

Add containerization when you want the app packaged the same way across local development, staging, and production, or need to deploy somewhere that isn't a managed serverless platform.

Docker
HTMX + Laravel with Docker

Packages the whole Laravel + HTMX app into a container image for consistent local development and deployment, independent of the hosting platform chosen above.

These are highlighted picks. To see all the tools, check the Containerization category.

Monitoring and analytics

2

For you rather than your users: what people do in the app, what breaks, and why a model answered the way it did.

Observability Add-ons

Add observability when you want to catch errors and performance regressions in production before users have to report them.

Sentry
HTMX + Laravel with Sentry

Error tracking and performance monitoring with a dedicated sentry-laravel SDK, covering both HTTP requests and queued jobs. Open-source with a self-hosted path, alongside its own managed cloud.

Datadog
HTMX + Laravel with Datadog

A broader observability platform covering APM, infrastructure metrics, and log management in one dashboard, useful once a team is already running other services worth monitoring alongside this app. Managed-only, with pricing that scales by host and usage rather than Sentry's per-error volume.

These are highlighted picks. To see all the tools, check the Infrastructure & APM category.

Analytics Add-ons

Add analytics when you want to measure traffic, track visitor behavior, or understand how people actually use the product.

PostHog
HTMX + Laravel with PostHog

An all-in-one product analytics platform: event tracking, session replay, feature flags, and A/B testing in one SDK. The richest feature set if you want more than pageviews.

Google Analytics
HTMX + Laravel with Google Analytics

The industry-standard, free analytics platform, with native Google Ads and Search Console integration. Requires a cookie consent banner in most jurisdictions (GDPR/CCPA), and all data lives on Google's infrastructure, the tradeoff the other three picks were built to avoid.

Plausible Analytics
HTMX + Laravel with Plausible Analytics

A lightweight, privacy-first analytics tool with no cookie banner required. A good fit for simple traffic metrics without PostHog's broader feature surface.

Umami
HTMX + Laravel with Umami

Open-source and self-hostable, keeping analytics data on infrastructure you control. Pairs naturally with the self-hosted Hetzner hosting option above if you want to avoid a third-party analytics vendor entirely.

These are highlighted picks. To see all the tools, check the Web & Product Analytics category.

Frequently Asked Questions about HTMX + Laravel

How does this compare to the Laravel Starter stack (without HTMX)?

Same Laravel core as Laravel Starter; HTMX adds partial-page swaps for specific interactions without a JS framework or build step. Add it once full-page reloads start feeling slow for common interactions; skip it for a mostly-static site.

How does this compare to the HTMX + Django, HTMX + FastAPI, and HTMX + Rails stacks?

All four pair HTMX with a different backend. Here Laravel brings Eloquent and Blade; HTMX + Django brings Django's built-in ORM and admin panel; HTMX + FastAPI brings FastAPI's async performance; HTMX + Rails brings ActiveRecord and its own Turbo/Hotwire alternative. HTMX itself works the same way on all four, so pick based on which backend fits the rest of the project.

Should I use Laravel Fortify or Auth0?

Laravel Fortify is the ecosystem-standard choice: registration, email verification, password reset, and two-factor authentication out of the box, self-hosted and free. Auth0 is worth it instead if you'd rather not run the auth logic yourself, or need enterprise features like SSO that Fortify doesn't cover.

What's the cheapest way to run this stack?

Self-hosted PostgreSQL and skipping the paid addition tools cost nothing beyond hosting. Every hosting option here (Railway, Render, Hetzner, Fly.io) charges from day one for an always-on process, so expect at least about $5/mo once you're past local development.

Scores

Popularity2/5

Emerging

Laravel is well-established, but pairing it with HTMX specifically is a smaller, if fast-growing, pattern compared to a JS framework frontend — genuinely capable for the "server-rendered but interactive" niche, not yet a mainstream default.

Learning Curve3/5

Moderate

Laravel's conventions (Eloquent, Blade, routing) are well-documented and approachable, and HTMX adds only a handful of HTML attributes rather than a new templating language. The adjustment is returning HTML fragments from Laravel controllers instead of full pages or JSON.

Flexibility3/5

Configurable

Laravel's ORM and Blade templates are opinionated about project structure, and HTMX itself just swaps HTML fragments without adding flexibility on top. Consistent and productive, not a highly configurable setup.

Performance4/5

Fast

HTMX's partial-page swaps avoid a full page reload for most interactions, and Laravel's Blade compiles to plain PHP for fast rendering. Not a 5 only because every interaction is still a server round-trip.

Portability3/5

Some lock-in

Laravel and HTMX are both open-source with no vendor lock-in, portable to any PHP-capable host. The main migration cost is Laravel's own Eloquent/Blade conventions — HTMX itself adds very little coupling since it's just HTML attributes.

Tools in the HTMX + Laravel Stack

Frontend Frameworks

Backend Frameworks

Programming Languages

Database (choose one)

Hosting (choose one)

Add-ons (optional — add any, or none)
App features and services

Authentication

Email

Payments

Styling

Interactivity

Under the hood (backend)

Object Storage

Caching

Build and deploy

CI/CD

Containerization

Monitoring and analytics

Observability

Analytics

HTMX + Laravel Pricing

From ~$5/mo Free to start

Laravel, HTMX, Tailwind CSS, PHP and PostgreSQL are all open-source and free. HTMX adds interactivity without a separate JavaScript build or frontend host, so you only pay for one app server and a database: about $5–20/mo on Railway, Render, Fly.io or Hetzner, with managed Postgres from roughly $6–15/mo if you don't self-host.

Core toolsFree (open source)

Laravel, HTMX, Tailwind CSS, PHP and PostgreSQL are free.

Hosting$5–20/mo

A single app server on Railway, Render, Fly.io or Hetzner; free tiers for testing.

Database (PostgreSQL)Free–$15/mo

Self-host for free, or use managed Postgres from about $6–15/mo.