Back to blog
LaravelHomelabDevOps

Laravel Rust for applications I want to self-host

Laravel’s Rust beta keeps useful conventions while offering a practical route to deploy self-hosted applications.

By Isma6 min read

The problem is not just choosing Rust

When I run an application in my homelab, I am not only looking for low memory use or fast responses. I also need a familiar structure, migrations, queues, environment-based configuration, and a sensible way to operate the service after deployment. Rust solves an important part of that problem, but it does not provide application conventions on its own.

Laravel Rust is trying to cover that layer. The first beta, announced on December 1, 2026, is not Laravel PHP rewritten with Rust syntax: it is a Rust implementation with its own API and language-native approach. Still, it keeps ideas that will feel familiar to anyone who has built applications with Laravel before.

Enough surface area to build something real

This is not just a router with a few helper functions. The official documentation covers routing, middleware, sessions, authentication, validation, database access, queues, workflows, broadcasting, WebSockets, views, and Inertia. That matters because it makes a complete application possible without assembling half a dozen libraries before writing the first feature.

Routes live under src/routes/ and are registered from src/app.rs. Web routes include sessions, encrypted cookies, and CSRF protection, while API routes are stateless and use the configured prefix. That is easy to explain and useful once an application grows to include a user interface, an API, and webhooks.

use laravel::prelude::*;
 
use crate::http::handlers::users;
 
pub fn routes(route: &mut Router) {
    route.get("/users", users::index);
    route.get("/users/{user}", users::show);
    route.post("/users", users::store);
}

Validation is declared through Rust types as well. A struct marked with #[laravel::input] can define field rules with #[validate(...)] attributes, and a handler receives that data after it has passed validation. Developers coming from FormRequest will notice the syntax change, but the underlying goal is familiar: keep input shape and input rules together.

Queues and workflows without a new mental model

Queues remain essential when an application sends mail, processes files, or calls external services. Laravel Rust documents drivers for the database, Redis, Amazon SQS, and Laravel Cloud, plus the laravel queue:work worker. In a self-hosted setup, starting with a database queue and moving to Redis when needed is a sensible path.

Workflows are the feature I would inspect most carefully. They are designed for processes that last days or weeks rather than a single request, and whose steps must survive restarts, deployments, or external waits. The framework persists step results and can pause a flow through run.sleep(...), instead of requiring a custom system of chained jobs, state columns, and recovery tasks.

That does not mean every asynchronous task should become a workflow. For short-lived work that does not need to survive a restart, the documentation points to task::background inside the current process. Keeping those two cases separate avoids adding persistence and coordination where they provide no value.

A practical fit for the homelab

The deployment model is the appealing part for people running their own infrastructure. An application is compiled in release mode and produces a binary under target/release/, with migrations built into it. That simplifies delivery, but it does not mean the server only needs one file.

The binary still needs public/ for compiled assets, resources/views/ when views are used, and storage/ for writable application data. If Inertia server-side rendering is enabled, bootstrap/ssr/ must be deployed too, along with the required Node process. This is worth understanding before creating an overly minimal container image or systemd unit.

Configuration keeps the familiar environment-variable pattern. PostgreSQL is the default for a new application, but the documentation allows MySQL and SQLite by changing the laravel-rust feature in Cargo.toml and updating the connection settings. SQLite may be a very good fit for small personal services, while PostgreSQL or MySQL make more sense with higher concurrency, replicas, or larger operational requirements.

APP_ENV=production
APP_DEBUG=false
APP_KEY=base64:...
APP_URL=https://example.com
DATABASE_URL=postgres://app:password@example.com/app

Inertia and realtime features without a separate API

Laravel Rust includes Inertia integration for React, Vue, and Svelte. That makes it possible to build a modern application without automatically committing to a separate JSON API for every screen. For internal dashboards, admin tools, and smaller products, that can reduce duplicated work between backend and frontend.

Broadcasting and WebSockets are also included through Reverb. According to the documentation, the server is enabled with the reverb feature and started with laravel reverb:start. That is enough to build notifications, job status updates, or live interface changes without adding a separate realtime server from day one.

The fine print on a beta release

The first point is not to mistake beta for a stable platform. The documentation explicitly warns that releases before 1.0 may introduce breaking changes to APIs and configuration. That is acceptable for learning projects or controlled internal tools, but it deserves a more careful risk assessment for a production-critical application.

It is also not Laravel PHP with a different syntax. Even if many conventions are recognizable, Rust, its compiler, its type system, Cargo, and the framework’s own choices still have to be learned. Migrating an existing Laravel application will not be a matter of copying controllers, models, and packages; it will require redesigning and reimplementing parts of the system.

Finally, a compiled binary does not remove operations work. Secrets, backups, queue workers, migrations, persistent storage, reverse proxying, TLS, and monitoring still exist. The /up health endpoint is useful for a monitor or load balancer, but it is not a replacement for a deployment and recovery strategy.

Where I would start

I would not use this beta to replace a mature Laravel application that already works. I would use it for a new and contained project: a homelab inventory, a task dashboard, an automation tool, or a service that needs queues and long-running processes. Those projects make it possible to learn the full proposal without turning the experiment into a difficult dependency.

The combination of Laravel conventions, Rust types, and compiled-binary deployment makes sense on self-managed infrastructure. It is important to start with the expectation that the framework will still change and that its ecosystem is at an early stage. But there is already enough technical surface to build and teach a real application, which is far more useful than a routing demo.


Source: Introducing Laravel Rust Official Laravel Rust documentation

Newsletter

What I learn coding with AI, every two weeks in your inbox.

Real numbers, mistakes included. No spam, unsubscribe in one click.

No spam, unsubscribe in one click. I only use your email to send you this and the newsletter. More in the privacy policy.