How to Install Laravel Rust on macOS (Apple Silicon): From Zero to a Running Local App

Conceptual AI-generated illustration of a laptop with a terminal window and a crab-like gear icon

Laravel has a Rust edition. The official docs say it is in beta, so releases before 1.0 may include breaking changes to APIs and configuration. This guide takes you from a clean Mac to a running Laravel Rust app on your local machine, using SQLite so there is no database server to set up.

What you need

  • A Mac and Terminal. zsh is the macOS default.
  • Rust 1.99 or later, per the Laravel docs.
  • Node.js (the LTS release) and Git. Most machines already have Git.
  • The Laravel CLI, which we install in Step 3.

You don’t need PHP or Composer for Laravel Rust.

Step 1: Install Rust

Laravel’s docs use rustup, Rust’s official installer:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Choose the standard installation. Then open a new terminal tab and check:

rustc --version
cargo --version

If you already have Rust, run rustup update instead. If you see “command not found”, see zsh: command not found: rustc. If the installer stops with a permission error, see could not amend shell profile.

Step 2: Install Node.js and Git

Download the Node.js LTS release from nodejs.org. It has a graphical installer for macOS. Check both tools:

node --version
git --version

Step 3: Install the Laravel CLI

curl -fsSL https://laravel.com/install.sh | sh

The installer puts the laravel command in ~/.laravel/bin and adds that folder to your PATH, so open a new terminal tab before you use it. Check which command you get:

laravel --version

The output should start with Laravel CLI. If it doesn’t, or if the installer warned that laravel is shadowed, see the PATH fix. If you get zsh: command not found: laravel, see that fix.

Step 4: Create your app

laravel new rust-app --rust
cd rust-app

If you leave out --rust, the CLI asks which language you want. Choose Rust. If you get The "--rust" option does not exist, an older laravel command is running. See that fix.

The CLI downloads the app, creates its .env file, installs the frontend dependencies and compiles it. It also generates the APP_KEY in .env. Keep that file secret and don’t commit it to Git.

Step 5: Choose a database

A new app uses PostgreSQL by default. The simplest way to start on a Mac is SQLite, which keeps the whole database in one file. Switching takes two edits, and you need both.

Edit 1: Cargo.toml. In the [dependencies] section, find the laravel-rust line and replace the database-postgres feature with database-sqlite:

laravel-rust = { version = "0.1", features = ["database-sqlite"] }

Keep the version number your project already has. Only the feature changes.

Edit 2: .env. Set the connection:

DB_CONNECTION=sqlite
DATABASE_URL=sqlite://storage/app/database.sqlite?mode=rwc

The path is relative to the project folder. mode=rwc creates the file on first use, as long as the parent folder exists:

mkdir -p storage/app

If you only change .env, laravel migrate fails with database connection sqlite uses an unsupported or disabled driver. See that fix for why.

For MySQL, use the database-mysql feature instead and a mysql:// URL. To keep PostgreSQL, leave both files as they are and make sure a database named laravel is running.

Step 6: Run the migrations

laravel migrate

The CLI compiles your app first, so the first run is slow after you change Cargo.toml. If the database doesn’t exist, migrate offers to create it.

On my Mac (Apple silicon, SQLite) the output looked like this:

◇ Migrating `0001_01_01_000000_create_users_table`...
◇ Migrating `0001_01_01_000001_create_cache_table`...
◇ Migrating `0001_01_01_000002_create_jobs_table`...
◆ 3 migrations ran.

In that version, the migrations create the users, cache and jobs tables. If you see 3 migrations ran, the database is ready.

Step 7: Start the app

laravel dev

This starts three processes together:

Process What it does Address
server Runs your Rust app http://127.0.0.1:8000
queue Runs queue:work for the database:default queue none
vite Builds the frontend, with Inertia SSR http://localhost:5173

Here is the output from my Mac, shortened:

[server]     Blocking waiting for file lock on package cache
[server]     Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.96s
[vite]   VITE+ v1.8.0  ready in 552 ms
[vite]   ➜  Local:   http://localhost:5173/
[vite]   ➜  APP_URL: http://localhost:8000
[server] Server running at `http://127.0.0.1:8000`. Press Ctrl+C to stop.
[queue] Processing jobs from `database:default`. Press Ctrl+C to stop.
[server] GET     200  /  15.8ms

Open http://localhost:8000 in your browser. GET 200 / in the log means the welcome page loaded.

Is this output normal?

  • Blocking waiting for file lock on package cache: Cargo prints this while another Cargo process is using the package cache or build folder. The server and queue both run cargo, so it is a short wait, not an error. The first start is slower because of the compile.
  • 404 /apple-touch-icon.png and 499 /favicon.ico: the browser is asking for icons the app doesn’t serve. They are harmless in my log.
  • Restarts: the server and queue restart when src, Cargo.toml, Cargo.lock or .env change. That comes from the nodemon lines in the log.
  • Stopping: press Ctrl+C. The command uses concurrently --kill-others, so stopping one process stops the others.

The versions above (Vite+ 1.8.0, nodemon 3.1.11) are what my log printed. They are not requirements.

To list your routes, run laravel route:list. To see every command, run laravel list.

Troubleshooting

  • The "--rust" option does not exist: the old PHP installer is running. See the fix.
  • Installer warns that laravel is shadowed: see the PATH fix.
  • zsh: command not found: laravel: see the PATH fix.
  • zsh: command not found: rustc: see the rustc fix.
  • database connection sqlite uses an unsupported or disabled driver: you changed .env but not Cargo.toml. See the fix.
  • Other database connection errors: check that .env matches the database you chose, and that PostgreSQL or MySQL is running if you use one of them.

FAQ

Is Laravel Rust ready for production? The docs call it a beta, so expect breaking changes before 1.0.

Do I need PHP? No.

Do the same steps work on an Intel Mac? The docs don’t separate Apple silicon from Intel, and I haven’t run the steps on either, so treat them as the documented steps.

Where do I deploy it? The docs recommend Laravel Cloud. I haven’t tested other hosts.

Sources:

Leave a Reply